[GH-ISSUE #2956] No sound in firefox until started without firejail once. #1851

Closed
opened 2026-05-05 08:31:13 -06:00 by gitea-mirror · 10 comments
Owner

Originally created by @lupusbytes on GitHub (Sep 9, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2956

Hello.
I'm experiencing this bug where there is no sound in firefox, if I start it with firejail.
This is the output.
lupus@thinkpad ~ $ firejail firefox [2/2] Reading profile /etc/firejail/firefox.profile Reading profile /etc/firejail/firefox-common.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-devel.inc Reading profile /etc/firejail/disable-exec.inc Reading profile /etc/firejail/disable-interpreters.inc Reading profile /etc/firejail/disable-programs.inc Reading profile /etc/firejail/whitelist-common.inc Reading profile /etc/firejail/whitelist-var-common.inc Parent pid 12913, child pid 12914 Warning: An abstract unix socket for session D-BUS might still be available. Use --ne t or remove unix from --protocol set. Post-exec seccomp protector enabled Seccomp list in: !chroot, check list: @default-keep, prelist: unknown, Child process initialized in 76.40 ms Warning: an existing sandbox was detected. /usr/bin/firefox will run without any addi tional sandboxing features JavaScript warning: moz-extension://341144dd-7b39-4a91-bdf4-add9480cfd9c/content_scri pts/injected.js, line 7: unreachable code after return statement JavaScript error: resource://gre/modules/ExtensionContent.jsm, line 554: TypeError: A rgument 1 of PrecompiledScript.executeInGlobal is not an object. [Child 56, MediaDecoderStateMachine #1] WARNING: 7fbf90b3ee60 OpenCubeb() failed to i nit cubeb: file /var/tmp/notmpfs/portage/www-client/firefox-69.0/work/firefox-69.0/do m/media/AudioStream.cpp, line 305 [Child 56, MediaDecoderStateMachine #1] WARNING: Decoder=7fbf89f53200 [OnMediaSinkAu$ ioError]: file /var/tmp/notmpfs/portage/www-client/firefox-69.0/work/firefox-69.0/do$ /media/MediaDecoderStateMachine.cpp, line 3641

If I then close Firefox and start it without firejail, like "/usr/bin/firefox", then the sound is working.
After this, if I open firefox with firejail again, then the sound will work until next reboot.

I'm running Gentoo Linux, kernel 5.2.13, and firejail is built from the live github version, 2 days ago. Firefox 69.0 is also built from source.

I have tried all the firecfg --fix-sound and sudo firecfg. But this problem is persisent every time I reboot.

Originally created by @lupusbytes on GitHub (Sep 9, 2019). Original GitHub issue: https://github.com/netblue30/firejail/issues/2956 Hello. I'm experiencing this bug where there is no sound in firefox, if I start it with firejail. This is the output. `lupus@thinkpad ~ $ firejail firefox [2/2] Reading profile /etc/firejail/firefox.profile Reading profile /etc/firejail/firefox-common.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-devel.inc Reading profile /etc/firejail/disable-exec.inc Reading profile /etc/firejail/disable-interpreters.inc Reading profile /etc/firejail/disable-programs.inc Reading profile /etc/firejail/whitelist-common.inc Reading profile /etc/firejail/whitelist-var-common.inc Parent pid 12913, child pid 12914 Warning: An abstract unix socket for session D-BUS might still be available. Use --ne t or remove unix from --protocol set. Post-exec seccomp protector enabled Seccomp list in: !chroot, check list: @default-keep, prelist: unknown, Child process initialized in 76.40 ms Warning: an existing sandbox was detected. /usr/bin/firefox will run without any addi tional sandboxing features JavaScript warning: moz-extension://341144dd-7b39-4a91-bdf4-add9480cfd9c/content_scri pts/injected.js, line 7: unreachable code after return statement JavaScript error: resource://gre/modules/ExtensionContent.jsm, line 554: TypeError: A rgument 1 of PrecompiledScript.executeInGlobal is not an object. [Child 56, MediaDecoderStateMachine #1] WARNING: 7fbf90b3ee60 OpenCubeb() failed to i nit cubeb: file /var/tmp/notmpfs/portage/www-client/firefox-69.0/work/firefox-69.0/do m/media/AudioStream.cpp, line 305 [Child 56, MediaDecoderStateMachine #1] WARNING: Decoder=7fbf89f53200 [OnMediaSinkAu$ ioError]: file /var/tmp/notmpfs/portage/www-client/firefox-69.0/work/firefox-69.0/do$ /media/MediaDecoderStateMachine.cpp, line 3641` If I then close Firefox and start it without firejail, like "/usr/bin/firefox", then the sound is working. After this, if I open firefox with firejail again, then the sound will work until next reboot. I'm running Gentoo Linux, kernel 5.2.13, and firejail is built from the live github version, 2 days ago. Firefox 69.0 is also built from source. I have tried all the `firecfg --fix-sound` and `sudo firecfg`. But this problem is persisent every time I reboot.
Author
Owner

@ghost commented on GitHub (Sep 10, 2019):

Warning: an existing sandbox was detected. /usr/bin/firefox will run without any addi tional sandboxing features

The warning suggests that you're starting firefox from within another firejail sandbox, which is non-standard and probably the cause of your issue. When you ran sudo firecfg firejail placed a symlink called firefox in /usr/local/bin (amongst all other supported applications). Does the issue persist when you undo this via sudo firecfg --clean, kill any lingering firefox processes and run firejail /usr/bin/firefox again?

<!-- gh-comment-id:529714887 --> @ghost commented on GitHub (Sep 10, 2019): > Warning: an existing sandbox was detected. /usr/bin/firefox will run without any addi tional sandboxing features The warning suggests that you're starting firefox from within another firejail sandbox, which is non-standard and probably the cause of your issue. When you ran `sudo firecfg` firejail placed a symlink called firefox in `/usr/local/bin` (amongst all other supported applications). Does the issue persist when you undo this via `sudo firecfg --clean`, kill any lingering firefox processes and run `firejail /usr/bin/firefox` again?
Author
Owner

@lupusbytes commented on GitHub (Sep 10, 2019):

My bad.. I didn't stop to think that when i typed firejail firefox, it would actually run firejail /usr/local/bin/firefox which is already a symlink.
However, If i run:
lupus@thinkpad ~ $ firejail /usr/bin/firefox Reading profile /etc/firejail/firefox.profile Reading profile /etc/firejail/firefox-common.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-devel.inc Reading profile /etc/firejail/disable-exec.inc Reading profile /etc/firejail/disable-interpreters.inc Reading profile /etc/firejail/disable-programs.inc Reading profile /etc/firejail/whitelist-common.inc Reading profile /etc/firejail/whitelist-var-common.inc Parent pid 16323, child pid 16324 Warning: An abstract unix socket for session D-BUS might still be available. Use --ne Post-exec seccomp protector enabled Seccomp list in: !chroot, check list: @default-keep, prelist: unknown, Child process initialized in 67.32 ms JavaScript warning: moz-extension://341144dd-7b39-4a91-bdf4-add9480cfd9c/content_scripts/injected.js, line 7: unreachable code after return statement JavaScript error: resource://gre/modules/ExtensionContent.jsm, line 554: TypeError: Argument 1 of PrecompiledScript.executeInGlobal is not an object. JavaScript warning: moz-extension://341144dd-7b39-4a91-bdf4-add9480cfd9c/content_scripts/injected.js, line 7: unreachable code after return statement [Child 56, MediaDecoderStateMachine #1] WARNING: 7f287ab2cd90 OpenCubeb() failed to init cubeb: file /var/tmp/notmpfs/portage/www-client/firefox-69.0/work/firefox-69.0/dom/media/AudioStream.cpp, line 305 [Child 56, MediaDecoderStateMachine #1] WARNING: Decoder=7f287aae1e00 [OnMediaSinkAudioError]: file /var/tmp/notmpfs/portage/www-client/firefox-69.0/work/firefox-69.0/dom/media/MediaDecoderStateMachine.cpp, line 3641

I still get the AudoStream.cpp error and MediaDecoderStateMachine.cpp errors.

As you suggested i tried sudo firecfg --clean first and then firejail /usr/bin/firefox.
The issue does persist unfortunately.
As I described in my original post, the fix for me is still to start firefox once, without firejail.
I tested it a bit further. When the browser is running, without firejail, I have to trigger some sort of sound, like going to YouTube, for the next firejailed instance to also have sound, else it will not work.

I know little about the internals of Firefox and firejail, but it could seem to me there some sort of pulseaudio socket or whatever will not be created if it's only running within firejail.

<!-- gh-comment-id:530054046 --> @lupusbytes commented on GitHub (Sep 10, 2019): My bad.. I didn't stop to think that when i typed `firejail firefox`, it would actually run `firejail /usr/local/bin/firefox` which is already a symlink. However, If i run: `lupus@thinkpad ~ $ firejail /usr/bin/firefox Reading profile /etc/firejail/firefox.profile Reading profile /etc/firejail/firefox-common.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-devel.inc Reading profile /etc/firejail/disable-exec.inc Reading profile /etc/firejail/disable-interpreters.inc Reading profile /etc/firejail/disable-programs.inc Reading profile /etc/firejail/whitelist-common.inc Reading profile /etc/firejail/whitelist-var-common.inc Parent pid 16323, child pid 16324 Warning: An abstract unix socket for session D-BUS might still be available. Use --ne Post-exec seccomp protector enabled Seccomp list in: !chroot, check list: @default-keep, prelist: unknown, Child process initialized in 67.32 ms JavaScript warning: moz-extension://341144dd-7b39-4a91-bdf4-add9480cfd9c/content_scripts/injected.js, line 7: unreachable code after return statement JavaScript error: resource://gre/modules/ExtensionContent.jsm, line 554: TypeError: Argument 1 of PrecompiledScript.executeInGlobal is not an object. JavaScript warning: moz-extension://341144dd-7b39-4a91-bdf4-add9480cfd9c/content_scripts/injected.js, line 7: unreachable code after return statement [Child 56, MediaDecoderStateMachine #1] WARNING: 7f287ab2cd90 OpenCubeb() failed to init cubeb: file /var/tmp/notmpfs/portage/www-client/firefox-69.0/work/firefox-69.0/dom/media/AudioStream.cpp, line 305 [Child 56, MediaDecoderStateMachine #1] WARNING: Decoder=7f287aae1e00 [OnMediaSinkAudioError]: file /var/tmp/notmpfs/portage/www-client/firefox-69.0/work/firefox-69.0/dom/media/MediaDecoderStateMachine.cpp, line 3641 ` I still get the AudoStream.cpp error and MediaDecoderStateMachine.cpp errors. As you suggested i tried `sudo firecfg --clean` first and then `firejail /usr/bin/firefox`. The issue does persist unfortunately. As I described in my original post, the fix for me is still to start firefox once, without firejail. I tested it a bit further. When the browser is running, without firejail, I have to trigger some sort of sound, like going to YouTube, for the next firejailed instance to also have sound, else it will not work. I know little about the internals of Firefox and firejail, but it could seem to me there some sort of pulseaudio socket or whatever will not be created if it's only running within firejail.
Author
Owner

@rusty-snake commented on GitHub (Sep 10, 2019):

Works it with firejail --noprofile firefox?

/var/tmp/notmpfs/portage/www-client/ there do you build firefox but there is no library/executable , right?

<!-- gh-comment-id:530057557 --> @rusty-snake commented on GitHub (Sep 10, 2019): Works it with `firejail --noprofile firefox`? `/var/tmp/notmpfs/portage/www-client/` there do you build firefox but there is no library/executable , right?
Author
Owner

@lupusbytes commented on GitHub (Sep 10, 2019):

Yes, sound works with firejail --noprofile firefox
What does --noprofile mean exactly ?

You are correct, it was built there, /var/tmp/notmpfs/portage/www-client/ does not exist anymore.

<!-- gh-comment-id:530070184 --> @lupusbytes commented on GitHub (Sep 10, 2019): Yes, sound works with `firejail --noprofile firefox` What does --noprofile mean exactly ? You are correct, it was built there, `/var/tmp/notmpfs/portage/www-client/` does not exist anymore.
Author
Owner

@rusty-snake commented on GitHub (Sep 10, 2019):

What does --noprofile mean exactly?

Ir disable the usage of profiles, so now we now that one option in firefox.profile or firefox-common.profile is causing this and not firejail itself. I don't have ideas what option could causeing this, so you need not try it out (I know its ugly if you have to reboot to test). But you could also watch with syslog if you haven't already.

<!-- gh-comment-id:530077824 --> @rusty-snake commented on GitHub (Sep 10, 2019): > What does --noprofile mean exactly? Ir disable the usage of profiles, so now we now that one option in firefox.profile or firefox-common.profile is causing this and not firejail itself. I don't have ideas what option could causeing this, so you need not try it out (I know its ugly if you have to reboot to test). But you could also watch with syslog if you haven't already.
Author
Owner

@rusty-snake commented on GitHub (Sep 28, 2019):

@lupusbytes ping 🙄

<!-- gh-comment-id:536182909 --> @rusty-snake commented on GitHub (Sep 28, 2019): @lupusbytes ping :roll_eyes:
Author
Owner

@rusty-snake commented on GitHub (Oct 13, 2019):

@lupusbytes
I'm closing here due to inactivity, please fell free to reopen if you still have this issue.

<!-- gh-comment-id:541425330 --> @rusty-snake commented on GitHub (Oct 13, 2019): @lupusbytes I'm closing here due to inactivity, please fell free to reopen if you still have this issue.
Author
Owner

@lupusbytes commented on GitHub (Feb 2, 2020):

I finally had some time to dig around..
Using firemon, i noticed that it was trying to execute /usr/bin/pulseaudio --start --log-target=syslog

13:20:09 exit 15561 (lupus)
13:20:09 exec 15569 (lupus) /usr/bin/pulseaudio --start --log-target=syslog
13:20:09 exit 15569 (lupus)
13:20:09 fork 15360 (lupus) /usr/bin/firefox
        child 15571 /usr/bin/firefox
13:20:09 exec 15571 (lupus) /usr/bin/pulseaudio --start --log-target=syslog
13:20:09 exit 15571 (lupus)

On my system, pulseaudio doesn't get automatically started on boot, only the first time the audio is needed.
When the very first time sound is needed by the system, and it's by firefox and firefox is running inside firejail, it fails to start pulseaudio.

Should I somehow whitelist pulseaudio ?

<!-- gh-comment-id:581130693 --> @lupusbytes commented on GitHub (Feb 2, 2020): I finally had some time to dig around.. Using firemon, i noticed that it was trying to execute `/usr/bin/pulseaudio --start --log-target=syslog` ``` 13:20:09 exit 15561 (lupus) 13:20:09 exec 15569 (lupus) /usr/bin/pulseaudio --start --log-target=syslog 13:20:09 exit 15569 (lupus) 13:20:09 fork 15360 (lupus) /usr/bin/firefox child 15571 /usr/bin/firefox 13:20:09 exec 15571 (lupus) /usr/bin/pulseaudio --start --log-target=syslog 13:20:09 exit 15571 (lupus) ``` On my system, pulseaudio doesn't get automatically started on boot, only the first time the audio is needed. When the very first time sound is needed by the system, and it's by firefox and firefox is running inside firejail, it fails to start pulseaudio. Should I somehow whitelist pulseaudio ?
Author
Owner

@rusty-snake commented on GitHub (Feb 2, 2020):

Should I somehow whitelist pulseaudio ?

Then pulseaudio is started in the firefox sandbox, this may cause issues. Maybe a it is better to start pulse with firefox in a wrapper script like start_pulseaudio ; firejail firefox.

<!-- gh-comment-id:581132129 --> @rusty-snake commented on GitHub (Feb 2, 2020): > Should I somehow whitelist pulseaudio ? Then pulseaudio is started in the firefox sandbox, this may cause issues. Maybe a it is better to start pulse with firefox in a wrapper script like `start_pulseaudio ; firejail firefox`.
Author
Owner

@lupusbytes commented on GitHub (Feb 2, 2020):

That makes sense, I should probably just start pulseaudio along with my window manager.

<!-- gh-comment-id:581132802 --> @lupusbytes commented on GitHub (Feb 2, 2020): That makes sense, I should probably just start pulseaudio along with my window manager.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#1851
No description provided.