From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751449AbdBJGTK convert rfc822-to-8bit (ORCPT ); Fri, 10 Feb 2017 01:19:10 -0500 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]:59042 "EHLO smtp.csie.ntu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbdBJGTI (ORCPT ); Fri, 10 Feb 2017 01:19:08 -0500 MIME-Version: 1.0 In-Reply-To: <20170202092422.5588-5-mylene.josserand@free-electrons.com> References: <20170202092422.5588-1-mylene.josserand@free-electrons.com> <20170202092422.5588-5-mylene.josserand@free-electrons.com> From: Chen-Yu Tsai Date: Fri, 10 Feb 2017 14:08:54 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 4/8] ASoC: sun8i-codec-analog: Add amplifier event to fix first delay To: =?UTF-8?Q?Myl=C3=A8ne_Josserand?= Cc: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Linux-ALSA , devicetree , linux-kernel , linux-arm-kernel , Thomas Petazzoni , Alexandre Belloni Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 2, 2017 at 5:24 PM, Mylène Josserand wrote: > When playing a sound for the first time, a short delay, where the audio > file is not played, can be noticed. > On a second play (right after), the sound is played correctly. > If we wait a short time (~5 sec which corresponds to the aplay > timeout), the delay is back. > > This patch fixes it by using an event on headphone amplifier. > It allows to keep the amplifier enable while playing a sound. > A delay of 700ms allows to wait that the amplifier is powered-up > before playing the sound. > > Signed-off-by: Mylène Josserand > Acked-by: Maxime Ripard I get some static in my headphones in the time between when the amplifier is enabled and when sound starts playing. Wonder if this can be fixed in any way? One solution that might work is to mute the headphone output while the amp is being charged, by setting SUN8I_ADDA_HP_VOLC_HP_VOL to 0, and then restoring the value once it is charged. In other words, overriding the value for the duration of sun8i_headphone_amp_event. Regards ChenYu