All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Zhu <R01007@freescale.com>
To: <meta-freescale@yoctoproject.org>
Cc: Jun Zhu <R01007@freescale.com>
Subject: [meta-fsl-arm][PATCH 3/3] pulseaudio: Fix no sound issue after plugin/out headphone
Date: Tue, 29 Jul 2014 15:04:15 +0800	[thread overview]
Message-ID: <1406617455-16372-3-git-send-email-R01007@freescale.com> (raw)
In-Reply-To: <1406617455-16372-1-git-send-email-R01007@freescale.com>

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 <R01007@freescale.com>
---
 ...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 <b02247@freescale.com>
+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 <b02247@freescale.com>
+---
+ .../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



  parent reply	other threads:[~2014-07-29  7:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29  7:04 [meta-fsl-arm][PATCH 1/3] pulseaudio: Customize pulseaudio configuration for i.MX platforms Jun Zhu
2014-07-29  7:04 ` [meta-fsl-arm][PATCH 2/3] pulseaudio: Fix mutext issue when do pause in gstreamer Jun Zhu
2014-07-29 13:40   ` Otavio Salvador
2014-07-29  7:04 ` Jun Zhu [this message]
2014-07-29 13:46   ` [meta-fsl-arm][PATCH 3/3] pulseaudio: Fix no sound issue after plugin/out headphone Otavio Salvador
2014-07-29 13:37 ` [meta-fsl-arm][PATCH 1/3] pulseaudio: Customize pulseaudio configuration for i.MX platforms Otavio Salvador
2014-07-30  8:08   ` junzhu
2014-07-30 12:44     ` Otavio Salvador
2014-07-31  9:42       ` junzhu
2014-07-31 12:08         ` Otavio Salvador
2014-07-31 12:09           ` Otavio Salvador
2014-07-31 15:46             ` Lauren Post
2014-07-29 13:46 ` Daiane Angolini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406617455-16372-3-git-send-email-R01007@freescale.com \
    --to=r01007@freescale.com \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.