From a358c0087cc36285ceafe90e2e71f5f44a3bcf88 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 9 May 2023 10:15:23 +0000 Subject: [PATCH] import pipewire-0.3.47-3.el9_2 --- ...speakers-output-only-case-in-report_.patch | 73 +++++++++++++++++++ SPECS/pipewire.spec | 7 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-spa-support-the-speakers-output-only-case-in-report_.patch diff --git a/SOURCES/0001-spa-support-the-speakers-output-only-case-in-report_.patch b/SOURCES/0001-spa-support-the-speakers-output-only-case-in-report_.patch new file mode 100644 index 0000000..128710c --- /dev/null +++ b/SOURCES/0001-spa-support-the-speakers-output-only-case-in-report_.patch @@ -0,0 +1,73 @@ +From 78b462ece91a359b641444c921854dd2a66b03e8 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Sat, 29 Oct 2022 20:22:06 +0200 +Subject: [PATCH] spa: support the speakers (output) only case in + report_jack_state() + +The Realtek ALC4080 USB audio device (integrated in the +motherboards) can detect the presence on all I/O jacks. + +If user connects only speakers, it's a valid case. + +BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2744 +--- + spa/plugins/alsa/acp/acp.c | 29 +++++++++++++++++++++++++++-- + 1 file changed, 27 insertions(+), 2 deletions(-) + +diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c +index c61817d0d..949e19b93 100644 +--- a/spa/plugins/alsa/acp/acp.c ++++ b/spa/plugins/alsa/acp/acp.c +@@ -624,7 +624,7 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) + pa_card *impl = snd_mixer_elem_get_callback_private(melem); + snd_hctl_elem_t *elem = snd_mixer_elem_get_private(melem); + snd_ctl_elem_value_t *elem_value; +- bool plugged_in; ++ bool plugged_in, any_input_port_available; + void *state; + pa_alsa_jack *jack; + struct temp_port_avail *tp, *tports; +@@ -735,6 +735,31 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) + if (impl->card.active_profile_index != ACP_INVALID_INDEX) + active_available = impl->card.profiles[impl->card.active_profile_index]->available; + ++ /* First round - detect, if we have any input port available. ++ If the hardware can report the state for all I/O jacks, only speakers ++ may be plugged in. */ ++ any_input_port_available = false; ++ PA_HASHMAP_FOREACH(profile, impl->profiles, state) { ++ pa_device_port *port; ++ void *state2; ++ ++ if (profile->profile.flags & ACP_PROFILE_OFF) ++ continue; ++ ++ PA_HASHMAP_FOREACH(port, impl->ports, state2) { ++ if (!pa_hashmap_get(port->profiles, profile->profile.name)) ++ continue; ++ ++ if (port->port.direction == ACP_DIRECTION_CAPTURE && ++ port->port.available != ACP_AVAILABLE_NO) { ++ any_input_port_available = true; ++ goto input_port_found; ++ } ++ } ++ } ++input_port_found: ++ ++ /* Second round */ + PA_HASHMAP_FOREACH(profile, impl->profiles, state) { + pa_device_port *port; + void *state2; +@@ -768,7 +793,7 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) + + if (has_input_port && !has_output_port && found_available_input_port) + available = ACP_AVAILABLE_YES; +- if (has_output_port && !has_input_port && found_available_output_port) ++ if (has_output_port && (!has_input_port || !any_input_port_available) && found_available_output_port) + available = ACP_AVAILABLE_YES; + if (has_output_port && has_input_port && found_available_output_port && found_available_input_port) + available = ACP_AVAILABLE_YES; +-- +2.39.1 + diff --git a/SPECS/pipewire.spec b/SPECS/pipewire.spec index 2dcc681..f7de5a1 100644 --- a/SPECS/pipewire.spec +++ b/SPECS/pipewire.spec @@ -8,7 +8,7 @@ %global libversion %{soversion}.%(bash -c '((intversion = (%{minorversion} * 100) + %{microversion})); echo ${intversion}').0 # For rpmdev-bumpspec and releng automation -%global baserelease 2 +%global baserelease 3 #global snapdate 20210107 #global gitcommit b17db2cebc1a5ab2c01851d29c05f79cd2f262bb @@ -61,6 +61,7 @@ Source0: https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/%{ver %endif ## upstream patches +Patch0001: 0001-spa-support-the-speakers-output-only-case-in-report_.patch ## upstreamable patches @@ -528,6 +529,10 @@ systemctl --no-reload preset --global pipewire.socket >/dev/null 2>&1 || : %endif %changelog +* Thu Mar 02 2023 Wim Taymans - 0.3.47-3 +- Add patch for jack detection. + Resolves: rhbz#2180869 + * Fri Mar 11 2022 Wim Taymans - 0.3.47-2 - Add pulseaudio-utils as Requires for pipewire-pulseaudio Resolves: rhbz#2059874