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 crashes if pipewire-screenaudio is active on NixOS with Mesa GPU drivers #102

Open
flippette opened this issue Jun 28, 2024 · 36 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@flippette
Copy link

flippette commented Jun 28, 2024

I've tested both Discord and the gUM Test Page, both exhibits this behavior.

I'm using Firefox v127.0.1 on NixOS 24.11 unstable.

(Edit: More system info:

  • OS: <as above>
  • Firefox: <as above>
  • WM: Hyprland v0.41.1
  • libpipewire: v1.0.7

I'll attach more info on request.)

@IceDBorn
Copy link
Owner

I have this issue too. @jim3692 does not have this bug on Arch, I'm not sure if he's on the latest stable firefox though.

@IceDBorn IceDBorn self-assigned this Jun 28, 2024
@IceDBorn IceDBorn added the bug Something isn't working label Jun 28, 2024
@IceDBorn IceDBorn pinned this issue Jun 28, 2024
@IceDBorn IceDBorn added help wanted Extra attention is needed question Further information is requested labels Jun 28, 2024
@IceDBorn
Copy link
Owner

We need more testing from NixOS users as well as different distro users. We're not sure if this issue is NixOS specific or not.

@IceDBorn
Copy link
Owner

We did some debugging, and it seems like that this is a bug that occurred with Firefox 127.0 specifically on nix.

@IceDBorn
Copy link
Owner

[Parent 170908, IPC I/O Parent] WARNING: process 171266 exited on signal 11: file /build/firefox-128.0/ipc/chromium/src/base/process_util_posix.cc:335, this error is thrown in the shell.

@jim3692
Copy link
Collaborator

jim3692 commented Jul 11, 2024

It doesn't crash if I set the latency to 17 or more. Given that my display is 60Hz (meaning the frametime is 16.67ms), there must be a relation between those numbers.

// You can set more audio constraints here, bellow are some examples
// latency: 0,
// sampleRate: 48000,
// sampleSize: 16,

EDIT: It works fine with latency 17 when I do not run firefox with nixGL. When I do use nixGL (which offers hardware codecs support for nix apps on non-nix distros, like Arch) it needs to be at least 18.

@IceDBorn
Copy link
Owner

@flippette Can you tinker with the latency and see if it fixes the crashes for you?

@flippette
Copy link
Author

@flippette Can you tinker with the latency and see if it fixes the crashes for you?

My Nix install broke, so I'm back on Arch for the time being. I'll try doing that when I get my laptop.

@jim3692
Copy link
Collaborator

jim3692 commented Jul 18, 2024

@flippette Could you tell us what is your GPU? I am starting to suspect the AMD drivers, as Firefox isn't crashing in VirtualBox.

@flippette
Copy link
Author

@flippette Could you tell us what is your GPU? I am starting to suspect the AMD drivers, as Firefox isn't crashing in VirtualBox.

I have a Radeon RX 7800 XT.

@jim3692
Copy link
Collaborator

jim3692 commented Jul 18, 2024

Thank you for your feedback. I tried to passthrough my RTX 2060 to a fresh NixOS VM. Firefox doesn't crash with nvidia either. I hate this bug.

@IceDBorn
Copy link
Owner

So, it's a NixOS + RADV or AMDVLK specific issue.

@IceDBorn IceDBorn changed the title Firefox crashes if pipewire-screenaudio is active Firefox crashes if pipewire-screenaudio is active on NixOS + AMD GPU Jul 18, 2024
@IceDBorn IceDBorn changed the title Firefox crashes if pipewire-screenaudio is active on NixOS + AMD GPU Firefox crashes if pipewire-screenaudio is active on NixOS with an AMD GPU Jul 18, 2024
@flippette
Copy link
Author

flippette commented Jul 18, 2024

I am using RADV, not sure about AMDVLK.

(well, was)

@IceDBorn
Copy link
Owner

IceDBorn commented Jul 24, 2024

signal-2024-07-24-201245_002

This setup does not crash the tab. I found this by changing the injector script to connect "Noise canceling source" instead of "pipewire-screenaudio", and the stream successfully started, having audio from my microphone. Doing this resulted in the node called "Noise canceling source", which has only one capture port, getting connected to Librewolf. So, the solution would be to replicate what "Noise canceling source" does. Obviously, "pipewire-screenaudio" present on this screenshot does not transmit any sound at all as it does not have any sources available. I transformed "pipewire-screenaudio" to a node with only one capture port, by changing "Audio/Source/Virtual" to "Audio/Source". The pipewire config for spawning Noise canceling source is available here.

@jim3692
Copy link
Collaborator

jim3692 commented Jul 27, 2024

Hello all,

I got it crashing on my older PCs with NixOS Unstable:

@jim3692 jim3692 changed the title Firefox crashes if pipewire-screenaudio is active on NixOS with an AMD GPU Firefox crashes if pipewire-screenaudio is active on NixOS with Mesa GPU drivers Jul 27, 2024
@IceDBorn
Copy link
Owner

We have to try using NVK instead of the proprietary drivers and see if it crashes for nvidia too @jim3692.

@jim3692
Copy link
Collaborator

jim3692 commented Jul 27, 2024

We have to try using NVK instead of the proprietary drivers and see if it crashes for nvidia too @jim3692.

Firefox is also crashing with my RTX 2060 with the NVK driver, even though Firefox is not reporting hardware decoding in the about:support page

EDIT: Disclaimer I don't have any other GPUs to test on 😅

@IceDBorn
Copy link
Owner

@flippette it works for me now on the latest unstable, can you confirm?

@flippette
Copy link
Author

I'm still on Arch for the time being, so I can't say. Sorry 😅

@IceDBorn
Copy link
Owner

@flippette you betrayed the nix cult...

@DADA30000
Copy link

there is also an active firefox issue specific to nix, using firefox-bin fixes discord tab crashing, but idk how to use pipewire-screenaudio with firefox-bin

@IceDBorn
Copy link
Owner

I haven't tested, but, wouldn't installing the firefox package as shown at the example work?

@DADA30000
Copy link

I haven't tested, but, wouldn't installing the firefox package as shown at the example work?

nope, doesn't work like that with firefox-bin unfortunately, just says "native connector is misconfigured"

@IceDBorn
Copy link
Owner

IceDBorn commented Nov 7, 2024

@DADA30000 Does it still crash for you? Because I'm pretty sure that it does not for me. I'll try re-testing tomorrow.

@DADA30000
Copy link

@DADA30000 Does it still crash for you? Because I'm pretty sure that it does not for me. I'll try re-testing tomorrow.

Just updated my flake, rebuilded my system, it still does, it crashes only when you're in a call with someone, and that someone says something, or when you go into voice settings in discord, and do a microphone check

@IceDBorn
Copy link
Owner

IceDBorn commented Nov 8, 2024

@DADA30000 I'll test it out too then.

@DADA30000
Copy link

@DADA30000 I'll test it out too then.

could you maybe do something so that it would work with bin version? Because I think that this issue with firefox on NixOS will take a lot of time to be fixed :D

@IceDBorn
Copy link
Owner

IceDBorn commented Nov 16, 2024

I'm not aware of the steps needed to get it working with the bin package. Maybe you could follow the install instructions for a normal FHS distro. Ex. add the manifest.json on ~/.mozilla/native-messaging-hosts. https://github.com/IceDBorn/pipewire-screenaudio/blob/main/install.sh. You'll just have to change the path of pipewire-screenaudio to the nix store one.

@DADA30000
Copy link

I'm not aware of the steps needed to get it working with the bin package. Maybe you could follow the install instructions for a normal FHS distro. Ex. add the manifest.json on ~/.mozilla/native-messaging-hosts. https://github.com/IceDBorn/pipewire-screenaudio/blob/main/install.sh. You'll just have to change the path of pipewire-screenaudio to the nix store one.

hmm, ok, I will try that, thanks!

@DADA30000
Copy link

I'm not aware of the steps needed to get it working with the bin package. Maybe you could follow the install instructions for a normal FHS distro. Ex. add the manifest.json on ~/.mozilla/native-messaging-hosts. https://github.com/IceDBorn/pipewire-screenaudio/blob/main/install.sh. You'll just have to change the path of pipewire-screenaudio to the nix store one.

that worked! Idk how I haven't thought of that, thanks again!

@IceDBorn
Copy link
Owner

So, issue's fixed using the bin I guess. We just have to add a home manager module.

@DADA30000
Copy link

So, issue's fixed using the bin I guess. We just have to add a home manager module.

oh wait, there is another problem, the only option that I can select in audio sources are virtual surround sink (it's not my main output) and audio from various tabs with audio playing

@DADA30000
Copy link

hmm, I will check non-bin version

@DADA30000
Copy link

Oh, sorry. it's the same on non-bin version, unrelated to this issue

@DADA30000
Copy link

@IceDBorn you know how to fix a problem where 'All Desktop Audio" is not listed?

@IceDBorn
Copy link
Owner

All desktop audio is currently broken. Will have to push a fix.

@DADA30000
Copy link

All desktop audio is currently broken. Will have to push a fix.

oh, ok :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants