Bug 331582 - Logarithmic volume with ALSA backend! Volume not equal to alsamixer. Broken in 4.10.
Summary: Logarithmic volume with ALSA backend! Volume not equal to alsamixer. Broken i...
Status: REPORTED
Alias: None
Product: kmix
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Christian Esken
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-27 20:33 UTC by Vitaliy Filippov
Modified: 2014-05-14 14:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to use mapped volume (20.26 KB, patch)
2014-02-27 20:33 UTC, Vitaliy Filippov
Details
Incorrect volume regulation example 1 (23.28 KB, image/png)
2014-02-27 20:34 UTC, Vitaliy Filippov
Details
Incorrect volume regulation example 2 (22.61 KB, image/png)
2014-02-27 20:34 UTC, Vitaliy Filippov
Details
Incorrect volume regulation example 3 (24.03 KB, image/png)
2014-02-27 20:34 UTC, Vitaliy Filippov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaliy Filippov 2014-02-27 20:33:13 UTC
Hi!
Starting with 4.10, kmix has incorrect volume regulation for me. I.e. it adjusts the volume linearly, while the correct behaviour is to adjust it logarithmically (in dB...).
So the volume scale is incorrect, very unintuitive and the volume level isn't equal to alsamixer's.
I use plain ALSA. I DON'T use PulseAudio and DON'T want to use it, because PA is a totally useless Lennart creation, wrapper around ALSA. I don't use network streaming, bluetooth etc, I just want to have sound coming from my speakers.
The problem can be solved by applying the attached patch.

Can you please comment - why did it happen? I.e. what's changed in 4.10? Or this is not a KDE issue?

Reproducible: Always
Comment 1 Vitaliy Filippov 2014-02-27 20:33:41 UTC
Created attachment 85347 [details]
Patch to use mapped volume
Comment 2 Vitaliy Filippov 2014-02-27 20:34:01 UTC
Created attachment 85348 [details]
Incorrect volume regulation example 1
Comment 3 Vitaliy Filippov 2014-02-27 20:34:12 UTC
Created attachment 85349 [details]
Incorrect volume regulation example 2
Comment 4 Vitaliy Filippov 2014-02-27 20:34:24 UTC
Created attachment 85350 [details]
Incorrect volume regulation example 3
Comment 5 francescobat 2014-03-31 21:14:19 UTC
I confirm.
I hve the same problem.
Alsamixer -Dhw is not equal with kmix.
If Alsamixer -Dhw mater is 59, kmix is 81 :-(
Bye
Francesco bat
Comment 6 Christian Esken 2014-04-04 13:17:57 UTC
This is not a bug. Changing to type "WISHLIST"

KMix never used the logarithmic / dB values.  dB support was not available in earlier versions, and support was never added. Unless someone volunteers to add support and also maintain it, this wish will likely not come true.

If the  behavior changed, then it is likely a change in your soundcard driver.
Comment 7 Christian Esken 2014-04-04 13:24:51 UTC
Two more comments:
1) "the volume level isn't equal to alsamixer".
 Since when is this (it does not happen to me)? Since years it was always in sync. Do you know what ALSA changed? Did they change their client to use dB values, or can one configure alsamixer to use plain or dB values now?
2) Your patch:
 Thanks for the patch. What I would like to see to have this optional, so you can configure it in the config file or GUI.
Comment 8 Vitaliy Filippov 2014-04-04 20:31:55 UTC
I agree that's strange...

But the single ALSA-related upgrade I had was libasound2 1.0.27.2-1 -> 1.0.27.2-3, happened 2014-01-03... As I remember that was when it broke the first time... And the previous update happened 2013-07-16, 1.0.27.1-2 -> 1.0.27.2-1, and everything was OK...

I've also upgraded the kernel several times... but it also seems unlikely to me that there was some change because it hasn't broken alsamixer...

Maybe there is some non-trivial dependency that caused it to break?..
Comment 9 Vitaliy Filippov 2014-04-04 20:47:15 UTC
(In reply to comment #7)
> Two more comments:
> 1) "the volume level isn't equal to alsamixer".
>  Since when is this (it does not happen to me)? Since years it was always in
> sync. Do you know what ALSA changed? Did they change their client to use dB
> values, or can one configure alsamixer to use plain or dB values now?

It seems this bug only reproduces on my laptop...
Maybe there is some alsa configuration... But I don't know how that configuration can affect kmix and NOT affect alsamixer??? :-/
I don't what ALSA had changed... It seems they changed nothing... :-) and you can't configure alsamixer...

I definitely know alsamixer has db->plain translation code in its source code, and 'man alsamixer' says this:

"""
VOLUME MAPPING
In alsamixer, the volume is mapped to a value that is more natural for a human ear. The mapping is designed so that the position in the interval is proportional to the volume as a human ear would perceive it, i.e. the position is the cubic root of the linear sample multiplication  factor. For controls with a small range (24 dB or less), the mapping is linear in the dB values so that each step has the same size visually. Only for controls without dB information, a linear mapping of the hardware volume register values is used (this is the same  algorithm as used in the old alsamixer).
"""

Don't know what "old alsamixer" is though... And don't know how kmix worked before... :)
Comment 11 Vitaliy Filippov 2014-05-14 14:16:33 UTC
(In reply to comment #9)
> It seems this bug only reproduces on my laptop...

Oh, no, it also reproduces on another machine - at work. Also with direct alsa.