[alsa-devel] Implementing sync start

Clemens Ladisch clemens at ladisch.de
Mon Aug 10 09:40:58 CEST 2009


Jon Smirl wrote:
> Here's how I implemented sync start/stop.......

Have a look at oxygen_trigger() in sound/pci/oxygen/oxygen_pcm.c for a
working sync start/stop implementation.

> 	snd_pcm_group_for_each_entry(substream, sub) {
> 
> 		rtd = substream->private_data;

There is no guarantee the all linked substreams belong to the same card
or the same driver; you have to check that first and ignore streams you
don't know about.

> 		if (sub != substream)
> 			snd_pcm_trigger_done(substream, sub);

You can just call snd_pcm_trigger_done() for every substream you handle.

> 		...
> 	}
> 	return 0;

There is no common code for the two substreams.
Is your hardware actually capable of starting them at exactly the same
time?


Best regards,
Clemens


More information about the Alsa-devel mailing list