From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 63345E005BB; Thu, 31 Jul 2014 23:26:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [207.46.163.208 listed in list.dnswl.org] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0208.outbound.protection.outlook.com [207.46.163.208]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id D3ECEE006B7 for ; Thu, 31 Jul 2014 23:26:01 -0700 (PDT) Received: from BN3PR0301CA0041.namprd03.prod.outlook.com (25.160.180.179) by DM2PR03MB413.namprd03.prod.outlook.com (10.141.84.142) with Microsoft SMTP Server (TLS) id 15.0.995.14; Fri, 1 Aug 2014 06:25:47 +0000 Received: from BN1BFFO11FD008.protection.gbl (2a01:111:f400:7c10::1:144) by BN3PR0301CA0041.outlook.office365.com (2a01:111:e400:4000::51) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Fri, 1 Aug 2014 06:25:47 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD008.mail.protection.outlook.com (10.58.144.71) with Microsoft SMTP Server (TLS) id 15.0.990.10 via Frontend Transport; Fri, 1 Aug 2014 06:25:46 +0000 Received: from r01007-02.ap.freescale.net (r01007-02.ap.freescale.net [10.192.241.30]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s716PfkV024832; Thu, 31 Jul 2014 23:25:44 -0700 From: Jun Zhu To: Date: Fri, 1 Aug 2014 14:18:06 +0800 Message-ID: <1406873886-30571-3-git-send-email-R01007@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406873886-30571-1-git-send-email-R01007@freescale.com> References: <1406873886-30571-1-git-send-email-R01007@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(50466002)(110136001)(106466001)(76482001)(26826002)(105606002)(50986999)(81156004)(6806004)(95666004)(85306004)(79102001)(46102001)(104016003)(62966002)(77982001)(36756003)(87286001)(83322001)(81542001)(4396001)(50226001)(69596002)(83072002)(84676001)(81342001)(19580405001)(68736004)(104166001)(77156001)(31966008)(19580395003)(89996001)(107046002)(87936001)(102836001)(93916002)(85852003)(92726001)(21056001)(76176999)(48376002)(88136002)(44976005)(64706001)(74502001)(97736001)(80022001)(20776003)(47776003)(92566001)(2351001)(99396002)(229853001)(74662001); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR03MB413; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 029097202E Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=junzhu@freescale.com; X-OriginatorOrg: freescale.com Cc: Jun Zhu Subject: [meta-fsl-arm][PATCH v2 3/3] pulseaudio: Fix no sound issue after plugin/out headphone X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 06:26:08 -0000 Content-Type: text/plain This issue found on the i.MX6 testing: when switch audio output between headphone and speaker, sometimes it founds no sound when plugin headphone. Root cause is the the core-subscribe.c has a defer queue for audio sink's switch event and stores the status in database. Because it is a defer queue, sometimes the stored status is changed not as user expected. Signed-off-by: Jun Zhu --- ...s-no-sound-after-plugin-plugout-headphone.patch | 127 ++++++++++++++++++++ .../pulseaudio/pulseaudio_5.0.bbappend | 1 + 2 files changed, 128 insertions(+) create mode 100644 recipes-multimedia/pulseaudio/pulseaudio/mx6/Fix-issue-there-is-no-sound-after-plugin-plugout-headphone.patch diff --git a/recipes-multimedia/pulseaudio/pulseaudio/mx6/Fix-issue-there-is-no-sound-after-plugin-plugout-headphone.patch b/recipes-multimedia/pulseaudio/pulseaudio/mx6/Fix-issue-there-is-no-sound-after-plugin-plugout-headphone.patch new file mode 100644 index 0000000..0d4d73a --- /dev/null +++ b/recipes-multimedia/pulseaudio/pulseaudio/mx6/Fix-issue-there-is-no-sound-after-plugin-plugout-headphone.patch @@ -0,0 +1,127 @@ +From 7dfff7e62296779dca9831598af082ee72bfed41 Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Mon, 5 May 2014 14:21:16 +0800 +Subject: [PATCH] Fix issue: there is no sound after plugin/plugout headphone + +In default config, when switching headphone with speaker, the unused one will +be switch off. And pulseaudio will store the setting in the database for +restore later, when switch back to the output path. +But the core-subscribe.c has a defer queue for these events, like sink|new, +sink|change, which will read the current switch status and store it in +the database. Because it is a defer queue, sometimes the stored status is +changed not as user's requirement. below is the call flow. + +init: + store on for speaker to database. + store on for headphone to database. +---Activating analog-output-speaker + switch on speaker + switch off headphone +----headphone plugin + ---analog-output-speaker status no + ---Activating analog-output + Queued event (SINK|CHANGE|0) + switch off speaker + switch off headphone + ---analog-output-headphone status yes + ---Activating analog-output-headphone + switch off speaker + switch off headphone + Dispatched event (SINK|CHANGE|0) + store off for headphone to database. + +Meantime the root cause is not found, a workaround is used by changing the +configure file. + +Another change is remain the volume same as the asound.state. + +Upstream Status: N/A + - It is i.Mx specific + +Signed-off-by: Shengjiu Wang +--- + .../alsa/mixer/paths/analog-output-headphones.conf | 8 ++++---- + .../alsa/mixer/paths/analog-output-speaker.conf | 8 ++++---- + src/modules/alsa/mixer/paths/analog-output.conf | 8 ++++---- + 3 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf +index b1a349a..7bfa79e 100644 +--- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf ++++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf +@@ -63,8 +63,8 @@ volume = off + + [Element Headphone] + required-any = any +-switch = mute +-volume = merge ++switch = on ++volume = ignore + override-map.1 = all + override-map.2 = all-left,all-right + +@@ -86,8 +86,8 @@ switch = mute + volume = zero + + [Element Speaker] +-switch = off +-volume = off ++switch = on ++volume = ignore + + [Element Desktop Speaker] + switch = off +diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker.conf b/src/modules/alsa/mixer/paths/analog-output-speaker.conf +index d79fad1..eae40a0 100644 +--- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf ++++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf +@@ -62,8 +62,8 @@ volume = off + ; This profile path is intended to control the speaker, let's mute headphones + ; else there will be a spike when plugging in headphones + [Element Headphone] +-switch = off +-volume = off ++switch = on ++volume = ignore + + [Element Headphone2] + switch = off +@@ -71,8 +71,8 @@ volume = off + + [Element Speaker] + required-any = any +-switch = mute +-volume = merge ++switch = on ++volume = ignore + override-map.1 = all + override-map.2 = all-left,all-right + +diff --git a/src/modules/alsa/mixer/paths/analog-output.conf b/src/modules/alsa/mixer/paths/analog-output.conf +index 3a552c9..bd5c12b 100644 +--- a/src/modules/alsa/mixer/paths/analog-output.conf ++++ b/src/modules/alsa/mixer/paths/analog-output.conf +@@ -53,16 +53,16 @@ switch = off + ; headphones. But it should not hurt if we leave the headphone jack + ; enabled nonetheless. + [Element Headphone] +-switch = mute +-volume = zero ++switch = on ++volume = ignore + + [Element Headphone2] + switch = mute + volume = zero + + [Element Speaker] +-switch = mute +-volume = off ++switch = on ++volume = ignore + + [Element Desktop Speaker] + switch = mute +-- +1.7.9.5 + diff --git a/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend b/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend index 81b03f6..63f522d 100644 --- a/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend +++ b/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend @@ -2,6 +2,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI_append_mx6 = " file://daemon.conf \ file://default.pa \ + file://Fix-issue-there-is-no-sound-after-plugin-plugout-headphone.patch \ " do_install_append_mx6 () { -- 1.7.9.5