aleho / gnome-shell-volume-mixer

GNOME Shell Extension allowing separate configuration of PulseAudio devices
https://extensions.gnome.org/extension/858/volume-mixer/
GNU General Public License v2.0
135 stars 32 forks source link

Allow to configure increase/decrease volume amount #13

Closed kparal closed 9 years ago

kparal commented 9 years ago

When I press the volume up or volume down buttons on my keyboard, or when I scroll the mouse wheel up and down on the speaker icon or above the volume slider, the volume increases/decreases by 10%. I find that adjustment to be too large. If I want to make my music, video or a game just a bit louder or quieter, 10% change is too much, and suddenly it is too loud or too quiet. So usually I need to use the mouse cursor, open the user menu, and drag the slider a bit to the right or the left, to adjust the volume in a smaller step. That quickly becomes tiring.

Could you please add a new configuration option that would override the amount of volume adjustment? Instead of 10%, I would configure e.g. 5% or 3% step. I would have to press my buttons or scroll the wheel more, but it would be much easier for me to fine-tune exactly the volume that I want.

Ideally it should affect all parts of gnome-shell - the multimedia keys, scrolling over the speaker icon, and scrolling over the volume slider. (The multimedia keys would be the most important for me).

Thanks in advance!

aleho commented 9 years ago

Oh my…

Yes, I could make that configurable as far as scrolling over sliders is concerned. Incidentally I played with that thought but discarded it for a sad reason: There's no way I can influence behaviour of the multimedia keys.

To be more precise, shell's only responsible for showing the OSD, the actual update is done by gnome-settings-daemon which uses hard-coded values for volume steps – since they removed that corresponding setting (with 3.0 I think). Sadly there's no way I can influence (monkey patch) that through an extension. So, about a year ago I wrote a patch for GSD allowing for configurable volume steps [1].

Now, the real problem here is, excuse my strong wording, some arrogant GNOME developers. I may sound frustrated, but "I can't reproduce your problem" – in response to quite a lot of users giving good reasons why hard-coded volume steps are a bad idea – doesn't seem to me like the right way to solve a problem.

Possible solutions:

Oh, and thank you very much for this bug report. It feels good to know that I haven't gone totally mad so far.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=650371#c42 [2] https://aur.archlinux.org/packages/gnome-settings-daemon-volume-step-patch/

kparal commented 9 years ago

No, you haven't gone mad, this coarse-grained volume adjustment is actually one of my biggest pet peeves in GNOME. Thanks for the background info.

Actually, the reason I asked for this here in this extension first instead of requesting it in gnome bugzilla is because I don't have a good experience in convincing certain gnome developers and designers of features I find important and missing or improperly implemented. But I might try it anyway, we should never lose hope.

For starters, it would be nice if you could provide volume step override at least in gnome-shell (the speaker icon and the volume slider). Better than nothing :)

As for the multimedia keys, here's some brainstorming:

aleho commented 9 years ago

Would it be possible to intercept the key press, act on it and consume it, instead of letting it through to gnome-settings-daemon?

Nope. If keyboard controls are set up to act on media keys the event never reaches the shell. GSD only tells it to show the OSD.

So far I haven't found a way to determine whether the event is triggered by GSD's volume update or e.g. brightness changes. I'm going to investigate this further though (see #14).

…I could rebind those multimedia keys to execute a custom command…

You'd have to disable key-bindings for volume changes (in keyboard settings) and add a custom one triggering a simple script (like pulseaudio-ctl). If you want to show the OSD then there's a D-Bus interface the shell listens to.

kparal commented 9 years ago

In case you're interested, I have requested a change in gnome-shell to decrease the volume step at least for the speaker icon and the volume slider: https://bugzilla.gnome.org/show_bug.cgi?id=742648

aleho commented 9 years ago

Nice! Don't expect too much tough.

Just pushed a few commits. If you're interested, grab it while it's hot. It allows for configurable steps without having to patch GSD.

kparal commented 9 years ago

Great! How did you manage to do it?

You have no installation instructions in README, so I simply removed existing ~/.local/share/gnome-shell/extensions/shell-volume-mixer@derhofbauer.at and copied there the directory from your git checkout. However, the updated extension doesn't seem to work and I see this in the log:

Gjs-Message: JS LOG: Extension "shell-volume-mixer@derhofbauer.at" had error: Schema "org.gnome.shell.extensions.shell-volume-mixer" not found

Do I need to do anything else, which is perhaps automatically done when installing from extensions.gnome.org?

aleho commented 9 years ago

Yes, run "make" in the base directory.

You can also get the release archive which is identical to the version I upload to extensions.

https://github.com/aleho/gnome-shell-volume-mixer/releases/tag/v0.7

kparal commented 9 years ago

That is so great! Works perfectly, amazing! I have configured my step to 2% and I'm extremely happy now :) Thank you.

I have discovered a few tiny issues, I'll report them individually.

kparal commented 9 years ago

As a heads up, in the next version of gnome-shell, the volume step for speaker/volume slider will be 2%, and it should be easier to patch: https://bugzilla.gnome.org/show_bug.cgi?id=742648

Now we need to convince gnome-settings-daemon maintainer to do the same for multimedia keys.

garrett92895 commented 9 years ago

If you don't want to patch your gnome-settings-daemon, I've written a script that manually changes the volume based off of a parameter and then makes a DBus method call to the gnome shell to trigger the volume OSD. If you're interested, check it out here https://github.com/garrett92895/gnome-volume-step-osd. I've used it on GNOME 3.16.

It requires python3 and python-dbus (the python3 version). The script takes two parameters, the first one is "increase" or "decrease" and the second one is the percentage by which you want to alter the volume. For example, "./volume-change.py increase 2".