23 Jun
2008
23 Jun
'08
2 p.m.
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