Pausing/seeking on youtube causes volume drop
EasyEffects Version
7.1.3
What package are you using?
NixOS
Distribution
Nixos + GNOME
Describe the bug
When I seek, switch to playing another video, or pause the video, the volume drops to less than 100% in easy effects. If I adjust the volume slider, I see the volume in easy effects change, but it stops short of 100% often around 35-60%. Set volume to 100% on youtube -> volume is not 100% on easy effects.
Between these two things, volume is frequently being lowered. It's pretty annoying.
It seems like each video has an associated volume that it goes back to. One might be 37%, another might be 58%, etc.
Expected Behavior
Since they are linked, I expect adjusting youtube volume to 100% to set easyeffects volume to 100%. Switching between videos or seeking forward/back should also not change the easyeffects volume away from 100%.
Debug Log
No response
Additional Information
I only encounter this on GNOME+wayland. I also use easyeffects with sway and do not see it
If I adjust the volume slider, I see the volume in easy effects change
Do you hear the volume change or just see our virtual sink volume slider in a different position? Unless you force PipeWire to behave in a different way virtual sink volume and mute controls do not do anything because PipeWire disables them. The only reason these controls are visible in a default configuration is because the current audio managers are written for Pulseaudio where the possibility of disabled controls do not exist.
That being said our virtual sink should not be set as the system default #1836. This combined with what I said above make it unnecessary to think about its volume level. The sink is passing through the levels as they are.
It seems like each video has an associated volume that it goes back to. One might be 37%, another might be 58%, etc.
WirePlumber should be the one responsible for restoring the volume levels if I am not mistaken.
actually, i have experienced this exact behaviour before. It happens regardless of the browser used. Apparently, websites have control of the output gain of their audio, and youtube uses a hidden gain multiplier to do peak volume equalisation; so that every video has roughly the same volume.
So, 100% gain in youtube is actually 100% * (video-specific gain multiplier, 0 < x < 1). Therefore it is possible to set the gain higher than youtube allows externally, but when adjusted from youtube, the max gain is often limited.
Basically, this is a youtube quirk, and the technically correct solution is to either a) do nothing and just only use youtube's gain control, or b) youtube switches to a more transparent method of automatic volume levelling.
Do you hear the volume change or just see our virtual sink volume slider in a different position?
Both. There is a very noticeable volume drop if I seek forward or backward.
Unless you force PipeWire to behave in a different way virtual sink volume and mute controls do not do anything because PipeWire disables them.
I don't think I've touched any settings like this. Maybe GNOME configures things automatically?
So, 100% gain in youtube is actually 100% * (video-specific gain multiplier, 0 < x < 1). Therefore it is possible to set the gain higher than youtube allows externally, but when adjusted from youtube, the max gain is often limited.
I just checked, this is definitely the root cause. Volume % video keeps going to is the normalized volume displayed in youtube's "stats for nerds"
I don't think I've touched any settings like this. Maybe GNOME configures things automatically?
Unlikely considering its audio manager was not ported to PipeWire and still uses Pulseaudio calls.
Rereading this thread, are we sure this only happens on GNOME? Since Youtube is the root cause, it would make more sense if this happened on every setup, assuming the web browser implements website's audio gain control the same way.
In fact, IIRC, this happens on X11 + pulseaudio systems as well, for the same reason. I'm afk for a bit, can anyone confirm this on other setups?
I'm afk for a bit, can anyone confirm this on other setups?
I do not remember having ever seen this. But besides the fact I use the autogain plugin all the time I usually keep each player volume at 100% and control only the system volume. So it is totally possible this is a behavior that is present even on Pulseaudio like you said.