From patchwork Wed Aug 8 09:05:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 10559665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E86D713AC for ; Wed, 8 Aug 2018 09:06:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D43DC2A961 for ; Wed, 8 Aug 2018 09:06:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C600C2A9CC; Wed, 8 Aug 2018 09:06:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24CC42A961 for ; Wed, 8 Aug 2018 09:06:26 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 14D822678EF; Wed, 8 Aug 2018 11:06:04 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id AEFB62678CC; Wed, 8 Aug 2018 11:05:51 +0200 (CEST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by alsa0.perex.cz (Postfix) with ESMTP id 076A126786A for ; Wed, 8 Aug 2018 11:05:50 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60CEC87916; Wed, 8 Aug 2018 09:05:49 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-117-222.ams2.redhat.com [10.36.117.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7A011C71D; Wed, 8 Aug 2018 09:05:48 +0000 (UTC) From: Hans de Goede To: alsa-devel@alsa-project.org Date: Wed, 8 Aug 2018 11:05:35 +0200 Message-Id: <20180808090543.15181-5-hdegoede@redhat.com> In-Reply-To: <20180808090543.15181-1-hdegoede@redhat.com> References: <20180808090543.15181-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 08 Aug 2018 09:05:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 08 Aug 2018 09:05:49 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'hdegoede@redhat.com' RCPT:'' Cc: Takashi Iwai , Hans de Goede , Pierre-Louis Bossart Subject: [alsa-devel] [PATCH v2 05/13] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP pulseaudio will run the DisableSequence of the current playback device before running the EnableSequence of the new playback device. This causes the Platform Clock and BIAS to temporarily get turned off which on the rt5651 breaks audio-streams which are playing when switching. This commit moves the disabling to the EnableSequence of the other device fixing this. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Hans de Goede --- src/conf/ucm/bytcr-rt5651/HiFi.conf | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf index bc604276..42fa2c9a 100644 --- a/src/conf/ucm/bytcr-rt5651/HiFi.conf +++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf @@ -30,14 +30,19 @@ SectionDevice."Headphones" { cset "name='Headphone Switch' on" cset "name='HPO L Playback Switch' on" cset "name='HPO R Playback Switch' on" + # Done after turning the HP on to keep the bias and clk on + cset "name='Speaker Switch' off" + cset "name='LOUT L Playback Switch' off" + cset "name='LOUT R Playback Switch' off" ] DisableSequence [ cdev "hw:bytcrrt5651" exec "echo Headphones playback disable sequence" - cset "name='Headphone Switch' off" - cset "name='HPO L Playback Switch' off" - cset "name='HPO R Playback Switch' off" + # This is done by the Speaker EnableSequence, so that the + # Platform Clock and BIAS do not temporarily get turned off + # as that breaks audio-streams which are playing when + # switching between Speaker/Headphone ] Value { @@ -57,12 +62,21 @@ SectionDevice."Speaker" { cdev "hw:bytcrrt5651" exec "echo Speaker enable sequence" cset "name='Speaker Switch' on" + cset "name='LOUT L Playback Switch' on" + cset "name='LOUT R Playback Switch' on" + # Done after turning the speaker on to keep the bias and clk on + cset "name='Headphone Switch' off" + cset "name='HPO L Playback Switch' off" + cset "name='HPO R Playback Switch' off" ] DisableSequence [ cdev "hw:bytcrrt5651" exec "echo Speaker disable sequence" - cset "name='Speaker Switch' off" + # This is done by the Headphones EnableSequence, so that the + # Platform Clock and BIAS do not temporarily get turned off + # as that breaks audio-streams which are playing when + # switching between Speaker/Headphone ] Value {