[alsa-devel] Ordering in soc_pcm_hw_params()

Lars-Peter Clausen lars at metafoo.de
Tue Aug 12 13:53:30 CEST 2014


On 08/12/2014 01:46 PM, jonsmirl at gmail.com wrote:
> On Tue, Aug 12, 2014 at 7:45 AM, jonsmirl at gmail.com <jonsmirl at gmail.com> wrote:
>> On Tue, Aug 12, 2014 at 4:42 AM, Lars-Peter Clausen <lars at metafoo.de> wrote:
>>> 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.
>>
>> The machine driver is simple-card. It is not smart enough to change
>> the sysclk between 22.5Mhz and 24.5Mhz depending on what music is
>> being played.
>
> Having said that, should we make simple-card smart enough to do that?

Probably yes. The CPU DAI driver is definitely the wrong place to change the 
CODEC DAI sysclk.



More information about the Alsa-devel mailing list