[alsa-devel] Implementing sync start

Clemens Ladisch clemens at ladisch.de
Mon Aug 10 15:30:35 CEST 2009


Jon Smirl wrote:
> Does this link them?
> snd_pcm_set_sync(substream); in open()

No; this sets the substream's sync ID which tells userspace applications
that the driver actually supports sync start together with other
substreams with the same ID.

Linking is done by an application with snd_pcm_link().  The driver does
not get a notification of this; it notices this only in the trigger
callback, where the loop goes over more than one substream.

> and then remove this loop in trigger?
> snd_pcm_group_for_each_entry(substream, sub) {
> 			snd_pcm_trigger_done(substream, sub);

Why would you want to remove this loop?

The snd_pcm_group_for_each_entry() iterates over all substreams that are
linked.  The ALSA code that calls the trigger callback has a similar
loop and calls .trigger for any streams for which snd_pcm_trigger_done()
has not yet been called.


HTH
Clemens


More information about the Alsa-devel mailing list