[alsa-devel] [PATCH] ASoC: arizona: Check clocking during hw_params rather than startup

Lars-Peter Clausen lars at metafoo.de
Fri Jan 24 18:25:06 CET 2014


On 01/24/2014 05:59 PM, Charles Keepax wrote:
> It is a fairly common usage to configure SYSCLK as part of the hw_params
> callback in the machine driver. The current driver applies PCM
> constraints based on the value of SYSCLK during the startup callback
> however because many systems will have not configured SYSCLK yet this
> will often use the SYSCLK value that was used for the last stream.
> 
> The patch checks the clocking constraints as part of the hw_params
> callback, which will be after any clocking changes have been made by
> the machine driver.

The problem with this approach is that if the sysclk is fixed instead to
e.g. falling back to rate conversion you'll get an error instead when
calling hw_params. The typical idiom here is to only apply the rate
constraints in the CODEC driver if the sysclk is non zero. This driver
already seems to do this. The problem that you probably see is that if the
machine driver changes the sysclk value in hw_params the constraints that
are setup are still setup with the previous sysclk in mind. I think instead
of removing the constraints support altogether from the driver a better
solution is to introduce a dynamic_sysclk or similar attribute to the DAI
link and not constrain the supported rates if this attribute is set to true.

- Lars


More information about the Alsa-devel mailing list