[alsa-devel] Ordering in soc_pcm_hw_params()

Lars-Peter Clausen lars at metafoo.de
Tue Aug 12 10:42:43 CEST 2014


On 08/11/2014 03:35 PM, jonsmirl at gmail.com wrote:
> soc_pcm_hw_params() sets the parameters in this order:
> link, codec, cpu, platform
>
> This is tripping me up when switching between the 44100 and 48000
> families.  If previous song was 44100 then the codec has sysclk set to
> the 44100 family.
>
> Now I play a 48000 family song. codec gets new hardware params and
> errors out because sysclk is still in the 44100 family.
>
> I have code in the cpu set_hw_params which will switch the sysclk, but
> it never gets to run because the codec set_hw_params() has already
> errored out.
>
> Shouldn't this order be:
> platform, link, cpu, codec

What I don't understand is why does the CPU DAI driver change the sysclk for 
the CODEC DAI driver? What I'd expect is that the machine driver sets the 
sysclk for both the CODEC and the CPU DAI. In this case everything should 
work fine.

- Lars



More information about the Alsa-devel mailing list