Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] cmus: patch to fix freeze with PipeWire-PulseAudio
@ 2022-09-19 18:57 ologantr
  2022-09-19 19:43 ` Duncaen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ologantr @ 2022-09-19 18:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

There is a new pull request by ologantr against master on the void-packages repository

https://github.com/ologantr/void-packages cmus-pipewire-fix
https://github.com/void-linux/void-packages/pull/39375

cmus: patch to fix freeze with PipeWire-PulseAudio
This patch fixes cmus freezing on exit using
both cmus-pulseaudio and pipewire-pulse.

Original bug report: https://github.com/cmus/cmus/issues/1184
Patch from: https://github.com/cmus/cmus/pull/1172
Debian: https://salsa.debian.org/multimedia-team/cmus/-/commit/2e20a489bc58a604a0093830d71e43a5ac2b6c51

#### Testing the changes
- I tested the changes in this PR: **YES**

#### Local build testing
- I built this PR locally for my native architecture (x86_64-glibc)

A patch file from https://github.com/void-linux/void-packages/pull/39375.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cmus-pipewire-fix-39375.patch --]
[-- Type: text/x-diff, Size: 3376 bytes --]

From b5a712138927a4d19017a75ca2c62664fda2701a Mon Sep 17 00:00:00 2001
From: ologantr <mrphyber@protonmail.com>
Date: Mon, 19 Sep 2022 20:50:46 +0200
Subject: [PATCH] cmus: patch to fix freeze with PipeWire-PulseAudio

This patch fixes cmus freezing on exit using
both cmus-pulseaudio and pipewire-pulse.

Original bug report: https://github.com/cmus/cmus/issues/1184
Patch from: https://github.com/cmus/cmus/pull/1172
Debian: https://salsa.debian.org/multimedia-team/cmus/-/commit/2e20a489bc58a604a0093830d71e43a5ac2b6c51
---
 .../patches/0004-Fix-freeze-on-exit.patch     | 74 +++++++++++++++++++
 srcpkgs/cmus/template                         |  2 +-
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/cmus/patches/0004-Fix-freeze-on-exit.patch

diff --git a/srcpkgs/cmus/patches/0004-Fix-freeze-on-exit.patch b/srcpkgs/cmus/patches/0004-Fix-freeze-on-exit.patch
new file mode 100644
index 000000000000..a8dfa0e91f9f
--- /dev/null
+++ b/srcpkgs/cmus/patches/0004-Fix-freeze-on-exit.patch
@@ -0,0 +1,74 @@
+Description: Fix freeze when exiting cmus
+Origin: upstream, https://github.com/cmus/cmus/pull/1172
+Bug: https://github.com/cmus/cmus/issues/1184
+Date: Thu, 14 Jul 2022 18:21:59 +0200
+
+---
+ op/pulse.c | 24 +++++++++++++++++++++++-
+ 1 file changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/op/pulse.c b/op/pulse.c
+index c8a6d6a..78ec066 100644
+--- a/op/pulse.c
++++ b/op/pulse.c
+@@ -17,7 +17,9 @@
+  */
+ 
+ #include <string.h>
++#include <stdbool.h>
+ 
++#include <pulse/introspect.h>
+ #include <pulse/pulseaudio.h>
+ 
+ #include "../op.h"
+@@ -33,6 +35,8 @@ static pa_channel_map		 pa_cmap;
+ static pa_cvolume		 pa_vol;
+ static pa_sample_spec		 pa_ss;
+ 
++static bool			 is_pipewire = false;
++
+ static int			 mixer_notify_in;
+ static int			 mixer_notify_out;
+ 
+@@ -175,6 +179,20 @@ static void _pa_sink_input_info_cb(pa_context *c,
+ 	}
+ }
+ 
++static void _pa_server_info_cb(pa_context *c,
++			       const pa_server_info *i,
++			       void *data)
++{
++	is_pipewire = false;
++	if (i) {
++		if (strstr(i->server_name, "PipeWire") != NULL) {
++			// server is PipeWire
++			d_print("Pulseaudio server is pipewire. Disabling _pa_stream_drain()\n");
++			is_pipewire = true;
++		}
++	}
++}
++
+ static void _pa_stream_success_cb(pa_stream *s, int success, void *data)
+ {
+ 	pa_threaded_mainloop_signal(pa_ml, 0);
+@@ -422,6 +440,8 @@ static int op_pulse_open(sample_format_t sf, const channel_position_t *channel_m
+ 	pa_context_get_sink_input_info(pa_ctx, pa_stream_get_index(pa_s),
+ 			_pa_sink_input_info_cb, NULL);
+ 
++	pa_context_get_server_info(pa_ctx, _pa_server_info_cb, NULL);
++
+ 	pa_threaded_mainloop_unlock(pa_ml);
+ 
+ 	return OP_ERROR_SUCCESS;
+@@ -440,8 +460,10 @@ static int op_pulse_close(void)
+ 	 * If this _pa_stream_drain() will be moved below following
+ 	 * pa_threaded_mainloop_lock(), PulseAudio 0.9.19 will hang.
+ 	 */
+-	if (pa_s)
++
++	if (pa_s && !is_pipewire){
+ 		_pa_stream_drain();
++	}
+ 
+ 	pa_threaded_mainloop_lock(pa_ml);
+ 
diff --git a/srcpkgs/cmus/template b/srcpkgs/cmus/template
index 0fcb424ce336..05b77d0fecae 100644
--- a/srcpkgs/cmus/template
+++ b/srcpkgs/cmus/template
@@ -1,7 +1,7 @@
 # Template file for 'cmus'
 pkgname=cmus
 version=2.10.0
-revision=1
+revision=2
 build_style=configure
 configure_args="prefix=/usr LD=$CC"
 hostmakedepends="pkg-config"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cmus: patch to fix freeze with PipeWire-PulseAudio
  2022-09-19 18:57 [PR PATCH] cmus: patch to fix freeze with PipeWire-PulseAudio ologantr
@ 2022-09-19 19:43 ` Duncaen
  2022-09-19 19:48 ` Duncaen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Duncaen @ 2022-09-19 19:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/39375#issuecomment-1251469766

Comment:
pipewire is supposed to be compatible, this does not look like the right approach.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cmus: patch to fix freeze with PipeWire-PulseAudio
  2022-09-19 18:57 [PR PATCH] cmus: patch to fix freeze with PipeWire-PulseAudio ologantr
  2022-09-19 19:43 ` Duncaen
