Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646128 - www-client/firefox-58.0.1 requires extra configuration when used with media-sound/apulse-0.1.10
Summary: www-client/firefox-58.0.1 requires extra configuration when used with media-s...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 16:13 UTC by Grant
Modified: 2019-03-31 20:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant 2018-01-30 16:13:13 UTC
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/
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2018-01-30 22:36:13 UTC
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..
Comment 2 zlice 2018-02-10 05:01:35 UTC
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
Comment 3 Martin Mokrejš 2018-10-29 10:46:58 UTC
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.
Comment 4 Jory A. Pratt gentoo-dev 2019-03-31 20:06:26 UTC
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