The content sandboxing for Firefox prevents apulse from using any sound devices. Firefox reports the following errors when launched from a console: Sandbox: seccomp sandbox violation: pid 26471, tid 26552, syscall 16, args 41 2147767296 140673392486092 215 0 0. Sandbox: seccomp sandbox violation: pid 26471, tid 26552, syscall 16, args 41 2147767296 140673392486108 00 0. ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_direct.c:1202:(snd1_pcm_direct_initialize_poll_fd) unable to open timer 'hw:CLASS=3,SCLASS=0,CARD=0,DEV=0,SUBDEV=0' ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_dmix.c:1125:(snd_pcm_dmix_open) unable to initialize poll_fd [apulse] [error] do_connect_pcm: can't open playback device "default". Error code -38 (Function not implemented) The errors disappear (and sound works correctly) when sandboxing is disabled via the MOZ_DISABLE_CONTENT_SANDBOX environment variable. After reading the sandbox wiki page (https://wiki.mozilla.org/Security/Sandbox#Customization_Settings), I was able to configure Firefox to allow apulse access to the hardware with sandboxing enabled: security.sandbox.content.syscall_whitelist: 16 security.sandbox.content.write_path_whitelist: /dev/snd/
Yep. Apulse is an unfortunate mix of bad support from both worlds. With firefox-58.0+ right now you can build with USE="-pulseaudio" which enables alsa support and includes the necessary sandbox whitelisting in sources, or you can build with USE="pulseaudio" at which point the sandbox restrictions are there. To work around this dichotomy the only way I'm seeing at the moment is to add an "apulse" use flag, so that both the alsa-based whitelist and the pulseaudio-based code support are handled. I'm not a fan of that, to be honest. However, since the same prefs need to be set to make firefox-bin work with apulse I'll keep thinking on it rather than just dropping apulse support entirely right now..
using firefox-bin - but is this related to this? https://bugzilla.mozilla.org/show_bug.cgi?id=1426679 firefox-bin 57 was removed from portage and i'm afraid to try 58. can open another bug if needed
Please do not drop apulce support. Install all pulseaudio libs and DEPs is a nightmare and I am glad I managed to get rid of it back.
Please feel free to reopen and update any bug report that can be duplicated with current esr builds, 60.x. If you feel your feature needs to be re looked at in any of these bugs reopen and update, please attach patches when appropriate. Thank you Mozilla Team