From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754083AbaGUJFB (ORCPT ); Mon, 21 Jul 2014 05:05:01 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45433 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753879AbaGUJE7 (ORCPT ); Mon, 21 Jul 2014 05:04:59 -0400 Date: Mon, 21 Jul 2014 11:04:56 +0200 Message-ID: From: Takashi Iwai To: Richard Fitzgerald Cc: Mark Brown , perex@perex.cz, lgirdwood@gmail.com, patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: arizona: Disable AIF TX/RX before configuring it In-Reply-To: <20140721090104.GA21400@opensource.wolfsonmicro.com> References: <20140716121029.GA22222@opensource.wolfsonmicro.com> <20140717194215.GH17528@sirena.org.uk> <20140721090104.GA21400@opensource.wolfsonmicro.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 21 Jul 2014 10:01:22 +0100, Richard Fitzgerald wrote: > > On Thu, Jul 17, 2014 at 08:42:15PM +0100, Mark Brown wrote: > > On Wed, Jul 16, 2014 at 01:10:39PM +0100, Richard Fitzgerald wrote: > > > > > If we don't disable the AIF TX/RX then we may fall into a > > > situation where the new AIF settings are ignored by the device. > > > For example, this problem manifests when switching between > > > different sample rates. > > > > So, what this does is momentarily disable the AIF when reconfiguring. > > That will glitch any running audio, making me wonder if the driver > > shouldn't be returning an error or at least complaining if it has to > > reconfigure instead. What's the use case where this might get > > triggered? > > The case being fixed is like this: > > aplay 48kHz.wav; aplay 96kHz.wav > > The second open happens before pmdown_time so the AIF is still enabled. > Writes to the AIF config registers only take effect if the AIF is disabled. > Without this patch, the 96kHz.wav will play at 48kHz If the glitch really matters, the driver can minimize by checking the change of sample rate and doing temporary turn on/off only when required. Takashi