@ 2022-09-19 19:48 ` Duncaen
  2022-09-21 11:27 ` ologantr
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Duncaen @ 2022-09-19 19:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/39375#issuecomment-1251473722

Comment:
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/946

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cmus: patch to fix freeze with PipeWire-PulseAudio
  2022-09-19 18:57 [PR PATCH] cmus: patch to fix freeze with PipeWire-PulseAudio ologantr
  2022-09-19 19:43 ` Duncaen
  2022-09-19 19:48 ` Duncaen
@ 2022-09-21 11:27 ` ologantr
  2022-12-21  1:55 ` github-actions
  2023-01-04  1:59 ` [PR PATCH] [Closed]: " github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: ologantr @ 2022-09-21 11:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

New comment by ologantr on void-packages repository

https://github.com/void-linux/void-packages/pull/39375#issuecomment-1253569935

Comment:
The issue you linked was fixed a year ago, 
and it came back some time after.
This should be a pipewire issue, but for the time being this is a 
patch to make things work as they are now.
The other solution is to use the alsa cmus output plugin with softvol and
pipewire-alsa integration instead of cmus-pulseaudio, 
tested and it works without hiccups.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cmus: patch to fix freeze with PipeWire-PulseAudio
  2022-09-19 18:57 [PR PATCH] cmus: patch to fix freeze with PipeWire-PulseAudio ologantr
                   ` (2 preceding siblings ...)
  2022-09-21 11:27 ` ologantr
@ 2022-12-21  1:55 ` github-actions
  2023-01-04  1:59 ` [PR PATCH] [Closed]: " github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: github-actions @ 2022-12-21  1:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/39375#issuecomment-1360673875

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Closed]: cmus: patch to fix freeze with PipeWire-PulseAudio
  2022-09-19 18:57 [PR PATCH] cmus: patch to fix freeze with PipeWire-PulseAudio ologantr
                   ` (3 preceding siblings ...)
  2022-12-21  1:55 ` github-actions
@ 2023-01-04  1:59 ` github-actions
  4 siblings, 0 replies; 6+ messages in thread
From: github-actions @ 2023-01-04  1:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

There's a closed pull request on the void-packages repository

cmus: patch to fix freeze with PipeWire-PulseAudio
https://github.com/void-linux/void-packages/pull/39375

Description:
This patch fixes cmus freezing on exit using
both cmus-pulseaudio and pipewire-pulse.

Original bug report: https://github.com/cmus/cmus/issues/1184
Patch from: https://github.com/cmus/cmus/pull/1172
Debian: https://salsa.debian.org/multimedia-team/cmus/-/commit/2e20a489bc58a604a0093830d71e43a5ac2b6c51

#### Testing the changes
- I tested the changes in this PR: **YES**

#### Local build testing
- I built this PR locally for my native architecture (x86_64-glibc)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-04  1:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 18:57 [PR PATCH] cmus: patch to fix freeze with PipeWire-PulseAudio ologantr
2022-09-19 19:43 ` Duncaen
2022-09-19 19:48 ` Duncaen
2022-09-21 11:27 ` ologantr
2022-12-21  1:55 ` github-actions
2023-01-04  1:59 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).