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 58: does not produce any sound #34822

Closed
castilma opened this issue Feb 10, 2018 · 25 comments · Fixed by #35047
Closed

firefox 58: does not produce any sound #34822

castilma opened this issue Feb 10, 2018 · 25 comments · Fixed by #35047

Comments

@castilma
Copy link

castilma commented Feb 10, 2018

Issue description

Edit: firefox doesn't produce any sound anymore.
With a clean firefox profile, I am unable to play this stream.
The error is Error loading media: File could not be played

When I click on play, the lines starting from Sandbox get printed.

$ firefox -profilemanager                                       
JavaScript error: jar:file:///nix/store/w28043p6gfzsihrpd7p7xzb4am4fmvmm-firefox-unwrapped-58.0.1/lib/firefox-58.0.1/omni.ja!/components/XULStore.js, line 70: Error: Can't find profile directory.
JavaScript error: jar:file:///nix/store/w28043p6gfzsihrpd7p7xzb4am4fmvmm-firefox-unwrapped-58.0.1/lib/firefox-58.0.1/omni.ja!/components/XULStore.js, line 70: Error: Can't find profile directory.
JavaScript warning: https://archive.org/includes/jquery-1.10.2.min.js?v1.10.2, line 1: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead
JavaScript warning: resource://devtools/shared/base-loader.js -> resource://devtools/client/shared/demangle.js, line 0: Successfully compiled asm.js code (total compilation time 450ms; unable to cache asm.js in synchronous scripts; try loading asm.js via <script async> or createElement('script'))
Sandbox: seccomp sandbox violation: pid 20594, tid 20869, syscall 16, args 45 2147767296 139970708755800 105 0 0.
Sandbox: seccomp sandbox violation: pid 20594, tid 20869, syscall 16, args 45 2147767296 139970708755816 105 0 0.
[Child 20594, MediaPlayback #1] WARNING: 7f4d7689ef40 OpenCubeb() failed to init cubeb: file /build/firefox-58.0.1/dom/media/AudioStream.cpp, line 387
[Child 20594, MediaPlayback #2] WARNING: Decoder=7f4d76224400 [OnMediaSinkAudioError]: file /build/firefox-58.0.1/dom/media/MediaDecoderStateMachine.cpp, line 3642
[Child 20594, MediaPlayback #2] WARNING: Decoder=7f4d76224400 Decode error: NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b) - OnMediaSinkAudioError: file /build/firefox-58.0.1/dom/media/MediaDecoderStateMachine.cpp, line 3365

videos on youtube play, but without sound. terminal output:

Sandbox: seccomp sandbox violation: pid 9292, tid 9427, syscall 16, args 51 2147767296 140313671193944 105 0 0.
Sandbox: seccomp sandbox violation: pid 9292, tid 9427, syscall 16, args 51 2147767296 140313671193960 105 0 0.
[Child 9292, MediaPlayback #3] WARNING: 7f9d4642e940 OpenCubeb() failed to init cubeb: file /build/firefox-58.0.1/dom/media/AudioStream.cpp, line 387
[Child 9292, MediaPlayback #3] WARNING: Decoder=7f9d5053b400 [OnMediaSinkAudioError]: file /build/firefox-58.0.1/dom/media/MediaDecoderStateMachine.cpp, line 3642

Steps to reproduce

install firefox 58.0.1 (or 58.0.2): nix-env -iA nixos.firefox
launch from the console: $ firefox #-profilemanager #optionally create a new profile
try to play mentioned stream

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.9.78, NixOS, 17.09.2987.59890bb1351 (Hummingbird)
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 1.11.16
  • channels(mcd): ""
  • channels(root): "nixos-17.09.2987.59890bb1351"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@castilma castilma changed the title firefox: can't play streams on archive.org firefox 58: does not produce any sound Feb 11, 2018
@emmanuelrosa
Copy link
Contributor

I have the same issue. In contrast, Firefox 57.0.4 works fine.

[emmanuel@~/]$ firefox
1518383856972	addons.webextension.https-everywhere@eff.org	WARN	Please specify whether you want browser_style or not in your browser_action options.
Sandbox: seccomp sandbox violation: pid 15674, tid 15778, syscall 16, args 51 2147767296 140106746305336 0 0 8.
Sandbox: seccomp sandbox violation: pid 15674, tid 15778, syscall 16, args 51 2147767296 140106746305352 0 0 8.
[Child 15674, MediaPlayback #1] WARNING: 7f6d20584400 OpenCubeb() failed to init cubeb: file /build/firefox-58.0.1/dom/media/AudioStream.cpp, line 387
[Child 15674, MediaPlayback #1] WARNING: Decoder=7f6d200bf200 [OnMediaSinkAudioError]: file /build/firefox-58.0.1/dom/media/MediaDecoderStateMachine.cpp, line 3642

@emmanuelrosa
Copy link
Contributor

I found a work-around: use PulseAudio.

hardware.pulseaudio.enable = true;

The above will also set up an ALSA plugin which routes all audio to PulseAudio. Then of course PulseAudio needs to be configured to use the ALSA device you want.

@oxij
Copy link
Member

oxij commented Feb 12, 2018 via email

@martingms
Copy link
Contributor

It seems there is a patch upstream here: https://bugzilla.mozilla.org/show_bug.cgi?id=1430274
Enabling pulseaudio is not an option for me, so would love if this patch could be applied

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Feb 15, 2018

install firefox 58.0.1

Which Firefox package did you install? I think Mozilla disabled ALSA in their builds so firefox-bin should only have audio using PulseAudio, on the other end the firefox package (built from source) has it enabled.

@emmanuelrosa
Copy link
Contributor

I used the firefox package and experienced the issue. We'll see what castilma says.

@castilma
Copy link
Author

i used nix-env -iA nixos.firefox

@martingms
Copy link
Contributor

firefox for me too, worked up until around the 58 release

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Feb 15, 2018

So no, it's another issue. I can't build firefox right now, you could try the patch with something like this

{ pkgs ? import <nixpkgs> { } }:

let
  patched = pkgs.firefox-unwrapped.overrideDerivation (base: {
    patches = base.patches ++ [
      (pkgs.fetchpatch {
        url    = "https://hg.mozilla.org/mozilla-central/raw-diff/b2a41379cc75/security/sandbox/linux/moz.build";
        sha256 = "1kdhkx3xaaw3vh5dfl42y0f7gmbis1aqfv0xyqpcq2j8pjmx7afz";
      })
    ];
  });

in 
  pkgs.wrapFirefox patched { }

@castilma
Copy link
Author

sorry, still a noob with nix. where am i supposed to put that code?

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Feb 15, 2018

Put it in a random .nix file and call nix-build on it.

@emmanuelrosa
Copy link
Contributor

emmanuelrosa commented Feb 16, 2018 via email

@castilma
Copy link
Author

the hash you put was not the one nix received. after fixing that, I got the same error as emmanuelrosa:

$ nix-build fire.nix 
these derivations will be built:
  /nix/store/316q90p0ml1gy787zl2wpfbmr3g9v4ad-moz.build.drv
  /nix/store/s0qvivq2xr4hqdr2z1p22q9wd88hykwg-firefox-unwrapped-58.0.2.drv
  /nix/store/770d2ib9lnf2gmdikysjb76xbk8yi3gi-firefox-58.0.2.drv
these paths will be fetched (102.50 MiB download, 359.51 MiB unpacked):
  /nix/store/g0jkr2gskbw75qf0zqva7hsrld8vbjvf-cargo-binary-1.21.0
  /nix/store/y3492fjimaa1gdl4351b654nz4l7c0bx-rustc-binary-1.21.0
fetching path ‘/nix/store/y3492fjimaa1gdl4351b654nz4l7c0bx-rustc-binary-1.21.0’...
building path(s) ‘/nix/store/wq0i5f4jbkcz6vlcwch15liwjhp3rww6-moz.build’

*** Downloading ‘https://cache.nixos.org/nar/08xsf0wi6g15fssx9bqx8xcwkh94fb1fa16i0rkmf8nih0zhb3ik.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/y3492fjimaa1gdl4351b654nz4l7c0bx-rustc-binary-1.21.0’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
trying https://hg.mozilla.org/mozilla-central/raw-diff/b2a41379cc75/security/sandbox/linux/moz.build
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   882    0   882    0     0    410      0 --:--:--  0:00:02 --:--:--   410
100 98.7M  100 98.7M    0     0   893k      0  0:01:53  0:01:53 --:--:-- 1601k

fetching path ‘/nix/store/g0jkr2gskbw75qf0zqva7hsrld8vbjvf-cargo-binary-1.21.0’...

*** Downloading ‘https://cache.nixos.org/nar/0qy4xfbx6qdk4as38vgn6r7607k233rcsy7da2wn1pny8s9vhcvq.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/g0jkr2gskbw75qf0zqva7hsrld8vbjvf-cargo-binary-1.21.0’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3838k  100 3838k    0     0   905k      0  0:00:04  0:00:04 --:--:--  905k

building path(s) ‘/nix/store/anfhi7r52bn7c5g95l457pncbadg1akg-firefox-unwrapped-58.0.2’
unpacking sources
unpacking source archive /nix/store/95ybwz26lnyf9ygvm2pfr36m5dy4w71b-firefox-58.0.2.source.tar.xz
source root is firefox-58.0.2
setting SOURCE_DATE_EPOCH to timestamp 1517954713 of file firefox-58.0.2/sourcestamp.txt
patching sources
applying patch /nix/store/4irdqv3nsx8qsyg546s8l81556ff1cq5-no-buildconfig.patch
patching file docshell/base/nsAboutRedirector.cpp
patching file toolkit/content/jar.mn
applying patch /nix/store/wq0i5f4jbkcz6vlcwch15liwjhp3rww6-moz.build
patching file security/sandbox/linux/moz.build
Hunk #1 FAILED at 73.
1 out of 1 hunk FAILED -- saving rejects to file security/sandbox/linux/moz.build.rej
builder for ‘/nix/store/s0qvivq2xr4hqdr2z1p22q9wd88hykwg-firefox-unwrapped-58.0.2.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/770d2ib9lnf2gmdikysjb76xbk8yi3gi-firefox-58.0.2.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/770d2ib9lnf2gmdikysjb76xbk8yi3gi-firefox-58.0.2.drv’ failed

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Feb 16, 2018

It doesn't apply to our revision. I'm downloading the source to see what's different.

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Feb 16, 2018

It was the wrong url apparently, the one in attachment works.

{ pkgs ? import <nixpkgs> { } }:

let
  patched = pkgs.firefox-unwrapped.overrideDerivation (base: {
    patches = base.patches ++ [
      (pkgs.fetchpatch {
        url    = "https://bug1430274.bmoattachments.org/attachment.cgi?id=8943426";
        sha256 = "12yfss3k61yilrb337dh2rffy5hh83d2f16gqrf5i56r9c33f7hf";
      })
    ];
  });

in 
  pkgs.wrapFirefox patched { }

@oxij
Copy link
Member

oxij commented Feb 16, 2018 via email

@castilma
Copy link
Author

castilma commented Feb 16, 2018

how long does a firefox build take? it's already 2 hours at it and now i realised it's only using 1 of my 2 cores. would it be faster, if I restart it with 2 cores?

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Feb 16, 2018

For me It usually takes about 2.5 hours with 4 cores. I wouldn't interrupt it if I were you.
The problem is that it also uses a LOT or ram and disk space and I would have to rebuild my system and reboot to disable tmpfs to build it.

@oxij
Copy link
Member

oxij commented Feb 16, 2018

Should be fixed by #35047. The music from the OP and youtube plays fine and with sound.

@castilma
Copy link
Author

my build with the patch worked, but /nix/store/d875x2p6axiws57is2bbzn148agf9h86-firefox-58.0.2 (downloaded substitute) gives me:

Sandbox: seccomp sandbox violation: pid 16979, tid 17120, syscall 16, args 44 2147767296 140236979680600 105 0 0.
Sandbox: seccomp sandbox violation: pid 16979, tid 17120, syscall 16, args 44 2147767296 140236979680616 105 0 0.
[Child 16979, MediaPlayback #3] WARNING: 7f8b7d4bb040 OpenCubeb() failed to init cubeb: file /build/firefox-58.0.2/dom/media/AudioStream.cpp, line 387
[Child 16979, MediaPlayback #3] WARNING: Decoder=7f8b6d691400 [OnMediaSinkAudioError]: file /build/firefox-58.0.2/dom/media/MediaDecoderStateMachine.cpp, line 3642
JavaScript error: undefined, line 0: Error: Could not establish connection. Receiving end does not exist.
JavaScript error: chrome://browser/content/ext-browser.js, line 0: Error: Invalid tab ID: -1
JavaScript error: chrome://browser/content/ext-browser.js, line 0: Error: Invalid tab ID: -1
JavaScript error: chrome://browser/content/ext-browser.js, line 0: Error: Invalid tab ID: -1
JavaScript error: chrome://browser/content/ext-browser.js, line 0: Error: Invalid tab ID: -1

that somehow has no sound again.

@emmanuelrosa
Copy link
Contributor

What's your nixos-version?

@castilma
Copy link
Author

17.09.3023.c882c4dd55e

@emmanuelrosa
Copy link
Contributor

Hmm... that commit, c882c4d, is to enable PulseAudio by default. The commit with the patch is dcad8f1.

@castilma
Copy link
Author

so, from the commit dates, it means i have a nix that is to old? nix-channel --update gives me c882c4d. is that normal?

@emmanuelrosa
Copy link
Contributor

It looks like the nixos-unstable channel has not caught up with the nixos-unstable branch. The commit you're looking for is in the nixos-unstable branch, but for some reason the archive nix-channel looks for is not there yet.

Note: I just noticed you reported the issue on Hummingbird, which is the stable branch. The commit was merged to the master branch, so you won't see it on Hummingbird; It'll be on Impala.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants