From 791b2cd871e670f2cd691aad21a1c9bcffc362d6 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Fri, 2 Sep 2022 15:52:55 -0500 Subject: pulseaudio: Fix gstreamer pause mutex issue Add a patch to fix a mutex issue when pausing a gstreamer stream. Signed-off-by: Tom Hochstein --- ...dio-mutex-issue-when-do-pause-in-gstreame.patch | 32 ++++++++++ ...e-the-control-for-speaker-headphone-widge.patch | 73 ++++++++++++++++++++++ ...e-the-control-for-speaker-headphone-widge.patch | 73 ---------------------- .../pulseaudio/pulseaudio_%.bbappend | 21 ++++--- 4 files changed, 118 insertions(+), 81 deletions(-) create mode 100644 recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/0001-Fix-pulseaudio-mutex-issue-when-do-pause-in-gstreame.patch create mode 100644 recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/0100-pulseaudio-remove-the-control-for-speaker-headphone-widge.patch delete mode 100644 recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/pulseaudio-remove-the-control-for-speaker-headphone-widge.patch diff --git a/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/0001-Fix-pulseaudio-mutex-issue-when-do-pause-in-gstreame.patch b/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/0001-Fix-pulseaudio-mutex-issue-when-do-pause-in-gstreame.patch new file mode 100644 index 000000000..12a04cb7b --- /dev/null +++ b/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/0001-Fix-pulseaudio-mutex-issue-when-do-pause-in-gstreame.patch @@ -0,0 +1,32 @@ +From c21e24f5c53e81fc715905c54a6c82b69e397e63 Mon Sep 17 00:00:00 2001 +From: "shengjiu.wang" +Date: Thu, 3 Apr 2014 14:22:02 +0800 +Subject: [PATCH] Fix pulseaudio mutex issue when do pause in gstreamer + +The error log is "Assertion 'pthread_mutex_unlock(&m->mutex) == 0' +failed at pulsecore/mutex-posix.c:106, function pa_mutex_unlock(). Aborting" + +This fix is a workaround base on the solution from this link " +https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/932096" + +Upstream status: Inappropriate [i.MX specific] +Signed-off-by: shengjiu.wang +--- + src/pulsecore/mutex-posix.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/pulsecore/mutex-posix.c b/src/pulsecore/mutex-posix.c +index 36c2787..d592501 100644 +--- a/src/pulsecore/mutex-posix.c ++++ b/src/pulsecore/mutex-posix.c +@@ -30,6 +30,7 @@ + #include + + #include "mutex.h" ++#undef HAVE_PTHREAD_PRIO_INHERIT + + struct pa_mutex { + pthread_mutex_t mutex; +-- +1.7.9.5 + diff --git a/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/0100-pulseaudio-remove-the-control-for-speaker-headphone-widge.patch b/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/0100-pulseaudio-remove-the-control-for-speaker-headphone-widge.patch new file mode 100644 index 000000000..57c28741a --- /dev/null +++ b/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/0100-pulseaudio-remove-the-control-for-speaker-headphone-widge.patch @@ -0,0 +1,73 @@ +From 33022867d76c91fe4e60699c1b7ebbc8feb4ee93 Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Mon, 30 Mar 2015 10:26:14 +0800 +Subject: [PATCH] pulseaudio: remove the control for speaker/headphone widget + +In imx7d-sdb, there is no headphone jack, the jack detection is done +by the codec itself. When headphone plugin, pulseaudio can't detect +the headphone jack status, so it will set the heaphone volume to zero. +Here fix this issue by remove the control in configuration. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Shengjiu Wang +--- + .../alsa/mixer/paths/analog-output-headphones.conf | 8 ++++---- + src/modules/alsa/mixer/paths/analog-output-speaker.conf | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf +index 88907f0..7598d2f 100644 +--- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf ++++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf +@@ -88,8 +88,8 @@ override-map.2 = all-left,all-right + + [Element Headphone] + required-any = any +-switch = mute +-volume = merge ++switch = on ++volume = ignore + override-map.1 = all + override-map.2 = all-left,all-right + +@@ -119,8 +119,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 fcf2f5c..6f6f898 100644 +--- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf ++++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf +@@ -91,8 +91,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 Headphone,1] + switch = off +@@ -115,8 +115,8 @@ override-map.2 = all-left,all-right + + [Element Speaker] + required-any = any +-switch = mute +-volume = merge ++switch = on ++volume = ignore + override-map.1 = all + override-map.2 = all-left,all-right + +-- +2.20.1 + diff --git a/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/pulseaudio-remove-the-control-for-speaker-headphone-widge.patch b/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/pulseaudio-remove-the-control-for-speaker-headphone-widge.patch deleted file mode 100644 index 57c28741a..000000000 --- a/recipes-multimedia/pulseaudio/pulseaudio/imx-nxp-bsp/pulseaudio-remove-the-control-for-speaker-headphone-widge.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 33022867d76c91fe4e60699c1b7ebbc8feb4ee93 Mon Sep 17 00:00:00 2001 -From: Shengjiu Wang -Date: Mon, 30 Mar 2015 10:26:14 +0800 -Subject: [PATCH] pulseaudio: remove the control for speaker/headphone widget - -In imx7d-sdb, there is no headphone jack, the jack detection is done -by the codec itself. When headphone plugin, pulseaudio can't detect -the headphone jack status, so it will set the heaphone volume to zero. -Here fix this issue by remove the control in configuration. - -Upstream-Status: Inappropriate [i.MX specific] - -Signed-off-by: Shengjiu Wang ---- - .../alsa/mixer/paths/analog-output-headphones.conf | 8 ++++---- - src/modules/alsa/mixer/paths/analog-output-speaker.conf | 8 ++++---- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf -index 88907f0..7598d2f 100644 ---- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf -+++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf -@@ -88,8 +88,8 @@ override-map.2 = all-left,all-right - - [Element Headphone] - required-any = any --switch = mute --volume = merge -+switch = on -+volume = ignore - override-map.1 = all - override-map.2 = all-left,all-right - -@@ -119,8 +119,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 fcf2f5c..6f6f898 100644 ---- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf -+++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf -@@ -91,8 +91,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 Headphone,1] - switch = off -@@ -115,8 +115,8 @@ override-map.2 = all-left,all-right - - [Element Speaker] - required-any = any --switch = mute --volume = merge -+switch = on -+volume = ignore - override-map.1 = all - override-map.2 = all-left,all-right - --- -2.20.1 - diff --git a/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend index c7a4292e3..69a9ec6bc 100644 --- a/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend +++ b/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -1,13 +1,18 @@ - -CACHED_CONFIGUREVARS:append:mx6-nxp-bsp = " ax_cv_PTHREAD_PRIO_INHERIT=no" - FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/imx-nxp-bsp:" -SRC_URI:append:mx6-nxp-bsp = " file://daemon.conf file://default.pa" -SRC_URI:append:mx7-nxp-bsp = " file://daemon.conf file://default.pa \ - file://pulseaudio-remove-the-control-for-speaker-headphone-widge.patch \ -" -SRC_URI:append:mx8-nxp-bsp = " file://daemon.conf file://default.pa" +SRC_URI += "${SRC_URI_IMX}" +SRC_URI_IMX = "" +SRC_URI_IMX:mx6-nxp-bsp = " \ + file://0001-Fix-pulseaudio-mutex-issue-when-do-pause-in-gstreame.patch \ + file://daemon.conf \ + file://default.pa" +SRC_URI_IMX:mx7-nxp-bsp = " \ + ${SRC_URI_IMX:mx6-nxp-bsp} \ + file://0100-pulseaudio-remove-the-control-for-speaker-headphone-widge.patch" +SRC_URI_IMX:mx8-nxp-bsp = " \ + ${SRC_URI_IMX:mx6-nxp-bsp}" + +CACHED_CONFIGUREVARS:append:mx6-nxp-bsp = " ax_cv_PTHREAD_PRIO_INHERIT=no" do_install:append() { if [ -e "${WORKDIR}/daemon.conf" ] && [ -e "${WORKDIR}/default.pa" ]; then -- cgit v1.2.3-54-g00ecf