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 10:42:43 +0200 Message-ID: <53E9D383.5060103@metafoo.de> References: 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 E2466261A83 for ; Tue, 12 Aug 2014 10:42:47 +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" , alsa-devel mailing list Cc: Mark Brown , Liam Girdwood , Nicolin Chen List-Id: alsa-devel@alsa-project.org 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. - Lars