[alsa-devel] [PATCH 1/2] ALSA: update sync header when streams are linked/unlinked

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Wed May 23 20:57:34 CEST 2012

Thanks for reviewing Takashi. Comments below.
>> and provide more information such as
>> number of devices and indices of capture/playback devices
>> linked to
> This is a completely different issue, so please don't mix up in a
> single patch.
No problem. I did this on purpose to see the reaction and understand 
what the expectation was...I don't really care about the contents of 
this structure as long as it's consistent.

> ... this isn's safe. There are more than 32 substreams. And there are 
> multiple streams with the same substream index.

The only HW I know of that supports linked streams is HDAudio, and it 
uses a 32-bit mask for SSYNC...
But I guess you're right this doesn't scale.

> Also, the point of the sync id is that it's shared with all linked
> streams.  Your patch breaks it.  It updates only the last added sync
> id.
> The fact that the driver currently sets only the card number is
> actually problematic.  It's not unique enough.  This should be fixed.
> But, exposing the substream bitmask doesn't help much because it can't
> be fully implemented in the sync id size.  If you need to know which
> streams are linked, loop over all streams and check the sync id.
If I understand you well, the sync id should be a unique identifier 
shared by all linked streams in the same group. Since devices can be 
linked/unlinked, this id cannot use anything related to device or 
subdevice number. Maybe a pid-like value incremented when a group is 
created would do?

More information about the Alsa-devel mailing list