After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 389996 - Improve Vol up+down in media keys window
Improve Vol up+down in media keys window
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: [obsolete] settings-daemon
unspecified
Other Linux
: Normal major
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 161632 336783 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-12-27 12:02 UTC by Michael Monreal
Modified: 2007-02-14 17:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
vol- + vol+ = vol= (1.52 KB, patch)
2007-02-02 22:46 UTC, Jens Granseuer
committed Details | Review

Description Michael Monreal 2006-12-27 12:02:16 UTC
I got a new cherry keyboard some days ago and tried to assign some special keys using the keyboard shortcuts window. I have two keys, "+" and "-" and I assigned them to do volume up and down. This works fine but I have to press multiple times because teh volume slider only moves one "step" per press.

For example when I have set volume to 100%, to go to aprox. 50% I have to tab "-" around 6 times. To move it back to 100% I even have to tab "+" more than that, around 15 times.

What I would like to have is that I can press "-" and hold it, and have the slider slowly move all the way to 0% as long as I hold the key. For this naturally the slider would have to move not in streps of 10% or what it does now, but 1% steps or something similar.

I tested this with both the old gtk widget as well as the very new composite one, both work the same and should be altered the same way.
Comment 1 Jens Granseuer 2007-02-02 18:04:02 UTC
1) I'm not sure setting the value to 1% is a good default. I prefer the larger steps the slider uses now.

2) You can adjust the step in gconf if you like (/apps/gnome_settings_daemon/volume_step). Not sure if this really needs to be exposed.

3) The asymmetry between vol-up and vol-down should certainly be fixed. I'll try to come up with a patch.
Comment 2 Michael Monreal 2007-02-02 19:38:08 UTC
Thanks for answering!

First, I found that the first problem I reported was due to me using the new keyboard in USB mode. If I use the PS/2 adapter it works well, meaning it uses key-repeat.

I didn't know about the gconf key but that's cool with me. I tried 1% and its really to small but perhaps 2% would be ok for me (keep the default, I can set it myself now) BUT: when I set it to less than 5% the "volume up" key does not work anymore! Setting it to 6% makes it work again. Even with these small settings the "vol down" key works. Also I noticed that sometimes after the slider reaches a special value (looks like about 5%) the slider gets stuck and the speaker gets unmuted. I have to use the slider in the software mixer to make the keyboard keys work again...
Comment 3 Jens Granseuer 2007-02-02 19:58:09 UTC
(In reply to comment #2)
> when I set it to less than 5% the "volume up" key does not
> work anymore! Setting it to 6% makes it work again. Even with these small
> settings the "vol down" key works.

That's basically the asymmetry issue as well which is caused by converting between ints and floats internally.

> Also I noticed that sometimes after the
> slider reaches a special value (looks like about 5%) the slider gets stuck and
> the speaker gets unmuted. I have to use the slider in the software mixer to
> make the keyboard keys work again...

Recipe to reproduce?
Comment 4 Michael Monreal 2007-02-02 20:15:12 UTC
Still don't know where exactly the problem is but if I press "down" all the way down to 0% and then tip up/down/up/... a few times it happens. In this case both the media keys window as well as the gnome mixer applet (set to muted!) will show a volume bigger than 0%, while gnome mixer and alsamixer show that it is in fact 0%. Really, really strange...
Comment 5 Jens Granseuer 2007-02-02 21:34:21 UTC
Does that also happen if you set a larger step size? I suspect this could be the rounding issue as well (which looks pretty hard to solve, fwiw).
Comment 6 Michael Monreal 2007-02-02 22:31:34 UTC
I've just reproduced it using step size == 20 but it seems to be harder with bigger step sizes.
Comment 7 Jens Granseuer 2007-02-02 22:46:13 UTC
Created attachment 81795 [details] [review]
vol- + vol+ = vol=

Here's a patch that fixes the asymmetry for me (against current SVN trunk). Does it help you, too?

I haven't been able to hit the other problem you have.
Comment 8 Michael Monreal 2007-02-02 23:58:59 UTC
This does not work for me: I set volume to 100% and volume_step to 5. Now pressing vol- I get: 94, 90, 84, 77, 71, 65... Same with step=10: 100, 90, 81, 71, 61, 52...

But: pressing up gives the same values again, meaning it's now decreasing/increasing at the same rate.
Comment 9 Jens Granseuer 2007-02-03 00:08:35 UTC
It's impossible to make it stick to the exact step size. The abstraction layer works with a volume from 0 - 100 (%), while gstreamer works with integer ranges it gets from the hardware (or maybe ALSA; for my card, I think it was 15 - 69 or something).

So, as far as I am concerned, the patch did work for you. ;-)
Comment 10 Michael Monreal 2007-02-03 00:25:36 UTC
Ok "works" for volume_step > 2.

For volume_step == 1: no movement
For volume_step == 1: movement stops somewhere (eg lets me control between 77 and 65
Comment 11 Jens Granseuer 2007-02-03 11:37:02 UTC
Yeah, same problem. If the mapping from percent to hardware range results in hardware steps < 1.0 you're stuck. Not much that can be done about it (except not setting such small step sizes).

Bastien, any comments?
Comment 12 Bastien Nocera 2007-02-12 14:53:52 UTC
The patch looks good to me.

Whether it doesn't work properly for anything but the default stepping value, given that the problem clearly is the lack of precision from the hardware/driver, isn't something we'd care too much about.
Comment 13 Jens Granseuer 2007-02-14 17:20:53 UTC
Committed.
Comment 14 Jens Granseuer 2007-02-14 17:21:54 UTC
*** Bug 161632 has been marked as a duplicate of this bug. ***
Comment 15 Jens Granseuer 2007-02-14 17:25:40 UTC
*** Bug 336783 has been marked as a duplicate of this bug. ***