Bug 140707

Summary: kmilo "generic" volume module has annoying rounding problems
Product: kmilo Reporter: Stefan Seyfried <seife>
Component: Generic MM moduleAssignee: Willi Richert <w.richert>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: fix the generic_monitor to use steps that match the hardware

Description Stefan Seyfried 2007-01-27 09:45:09 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    SuSE RPMs
OS:                Linux

If you use kmilo with a standard keyboard with volume keys (many "multimedia
desktops" and many notebook models) in conjunction with a soundcard that has
less than 100 steps for the mixer (my intel_8x0 has 32), then you get hit by
rounding problems:
- pressing "volume up" tries to increase the volume by 10%, but the next
matching value (rounded down) is stored in the mixer hardware
- pressing "volume down" then does subtract 10% from the current value and
stores it, again it is rounded down.

This leads to e.g. 12 steps "up" from 0 to 100% but only 7 steps down.

If you press ctrl-volume up/down, then it should increase or decrease by 1%,
but in fact it never increases because 1% is not enough to step up the hardware
(which only has 32 steps =~ 3% steps).
There is even a FIXME comment in the code for this.

This is easily fixed with the attached patch.
Comment 1 Stefan Seyfried 2007-01-27 09:47:08 UTC
Created attachment 19436 [details]
fix the generic_monitor to use steps that match the hardware

This patch applies to the openSUSE 3.5.5 package (and still seems to apply
against 3.5.6) and fixes the problem for me.
Comment 2 Dirk Mueller 2007-01-29 13:29:49 UTC
it is already committed and should be in 3.5.6