Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox can't access sndio sound server #4362

Closed
7 tasks done
nullenvk opened this issue Jun 19, 2021 · 4 comments · Fixed by #4365
Closed
7 tasks done

Firefox can't access sndio sound server #4362

nullenvk opened this issue Jun 19, 2021 · 4 comments · Fixed by #4365

Comments

@nullenvk
Copy link
Contributor

Bug and expected behavior
When using firejail, firefox can't play audio through sndio (an alternative to pulseaudio), most likely because it requires access to $HOME/.sndio/cookie. Firefox should be able to connect to sndio with use of the cookie file.

No profile and disabling firejail
Without firejail or without profiles, firefox works fine with sndio and is able to play audio.

Reproduce
Steps to reproduce the behavior:

  1. Start sndio
  2. Run firefox in firejail
  3. Change default cubeb backend to sndio in about:config (media.cubeb.backend = sndio, security.sandbox.content.read_path_whitelist and write_path_whitelist = $HOME/.sndio/cookie)
  4. Play any audio file and receive following errors in console
[Child 262, MediaDecoderStateMachine #1] WARNING: 7f9d097433c0 OpenCubeb() failed to init cubeb: file /var/tmp/portage/www-client/firefox-89.0.1/work/firefox-89.0.1/dom/media/AudioStream.cpp:323
[Child 262, MediaDecoderStateMachine #1] WARNING: Decoder=7f9d0b7c1c00 [OnMediaSinkAudioError]: file /var/tmp/portage/www-client/firefox-89.0.1/work/firefox-89.0.1/dom/media/MediaDecoderStateMachine.cpp:3916

Environment

  • Gentoo/Linux (latest)
  • firejail version 0.9.64.4

Checklist

  • The profile (and redirect profile if exists) hasn't already been fixed upstream.
  • The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
  • I have performed a short search for similar issues (to avoid opening a duplicate).
  • If it is a AppImage, --profile=PROFILENAME is used to set the right profile.
  • Used LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAM to get english error-messages.
  • I'm aware of browser-allow-drm yes/browser-disable-u2f no in firejail.config to allow DRM/U2F in browsers.
  • This is not a question. Questions should be asked in https://github.com/netblue30/firejail/discussions.
@nullenvk
Copy link
Contributor Author

Also, when you disable cubeb's sandbox (media.cubeb.sandbox in about:config) with sndio backend enabled, seccomp violations occur when trying to play audio:

Sandbox: seccomp sandbox violation: pid 301, tid 373, syscall 220, args 131111 139665670645564 2 0 139666228847724 139665660862640.

@rusty-snake
Copy link
Collaborator

When using firejail, firefox can't play audio through sndio (an alternative to pulseaudio), most likely because it requires access to $HOME/.sndio/cookie. Firefox should be able to connect to sndio with use of the cookie file.

If whitelist ${HOME}/.sndio/cookie works, we should add it to whitelist-common.inc

Also, when you disable cubeb's sandbox (media.cubeb.sandbox in about:config) with sndio backend enabled, seccomp violations occur when trying to play audio:

syscall 220 is semtimedop on x86_64 and getdents64 on i386. Both aren't blocked by firejail. Can you reproduce this with --noprofile too?

@nullenvk
Copy link
Contributor Author

When using firejail, firefox can't play audio through sndio (an alternative to pulseaudio), most likely because it requires access to $HOME/.sndio/cookie. Firefox should be able to connect to sndio with use of the cookie file.

If whitelist ${HOME}/.sndio/cookie works, we should add it to whitelist-common.inc

Also, when you disable cubeb's sandbox (media.cubeb.sandbox in about:config) with sndio backend enabled, seccomp violations occur when trying to play audio:

syscall 220 is semtimedop on x86_64 and getdents64 on i386. Both aren't blocked by firejail. Can you reproduce this with --noprofile too?

The problem doesn't occur when I use --noprofile. However, I think adding that whitelist option to whitelist-common.local stopped these seccomp messages from appearing, although the problem still occurs and firefox prints out that "failed to init cubeb" message.

@nullenvk
Copy link
Contributor Author

Oh, I've found out how to fix it. The program needs to access /tmp/sndio directory too, then the problem stops.

@rusty-snake rusty-snake linked a pull request Jun 20, 2021 that will close this issue
kmk3 added a commit that referenced this issue Feb 3, 2022
@kmk3 kmk3 moved this to Done (on RELNOTES) in Release 0.9.68 Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging a pull request may close this issue.

2 participants