From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Subject: Re: Ordering in soc_pcm_hw_params() Date: Tue, 12 Aug 2014 13:53:30 +0200 Message-ID: <53EA003A.7010709@metafoo.de> References: <53E9D383.5060103@metafoo.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp-out-205.synserver.de (smtp-out-205.synserver.de [212.40.185.205]) by alsa0.perex.cz (Postfix) with ESMTP id 6B119264F10 for ; Tue, 12 Aug 2014 13:53:32 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "jonsmirl@gmail.com" Cc: alsa-devel mailing list , Mark Brown , Liam Girdwood , Nicolin Chen List-Id: alsa-devel@alsa-project.org On 08/12/2014 01:46 PM, jonsmirl@gmail.com wrote: > On Tue, Aug 12, 2014 at 7:45 AM, jonsmirl@gmail.com wrote: >> On Tue, Aug 12, 2014 at 4:42 AM, Lars-Peter Clausen wrote: >>> On 08/11/2014 03:35 PM, jonsmirl@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.