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

nixos/pulseaudio: disable flat-volumes by default #54622

Merged

Conversation

worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Jan 26, 2019

Motivation for this change

Some applications are unaware of this feature and can set their volume to 100% on startup harming people ears and possiblly blowing someone's audio setup.

I noticed this in #54594 and by extension epiphany.

Please also note that many other distros have this default for the reason outlined above.

Closes #5632 #54594

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@infinisil
Copy link
Member

I think this warrants a release notes entry mentioning what this effectively changes to volumes.

If I read correctly, flat-volumes = no means that when an application sets its volume, this number gets first scaled by your application-specific volume first. So if you have Firefox on 30%, and the application requests 50%, this will translate to 15% in the end. This in a way sandboxes every application into its own volume range.

flat-volumes = yes however makes this number go unscaled through pulseaudio. So when you have Firefox on 30%, and the application requests 50%, this will actually change your setting from 30% to 50%. If you need to keep your volume low because of your amplifier, this of course could blast your ears when it suddenly jumps to 100%.

Somebody correct me if I'm wrong.

nixos/modules/config/pulseaudio.nix Outdated Show resolved Hide resolved
@worldofpeace
Copy link
Contributor Author

If I read correctly, flat-volumes = no means that when an application sets its volume, this number gets first scaled by your application-specific volume first. So if you have Firefox on 30%, and the application requests 50%, this will translate to 15% in the end. This in a way sandboxes every application into its own volume range.

flat-volumes = yes however makes this number go unscaled through pulseaudio. So when you have Firefox on 30%, and the application requests 50%, this will actually change your setting from 30% to 50%. If you need to keep your volume low because of your amplifier, this of course could blast your ears when it suddenly jumps to 100%.

Disabling flat volumes enables relative volumes, apt to being relative to an absolute master volume.

I think this warrants a release notes entry mentioning what this effectively changes to volumes.

Its effect is that we don't torture people anymore 🤣

See: https://youtu.be/Skl1Gf8RCCw?t=54

I'll write a pretty terse one.

@worldofpeace
Copy link
Contributor Author

For anyone unclear on volume model sitiuation, this comment could be helpful to read.

The motivation for this is that some applications are unaware
of this feature and can set their volume to 100% on startup
harming people ears and possiblly blowing someone's audio
setup.

I noticed this in NixOS#54594 and by extension epiphany[0].

Please also note that many other distros have this default for
the reason outlined above.

Closes NixOS#5632 NixOS#54594

[0]: https://bugzilla.gnome.org/show_bug.cgi?id=675217
@worldofpeace
Copy link
Contributor Author

Did the thing @infinisil.

@worldofpeace
Copy link
Contributor Author

I think I'm going to merge this right away because the conclusion to do this has been already reached several times in other places. So we really don't need comuntity feedback for a solution that's already substantiated.

@worldofpeace worldofpeace merged commit dc923b6 into NixOS:master Jan 27, 2019
@worldofpeace worldofpeace deleted the pulseaudio/default-flat-volume branch March 18, 2019 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants