[alsa-devel] ASoC:Question rate constraint between the dais
broonie at opensource.wolfsonmicro.com
Sat Mar 17 12:48:57 CET 2012
On Fri, Mar 16, 2012 at 06:01:44PM -0400, Trent Piepho wrote:
> On Fri, Mar 16, 2012 at 3:22 PM, Mark Brown
> > There's a way to do this, and it's the way that the WM8988 driver is
> > doing it - obviously you'll have different criteria for choosing
> > constraints but the actual application of the constraints is going to be
> > done in the same way.
> Since the constraint is based on the current configuration of another
> DAI, the two DAIs need some way to query each other's parameters. The
Since they're both provided by the same driver this is trivial.
> And as I said before, ALSA doesn't handle this 100%. There is a race
> if both streams are initialized at the same time. If you open one
Yes, I did reply to your previous mail about that pointing out that this
> I think what's necessary is for ALSA to let hw_params return an error
> code that means lets the driver say, "Sorry, the constraints have
> changed and the hw_params you have chosen are no longer valid. Here
> are new constraints, please try again."
Thinking about this slightly further than in my reply to Lars-Peter a
few minutes ago...
I think just returning -EINVAL on bad parameters (which is pretty much
what we do) is sufficient for this if the driver is good about keeping
the constraints up to date. Applications should already be able to take
the hint, though I imagine most of them wouldn't trust the drivers to
provide accurate constraints and aren't as widely deployed as PulseAudio
(which forced fixing the DMA stuff by virtue of everyone using it).
Though just spinning a small number of times will probably deal with
lying drivers well enough.
We could still generate an event but I'm now even less sure it's worth
drivers doing anything special about this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: Digital signature
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20120317/e643f4b5/attachment.sig
More information about the Alsa-devel