[alsa-devel] Requiring the same sample rate for playback and record?

Takashi Iwai tiwai at suse.de
Mon Jun 23 13:00:02 CEST 2008


At Fri, 20 Jun 2008 14:08:50 -0500,
Timur Tabi wrote:
> 
> In my driver, how do I tell ALSA that the sample rate for playback must be the
> same as for capture?
> 
> I know I can have my driver remember the sample rate for the first stream open,
> and then if the second stream doesn't specify the same sample rate, it can
> reject it, but this is inelegant.  I'm hoping there's a more straightforward way.

Right now there is no "elegant" way for this, unfortunately.
A common way many drivers use is to remember the rate of the first
stream, then add it to hw_constraint of the secondary streams.
But, this could be also a bit racy (unavoidable due to its design)
although practically it seems working.


Takashi


More information about the Alsa-devel mailing list