I have a laptop on Ubuntu 18.04 and when I want to do anything like play music on Firefox or even Discord, I hear absolutely no sound and it randomly freezes for more than 10 seconds on both apps. But audio works for the system and Ubuntu's video player.
Actually, the freezes aren't so annoying but the sound issue is really bothering.
When I run Pulse-Audio volume Control, it shows a windows on a white background saying:Establishing connection to PulseAudio. Please wait...
But in reality it does nothing.
And Ubuntu's audio options doesn't show any sound device!
When I try to play a .ogg file, it doesn't play and the console displays two warnings:
Media resource [...] could not be decoded. [...]
Media resource [...] could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b)
Details: OnMediaSinkAudioError
And when I open Ubuntu's logs, I get some similar errors everywhere:
[pulseaudio] pid.c: Daemon already running.
[pulseaudio] main.c: User-configured server at {...}unix:/run/user/1000/pulse/native, which appears to be local. Probing deeper.
[Child 11097, MediaDecoderStateMachine #1] WARNING: Decoder=7f31e8ef8400 Decode error: NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b) - OnMediaSinkAudioError: file /build/firefox-clezVp/firefox-70.0.1+build1/dom/media/MediaDecoderStateMachine.cpp, line 3305
[Child 11097, MediaDecoderStateMachine #1] WARNING: Decoder=7f31e8ef8400 [OnMediaSinkAudioError]: file /build/firefox-clezVp/firefox-70.0.1+build1/dom/media/MediaDecoderStateMachine.cpp, line 3636
[Child 11097, MediaDecoderStateMachine #1] WARNING: 7f31e7fd8600 OpenCubeb() failed to init cubeb: file /build/firefox-clezVp/firefox-70.0.1+build1/dom/media/AudioStream.cpp, line 305
[Child 11097, MediaDecoderStateMachine #1] WARNING: 7f31e7fd8600 OpenCubeb() failed to init cubeb: file /build/firefox-clezVp/firefox-70.0.1+build1/dom/media/AudioStream.cpp, line 305
Looks like something's wrong with Firefox's media decoder script and Pulse-Audio daemon.
Here is what I tried:
- Restarting Firefox (didn't worked)
- Rebooting my computer (didn't worked)
- Re-installing Firefox (worked but rebooting made it not working)
Also I don't want to re-install everytime I reboot (since it would be everyday)
Finally, I recently found which it affects also Discord, it means that Firefox may not be the culprit but Pulse-Audio's daemon. With Discord, it makes hundreds of errors in the logs:
AVC apparmor="DENIED" operation="open" profile="snap.gnome-system-monitor.gnome-system-monitor" name="/run/systemd/sessions/2" pid=5368 comm="gnome-system-mo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
I tried nothing yet for Discord.
It's strange because I already had sound working well good but there I've no sound at all, not even from a wrong device.