All of lore.kernel.org
 help / color / mirror / Atom feed
* control switch API/code change? (fwd)
@ 2002-02-12 21:05 Taybin Rutkin
  2002-02-13  8:13 ` Jaroslav Kysela
  0 siblings, 1 reply; 3+ messages in thread
From: Taybin Rutkin @ 2002-02-12 21:05 UTC (permalink / raw)
  To: alsa-devel

I'm sending this message on behalf of Paul Davis.

---------- Forwarded message ----------
Date: Tue, 12 Feb 2002 15:08:56 -0500
From: Paul Davis <pbd@op.net>
To: trutkin@physics.clarku.edu
Subject: control switch API/code change?

[ TAYBIN: for some reason, i can't send mail to alsa-devel right now.
  Could you forward this for me? Thanks. ]

the code below used to work just fine with an older version of
0.9.X. i just upgraded to current CVS, and found that it now causes a
segfault by overwriting h->driver->ctl_handle, apparently before we
even get to the first snd_ctl_elem_read().

for clarity, h->driver->ctl_handle is a snd_ctl_t previously opened
successfully and correctly initialized on entry to this code.

does this ring any bells in anyone's head about changes in the control
interface code?

--p


static void *
hammerfall_monitor_controls (void *arg)

{
	jack_hardware_t *hw = (jack_hardware_t *) arg;
	hammerfall_t *h = (hammerfall_t *) hw->private;
	snd_ctl_elem_id_t *switch_id[3];
	snd_ctl_elem_value_t *sw[3];

	pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL);

	snd_ctl_elem_id_malloc (&switch_id[0]);
	snd_ctl_elem_id_malloc (&switch_id[1]);
	snd_ctl_elem_id_malloc (&switch_id[2]);

	snd_ctl_elem_value_malloc (&sw[0]);
	snd_ctl_elem_value_malloc (&sw[1]);
	snd_ctl_elem_value_malloc (&sw[2]);

	set_control_id (switch_id[0], "ADAT1 Sync Check");
	set_control_id (switch_id[1], "ADAT2 Sync Check");
	set_control_id (switch_id[2], "ADAT3 Sync Check");

	snd_ctl_elem_value_set_id (sw[0], switch_id[0]);
	snd_ctl_elem_value_set_id (sw[1], switch_id[1]);
	snd_ctl_elem_value_set_id (sw[2], switch_id[2]);

	while (1) {
		if (snd_ctl_elem_read (h->driver->ctl_handle, sw[0])) {
			jack_error ("cannot read control switch 0 ...");
		}
		hammerfall_check_sync (h, sw[0]);

		if (snd_ctl_elem_read (h->driver->ctl_handle, sw[1])) {
			jack_error ("cannot read control switch 0 ...");
		}
		hammerfall_check_sync (h, sw[1]);

		if (snd_ctl_elem_read (h->driver->ctl_handle, sw[2])) {
			jack_error ("cannot read control switch 0 ...");
		}
		hammerfall_check_sync (h, sw[2]);
		
		if (nanosleep (&h->monitor_interval, 0)) {
			break;
		}
	}

	pthread_exit (0);
}


_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-02-13 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-12 21:05 control switch API/code change? (fwd) Taybin Rutkin
2002-02-13  8:13 ` Jaroslav Kysela
2002-02-13  7:55   ` 0.9.X missing support for ES1688 on HP Omnibook 800 Jay Summet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.