2

I have no audio playback or recording in the new snap Firefox on Ubuntu 22.04. Somewhat uniquely, I run pulseaudio in system-wide mode (despite the warnings, long story). When I run snap connection firefox I can see that it is plugged into the audio-playback slot. Still, it won't connect to system-wide pulseaudio and play. Is there any way to connect a snap to system-wide pulseaudio?

I've tried replacing the snap with a apt version of firefox, which worked temporarily, but whenever I update the system it automatically re-installs the snap(!).

EDIT: sounds like it's possible to get ubuntu to keep the apt version during updates, so that's good. But I still want to know if it's possible to use the recommended snap version and also system-wide pulseaudio.

7
  • 3
    you can force the system not to re-install the snap using this answer
    – Esther
    Jul 21, 2022 at 15:18
  • also you might need to add some user to pulse-access group
    – Esther
    Jul 21, 2022 at 15:24
  • 1
    This sounds a bit like an XY problem to me. If system-wide Pulseaudio gives warnings, and causes problems, perhaps it would be better to put Pulseaudio back to running as a normal user and then solve the problem that causes some other way?
    – ArrayBolt3
    Jul 21, 2022 at 17:16
  • @arraybolt3 I've run pulseaudio system mode for many years. Firefox with apt works great with it, as does the rest of my system (another user is logged on in console mode running whole-home audio/snapcast/homeassistant, etc). So I can't just 'go back' to non system-wide PA Jul 21, 2022 at 20:36
  • 1

1 Answer 1

1

The latest snaps in 22.04 use pipewire, not pulseaudio. You can see it by checking /snap/*/current/usr/lib/x86_64-linux-gnu/

Still, it's possible to make pipewire work with the system-wide pulseaudio by using a network interface or a unix socket, which is largely compatible between the two.

For the network interface you'd need to pass PULSE_SERVER server env variable to the firefox snap like this:

echo "export PULSE_SERVER=<server>; /snap/firefox/current/usr/lib/firefox/firefox " | snap run --shell firefox

PULSE_SERVER should be either tcp:<hostname> if your pulseaudio server is listening on a network interface (check /etc/pulse/default.pa for load-module module-native-protocol-tcp) or unix:<pulseaudio socket file>

The variable is set in the shell of the snap, which is then used to start the main process.

1
  • Glorious, thanks. I actually got it working first with your command and then permanently by adding the PULSE_SERVER=hostname.tld to my /etc/environment file. Nov 10, 2022 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .