Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
@ 2020-10-26 23:38 klardotsh
  2020-10-27  9:18 ` minikN
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: klardotsh @ 2020-10-26 23:38 UTC (permalink / raw)
  To: ml

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

New issue by klardotsh on void-packages repository

https://github.com/void-linux/void-packages/issues/25906

Description:
<!-- Don't request update of package. We have a script for that. https://alpha.de.repo.voidlinux.org/void-updates/void-updates.txt . However, a quality pull request may help. -->
### System

* xuname:  `Void 5.8.16_1 x86_64-musl GenuineIntel notuptodate rFFFF`
* package:  `qt5-webengine-5.15.1_2`

### Expected behavior

qutebrowser (or other QT WebEngine-based browsers, eg. Falkon, though I did not test that one) routes all audio through PulseAudio (including respecting device choices - eg. a bluetooth headset over onboard audio, if the headset is the default). Failing that, it should play through the ALSA `default` device, which in my setup is also PulseAudio, via alsa-plugins-pulseaudido.

### Actual behavior

qutebrowser's QT WebEngine processes skip PulseAudio entirely an overwhelming majority of the time (however, seemingly not 100% of the time, for reasons I couldn't determine a pattern to) and instead [open their own locks on /dev/dsp/ cards](https://gist.github.com/klardotsh/e2c1cd165a30c4b72e5cef6a35ee21e4), seemingly always whatever is `sysdefault`. This cascades into a few undesired behaviors:

- The wrong audio device is used (in my case, Jitsi and YouTube playback routed through my laptop speakers instead of my Bluetooth headphones, the latter being the PulseAudio default)
- No PulseAudio-using applications can play audio at the same time over that soundcard. After disconnecting my BT headset (making Pulse fall back to the onboard card), I attempted to `mpv -ao=pulse audiofile.wav` from a terminal, and couldn't because the resource was busy (or something to that effect - I don't have the logs anymore) until the YouTube tab was closed.
- Only one tab can play audio at a time, which has been reported in Qutebrowser upstream as https://github.com/qutebrowser/qutebrowser/issues/5815. There is a similar issue open here, https://github.com/void-linux/void-packages/issues/25852, that I'm not sure is identical because I haven't looked into it.

### Steps to reproduce the behavior

Using the current stable release of QT WebEngine and PulseAudio, try to play a YouTube video, or test your audio settings in [Jitsi](https://meet.jit.si). While doing so, have `pulsemixer` or `pavucontrol` running and keep an eye on the audio sources - you _likely_ won't see `qtwebengine` in the list. This bug does not always repro reliably - you may need to restart qutebrowser and/or your machine and/or PulseAudio and/or attached soundcards to repro it.

### More Context

I already linked https://github.com/qutebrowser/qutebrowser/issues/5815 which is full of Void users with similar classes of errors (some manifesting in slightly different manners, but the same underlying issues with the same log output). There's also https://old.reddit.com/r/qutebrowser/comments/iy00k6/suddenly_no_sound_in_qutebrowser/ and https://www.reddit.com/r/voidlinux/comments/j2re7n/issues_getting_pulseaudio_to_work_correctly/ which each have instances of spurious audio reliability in `qutebrowser` that started some time recently, and seem to manifest similarly to this issue in all appreciable ways. Further, https://github.com/void-linux/void-packages/issues/25766 discusses `sndio` support itself being funky in recent QT WebEngine, which, while a different bug than I'm currently reporting, may share the same resolution. I'm linking here for completeness.

Further, I was able to change `build_options_default="sndio"` to `build_options_default=""` in the build template, compile my own `qt5-webengine-5.15.1_2`, install it, and can no longer repro the issue. In `#voidlinux` IRC, we've isolated that this is likely related to the conditional `sndio` patching applied, but as I don't use `sndio`, I don't entirely feel useful attempting to fix that patchset if anyone more qualified/with more context is available. If not, I can try to take a look.

cc @The-Compiler, @ericonr, and @Johnnynator

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
@ 2020-10-27  9:18 ` minikN
  2020-10-28  6:31 ` travankor
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: minikN @ 2020-10-27  9:18 UTC (permalink / raw)
  To: ml

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

New comment by minikN on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-717102411

Comment:
Thanks @klardotsh I can confirm that bug with qutebrowser.

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
  2020-10-27  9:18 ` minikN
@ 2020-10-28  6:31 ` travankor
  2020-10-28 18:20 ` Johnnynator
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: travankor @ 2020-10-28  6:31 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-717729467

Comment:
I've also ran into this issue (reported on IRC a while ago), but didn't really look into it at the time (although I guessed that the sndio patches were the culprit).

Should sndio be part of the default build? How many people actively use and test sndio?

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
  2020-10-27  9:18 ` minikN
  2020-10-28  6:31 ` travankor
@ 2020-10-28 18:20 ` Johnnynator
  2020-10-28 18:21 ` Johnnynator
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johnnynator @ 2020-10-28 18:20 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-718121558

Comment:
> I've also ran into this issue (reported on IRC a while ago), but didn't really look into it at the time (although I guessed that the sndio patches were the culprit).
> 
> Should sndio be part of the default build? How many people actively use and test sndio?

I do use qt5-webengine  with sndio, but if I can't figure out what causes the problem with pulse, I will hide sndio behind an env var (I don't want to fully disable it).

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (2 preceding siblings ...)
  2020-10-28 18:20 ` Johnnynator
@ 2020-10-28 18:21 ` Johnnynator
  2020-11-21 20:55 ` Johnnynator
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johnnynator @ 2020-10-28 18:21 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-718121558

Comment:
> I've also ran into this issue (reported on IRC a while ago), but didn't really look into it at the time (although I guessed that the sndio patches were the culprit).
> 
> Should sndio be part of the default build? How many people actively use and test sndio?

I do use qt5-webengine  with sndio, but if I can't figure out what causes the problem with pulse, I will hide sndio behind an env var (I don't want to fully disable it, will do the decision together with the 5.15.2 update, which will be released on November 2nd).

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (3 preceding siblings ...)
  2020-10-28 18:21 ` Johnnynator
@ 2020-11-21 20:55 ` Johnnynator
  2020-12-07  4:53 ` travankor
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johnnynator @ 2020-11-21 20:55 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-731635417

Comment:
Can you test if this still happens with qt5.15.2? I have a PR open for testing #26574

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (4 preceding siblings ...)
  2020-11-21 20:55 ` Johnnynator
@ 2020-12-07  4:53 ` travankor
  2020-12-20 13:01 ` travankor
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: travankor @ 2020-12-07  4:53 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-739662194

Comment:
I've been running QT5.12.2-sndio and haven't noticed any issues with it so far. That said, I don't use qutebrowser that much now due to memory leaks in the main process.

Would prefer if a more frequent qt-webengine user chimes in though.

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (5 preceding siblings ...)
  2020-12-07  4:53 ` travankor
@ 2020-12-20 13:01 ` travankor
  2020-12-20 13:08 ` travankor
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: travankor @ 2020-12-20 13:01 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-748604853

Comment:
Actually ran into the previous issue issue where mpv wouldn't work while qtwebengine was playing audio

```
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
[ao/alsa] Playback open error: Device or resource busy
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
[ao/jack] cannot open server
[ao] Failed to initialize audio driver 'jack'
Could not open/initialize audio device -> no sound.
Audio: no audio
```

Will give the non-sndio version a shot later.

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (6 preceding siblings ...)
  2020-12-20 13:01 ` travankor
@ 2020-12-20 13:08 ` travankor
  2020-12-20 21:42 ` pbui
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: travankor @ 2020-12-20 13:08 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-748604853

Comment:
Actually ran into the previous issue issue where multiple applications (like mpv) wouldn't work while qtwebengine was playing audio. I don't think this happens 100% deterministically... but it's happening now at least.

```
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
[ao/alsa] Playback open error: Device or resource busy
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
[ao/jack] cannot open server
[ao] Failed to initialize audio driver 'jack'
Could not open/initialize audio device -> no sound.
Audio: no audio
```

Will give the non-sndio version a shot later.

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (7 preceding siblings ...)
  2020-12-20 13:08 ` travankor
@ 2020-12-20 21:42 ` pbui
  2021-01-20 20:52 ` ericonr
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pbui @ 2020-12-20 21:42 UTC (permalink / raw)
  To: ml

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

New comment by pbui on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-748674774

Comment:
Using the qt5.15.2 that I built from #26574, qutebrowser is able to play audio normally via pulseaudio (it does not go to ALSA).  I also tested playing audio with mpv, mpd, and qutebrowser at the same time and it behaved normally.  Therefore, this problem looks resolved with that update (especially since it appears that sndio is now OFF by default).

Just a few notes: 1. I had to rebase and remove `srcpkgs/qt5-webengine/patches/0200-nullptr-rtcpeerconnectionhandler.patch`, 2. the build for qt5-webengine warned about `use_sndio=true` not being recognized (by default the build option is OFF, but the configuration arguments still specify it).

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (8 preceding siblings ...)
  2020-12-20 21:42 ` pbui
@ 2021-01-20 20:52 ` ericonr
  2021-01-20 20:57 ` pbui
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ericonr @ 2021-01-20 20:52 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-763929396

Comment:
Is this still an issue?

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (9 preceding siblings ...)
  2021-01-20 20:52 ` ericonr
@ 2021-01-20 20:57 ` pbui
  2021-01-20 20:57 ` [ISSUE] [CLOSED] " ericonr
  2021-01-20 20:57 ` ericonr
  12 siblings, 0 replies; 14+ messages in thread
From: pbui @ 2021-01-20 20:57 UTC (permalink / raw)
  To: ml

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

New comment by pbui on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-763936688

Comment:
No, it appears to be working fine now.

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

* Re: [ISSUE] [CLOSED] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (10 preceding siblings ...)
  2021-01-20 20:57 ` pbui
@ 2021-01-20 20:57 ` ericonr
  2021-01-20 20:57 ` ericonr
  12 siblings, 0 replies; 14+ messages in thread
From: ericonr @ 2021-01-20 20:57 UTC (permalink / raw)
  To: ml

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

Closed issue by klardotsh on void-packages repository

https://github.com/void-linux/void-packages/issues/25906

Description:
<!-- Don't request update of package. We have a script for that. https://alpha.de.repo.voidlinux.org/void-updates/void-updates.txt . However, a quality pull request may help. -->
### System

* xuname:  `Void 5.8.16_1 x86_64-musl GenuineIntel notuptodate rFFFF`
* package:  `qt5-webengine-5.15.1_1`

### Expected behavior

qutebrowser (or other QT WebEngine-based browsers, eg. Falkon, though I did not test that one) routes all audio through PulseAudio (including respecting device choices - eg. a bluetooth headset over onboard audio, if the headset is the default). Failing that, it should play through the ALSA `default` device, which in my setup is also PulseAudio, via alsa-plugins-pulseaudido.

### Actual behavior

qutebrowser's QT WebEngine processes skip PulseAudio entirely an overwhelming majority of the time (however, seemingly not 100% of the time, for reasons I couldn't determine a pattern to) and instead [open their own locks on /dev/dsp/ cards](https://gist.github.com/klardotsh/e2c1cd165a30c4b72e5cef6a35ee21e4), seemingly always whatever is `sysdefault`. This cascades into a few undesired behaviors:

- The wrong audio device is used (in my case, Jitsi and YouTube playback routed through my laptop speakers instead of my Bluetooth headphones, the latter being the PulseAudio default)
- No PulseAudio-using applications can play audio at the same time over that soundcard. After disconnecting my BT headset (making Pulse fall back to the onboard card), I attempted to `mpv -ao=pulse audiofile.wav` from a terminal, and couldn't because the resource was busy (or something to that effect - I don't have the logs anymore) until the YouTube tab was closed.
- Only one tab can play audio at a time, which has been reported in Qutebrowser upstream as https://github.com/qutebrowser/qutebrowser/issues/5815. There is a similar issue open here, https://github.com/void-linux/void-packages/issues/25852, that I'm not sure is identical because I haven't looked into it.

### Steps to reproduce the behavior

Using the current stable release of QT WebEngine and PulseAudio, try to play a YouTube video, or test your audio settings in [Jitsi](https://meet.jit.si). While doing so, have `pulsemixer` or `pavucontrol` running and keep an eye on the audio sources - you _likely_ won't see `qtwebengine` in the list. This bug does not always repro reliably - you may need to restart qutebrowser and/or your machine and/or PulseAudio and/or attached soundcards to repro it.

### More Context

I already linked https://github.com/qutebrowser/qutebrowser/issues/5815 which is full of Void users with similar classes of errors (some manifesting in slightly different manners, but the same underlying issues with the same log output). There's also https://old.reddit.com/r/qutebrowser/comments/iy00k6/suddenly_no_sound_in_qutebrowser/ and https://www.reddit.com/r/voidlinux/comments/j2re7n/issues_getting_pulseaudio_to_work_correctly/ which each have instances of spurious audio reliability in `qutebrowser` that started some time recently, and seem to manifest similarly to this issue in all appreciable ways. Further, https://github.com/void-linux/void-packages/issues/25766 discusses `sndio` support itself being funky in recent QT WebEngine, which, while a different bug than I'm currently reporting, may share the same resolution. I'm linking here for completeness.

Further, I was able to change `build_options_default="sndio"` to `build_options_default=""` in the build template, compile my own `qt5-webengine-5.15.1_2`, install it, and can no longer repro the issue. In `#voidlinux` IRC, we've isolated that this is likely related to the conditional `sndio` patching applied, but as I don't use `sndio`, I don't entirely feel useful attempting to fix that patchset if anyone more qualified/with more context is available. If not, I can try to take a look.

cc @The-Compiler, @ericonr, and @Johnnynator

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

* Re: qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices
  2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
                   ` (11 preceding siblings ...)
  2021-01-20 20:57 ` [ISSUE] [CLOSED] " ericonr
@ 2021-01-20 20:57 ` ericonr
  12 siblings, 0 replies; 14+ messages in thread
From: ericonr @ 2021-01-20 20:57 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/issues/25906#issuecomment-763937395

Comment:
Thanks.

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

end of thread, other threads:[~2021-01-20 20:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 23:38 [ISSUE] qt5-webengine: audio playback does not always use PulseAudio, instead capturing raw ALSA devices klardotsh
2020-10-27  9:18 ` minikN
2020-10-28  6:31 ` travankor
2020-10-28 18:20 ` Johnnynator
2020-10-28 18:21 ` Johnnynator
2020-11-21 20:55 ` Johnnynator
2020-12-07  4:53 ` travankor
2020-12-20 13:01 ` travankor
2020-12-20 13:08 ` travankor
2020-12-20 21:42 ` pbui
2021-01-20 20:52 ` ericonr
2021-01-20 20:57 ` pbui
2021-01-20 20:57 ` [ISSUE] [CLOSED] " ericonr
2021-01-20 20:57 ` ericonr

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).