Repository navigation
Workaround for #1064 - #1172
Workaround for #1064#1172erfan-khadem wants to merge 2 commits into
Conversation
gavtroy
left a comment
There was a problem hiding this comment.
Sure, since it's not obvious what purpose _pa_stream_drain() serves in the first place I wouldn't object to adding this workaround.
| if (is_pipewire) { | ||
| return OP_ERROR_SUCCESS; | ||
| } | ||
|
|
There was a problem hiding this comment.
It looks like this could be removed as you also guard calling the function.
|
Thanks for you review @gavtroy. I'm really busy until Thursday. I will most certainly fix all of the issues you mentioned by the end of the week though. Update: |
|
This patch works fine and I pushed it in the Debian cmus package. |
This was submitted upstream: cmus/cmus#1172 It's not merged yet though... however Debian is also shipping it: https://salsa.debian.org/multimedia-team/cmus/-/commit/2e20a489bc58a604a0093830d71e43a5ac2b6c51
This patch fixes cmus freezing on exit using both cmus-pulseaudio and pipewire-pulse. Original bug report: cmus/cmus#1184 Patch from: cmus/cmus#1172 Debian: https://salsa.debian.org/multimedia-team/cmus/-/commit/2e20a489bc58a604a0093830d71e43a5ac2b6c51
| if (i) { | ||
| if (strstr(i->server_name, "PipeWire") != NULL) { | ||
| // server is PipeWire | ||
| d_print("Pulseaudio server is pipewire. Disabling _pa_stream_drain()\n"); |
There was a problem hiding this comment.
Is there any upstream issue we can reference here, so that we know when we can drop the workaround?
There was a problem hiding this comment.
Hi. I really can't investigate this issue right now. I live in Iran and ... nothing good is going on right now. A few weeks ago the police was in our university (Sharif University of Technology. Go look at its wikipedia page) shooting students and beating faculty members (yeah our own professors) and arresting people and ... I just need some time to deal with this shit.
There was a problem hiding this comment.
Hope all is well.
I don't think there is an existing upstream report other than the original pipewire/-/issues/946, but the change that broke it again (pipewire/-/commit/b9c8f0f6b9) says it's expected behavior:
A corked stream should not complete a pending drain operation
I experimented with uncorking the stream first and it also solves the issue, but just removing the call makes more sense to me. It doesn't seem like we ever had any reason to wait for the stream to drain in the first place.
There was a problem hiding this comment.
I've been working on a pipewire op (it's mostly done, but I need to rework the op api to allow for pull-based output plugins to prevent it from being unnecessarily complex and inefficient) and an aaudio one, and I think removing the drain makes sense too.
I noticed that from probably PipeWire 0.3.34 up to now, cmus started taking a long time before exiting when the music is paused (#1064), otherwise it has no issue. It seems like disabling
_pa_stream_drainon PipeWire when exiting cmus fixes the issue and has no apparent setbacks. This seems to be an issue with upstream (as it was once fixed there), but given the simplicity of the workaround, we can have this until upstream fixes the issue.