i-rinat / apulse

PulseAudio emulation for ALSA
MIT License
609 stars 35 forks source link

Firejailed browsers no sound (Firefox & Brave) #103

Open lepz0r opened 5 years ago

lepz0r commented 5 years ago

Distro : Artix Linux Firejail version : 0.9.60 Firefox version : 70.0.1 Brave version : 0.68.132 (Chromium 76.0.3809.132)

Firefox:

❮ apulse firejail --noprofile firefox                                                                                                                                                                                                                                        <<<
Parent pid 20984, child pid 20985
Child process initialized in 3.12 ms
Warning: an existing sandbox was detected. /usr/bin/firefox will run without any additional sandboxing features
[Child 45, MediaDecoderStateMachine #1] WARNING: 7f41aef4bfc0 OpenCubeb() failed to init cubeb: file /build/firefox/src/firefox-70.0.1/dom/media/AudioStream.cpp, line 305
[Child 45, MediaDecoderStateMachine #1] WARNING: Decoder=7f41b7da7800 [OnMediaSinkAudioError]: file /build/firefox/src/firefox-70.0.1/dom/media/MediaDecoderStateMachine.cpp, line 3636
[Child 45, MediaDecoderStateMachine #1] WARNING: 7f419f4af390 OpenCubeb() failed to init cubeb: file /build/firefox/src/firefox-70.0.1/dom/media/AudioStream.cpp, line 305
[Child 45, MediaDecoderStateMachine #1] WARNING: Decoder=7f41b7da7800 [OnMediaSinkAudioError]: file /build/firefox/src/firefox-70.0.1/dom/media/MediaDecoderStateMachine.cpp, line 3636

Note: without --noprofile output same error as above (... WARNING: 7f419f4af390 OpenCubeb() failed ...) & (... WARNING: Decoder=7f41b7da7800 [OnMediaSinkAudioError]: ...)

Brave :

❮ apulse firejail --noprofile brave
Parent pid 22293, child pid 22294
Child process initialized in 3.18 ms
Warning: an existing sandbox was detected. /usr/bin/brave will run without any additional sandboxing features
gzip: /proc/config.gz: Permission denied
User namespaces are not detected as enabled on your system, Brave will run with the sandbox disabled
[7:65:1105/020314.011846:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
[7:65:1105/020344.090590:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090611:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090618:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090624:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090630:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090636:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090646:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090654:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090660:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090667:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090673:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090680:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090688:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
[7:65:1105/020344.090695:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
valid types are "tcp" and on UNIX "unix")
ALSA lib pcm.c:8598:(snd_pcm_set_params) Unable to get period size for PLAYBACK: Invalid argument
ALSA lib pcm.c:8598:(snd_pcm_set_params) Unable to get period size for PLAYBACK: Invalid argument

Same without --noprofile

i-rinat commented 4 years ago

I don't think it has anything to do with apulse. I tried to run firefox under firejail with apulse with tracing messages enabled. And there were no messages from apulse. From what I see, execution doesn't get to the point where apulse may do anything. Looks like firejail breaks communications between Firefox processes.

You'll need to create a profile for firejail that allows necessary communications between Firefox processes and Firefox and ALSA device files.