I upgraded from 18 to Ubuntu 20.04 a few days ago. I listen to music through Google Play Music's website which I load in Firefox. I noticed that now Ubuntu has app specific volumes (cool). Since I stream shows and movies through Firefox I decided to crank the Firefox volume to the max and then fine-tune the volume on the website and with the system's master volume. The problem is that the sound for Firefox keeps resetting. In fact, it seems to reset with every Google Play song. I go from being able to hear my music to hearing silence. Why does this happen and can it be stopped?
For the moment, I'm leaving the Firefox volume to where it defaults and increasing the volume on the website.
Try adding or changing
flat-volumes=no
setting in pulseaudio'sdaemon.conf
:The "daemon.conf" can be found in the following paths:
User definitions:
System definitions:
About flat-volumes:
pulse-daemon.conf(5)
Pulseaudio Arch Wiki
I would like just elaborate more on what's written in the accepted answer.
Before I have changed anything, this was the behavior I have observed:
Overall this can get a little frustrating sometimes, so I was eager to try out the new info.
In
/etc/pulse/daemon.conf
I have found the following line, as is:; flat-volumes = no
Looks like it's commented out. So first, I uncommented it:
flat-volumes = no
Trying out Firefox, I did not seem to notice any difference to the previous behaviour.
Then I changed to:
flat-volumes = yes
After a reboot, there was a difference indeed, but an unwelcome one.
In this case the application's volume level gets tied to the master system volume level.
If the master volume is set to half, then in the gnome-control-center's Sound settings, the Firefox tab's volume will be displayed accordingly, also at half. In the sound settings, as long as I move the Firefox slider to softer than the master, the volume levels can be de-coupled; but if I move the Firefox tab's volume louder, as soon as it reaches the level the master is on, it starts to pull the master volume level with it. So when the Firefox slider reaches 100%, master will also.
(All this time the mp4 video's HTML5 volume control in the Firefox tab might stay at 100%. In other words, the mp4 vid's volume control now seems decoupled from the Firefox tab's, in the sound settings. In a way, I believe, this is what people are after; they are just unaware of the tradeoff.)
Now in a new experiment, I opened a video in Totem (the app now called Videos), and found that Totem's built-in volume slider was about two-thirds. So I pushed it up to 100%, and it took the master system volume level to 100% with it: in other words, I controlled the master system volume level from within the Totem UI (while I could have been unaware of it). Extremely bad idea; any other app emitting a sound at this point, could rip the speakers out (and your eardrums in).
So, I think, if you like your speakers and your eardrums, consider avoiding
flat-volumes = yes
.None of the fixes mentioned here solved this issue for me. I found a temporary workaround by visiting Firefox's
about:config
page and changing themedia.volume_scale
parameter to 3.5, which adjusted Firefox's default volume back to 100% on my system. This value might be something different for your system, so I suggest experimenting till you get it right.Edit:
Changed the value back to 1.0 and everything seems back to normal now.
I had to uncomment
flat-volumes = no
and set the parameter to= yes
. After rebooting the volume doesn't change now.