From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 5FA12E007D2; Tue, 29 Jul 2014 00:27:02 -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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [207.46.163.143 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] X-Greylist: delayed 901 seconds by postgrey-1.32 at yocto-www; Tue, 29 Jul 2014 00:26:56 PDT Received: from na01-bn1-obe.outbound.protection.outlook.com (dns-bn1lp0143.outbound.protection.outlook.com [207.46.163.143]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A14E8E007CE for ; Tue, 29 Jul 2014 00:26:56 -0700 (PDT) Received: from BN3PR0301CA0022.namprd03.prod.outlook.com (25.160.180.160) by DM2PR03MB414.namprd03.prod.outlook.com (10.141.84.145) with Microsoft SMTP Server (TLS) id 15.0.995.14; Tue, 29 Jul 2014 07:11:52 +0000 Received: from BN1BFFO11FD049.protection.gbl (2a01:111:f400:7c10::1:156) by BN3PR0301CA0022.outlook.office365.com (2a01:111:e400:4000::32) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Tue, 29 Jul 2014 07:11:52 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD049.mail.protection.outlook.com (10.58.145.4) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Tue, 29 Jul 2014 07:11:52 +0000 Received: from r01007-02.ap.freescale.net (R01007-02-010192241030.ap.freescale.net [10.192.241.30]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s6T7BkTt022635; Tue, 29 Jul 2014 00:11:50 -0700 From: Jun Zhu To: Date: Tue, 29 Jul 2014 15:04:15 +0800 Message-ID: <1406617455-16372-3-git-send-email-R01007@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406617455-16372-1-git-send-email-R01007@freescale.com> References: <1406617455-16372-1-git-send-email-R01007@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(77156001)(89996001)(21056001)(46102001)(48376002)(50466002)(87936001)(106466001)(99396002)(76482001)(84676001)(107046002)(88136002)(104016003)(36756003)(229853001)(2351001)(62966002)(77982001)(79102001)(110136001)(83322001)(44976005)(87286001)(26826002)(19580395003)(95666004)(93916002)(81342001)(92566001)(105606002)(92726001)(6806004)(85852003)(74502001)(74662001)(83072002)(97736001)(31966008)(102836001)(64706001)(47776003)(20776003)(68736004)(104166001)(4396001)(81542001)(50226001)(76176999)(50986999)(19580405001)(80022001)(85306003); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR03MB414; H:tx30smr01.am.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: 0287BBA78D Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=junzhu@freescale.com; X-OriginatorOrg: freescale.com Cc: Jun Zhu Subject: [meta-fsl-arm][PATCH 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: Tue, 29 Jul 2014 07:27:02 -0000 Content-Type: text/plain This issue found on the i.MX6 testing: when switch audio output between headphone and speaker, sometimes it found 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 --- ...here-is-no-sound-after-plugin-plugout-hea.patch | 127 ++++++++++++++++++++ .../pulseaudio/pulseaudio_5.0.bbappend | 1 + 2 files changed, 128 insertions(+) create mode 100644 recipes-multimedia/pulseaudio/pulseaudio/0002-Fix-issue-there-is-no-sound-after-plugin-plugout-hea.patch diff --git a/recipes-multimedia/pulseaudio/pulseaudio/0002-Fix-issue-there-is-no-sound-after-plugin-plugout-hea.patch b/recipes-multimedia/pulseaudio/pulseaudio/0002-Fix-issue-there-is-no-sound-after-plugin-plugout-hea.patch new file mode 100644 index 0000000..0d4d73a --- /dev/null +++ b/recipes-multimedia/pulseaudio/pulseaudio/0002-Fix-issue-there-is-no-sound-after-plugin-plugout-hea.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 4ea4921..5b2b1a9 100644 --- a/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend +++ b/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend @@ -6,6 +6,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI_append = " file://daemon.conf \ file://default.pa \ file://0001-Fix-pulseaudio-mutex-issue-when-do-pause-in-gstreame.patch \ + file://0002-Fix-issue-there-is-no-sound-after-plugin-plugout-hea.patch \ " do_install_append() { -- 1.7.9.5