Non linear volume in openSUSE

Just wondering why the volume control is not linear. Compared to XP, the volume (loudness) doesn’t increase or decrease linearly when moving the volume slider. All my volume is controlled within the top 30% of the volume slider.

Is this a general Linux / openSUSE thing or is it only my hardware that is doing this?

My understanding is this is linux wide and not specific to openSUSE. ie. openSUSE does not implement any special “multimedia volume” controls but rather relies on generic kmix, alsamixer, etc … that are common to all distributions.

As to whether winXP is more linear, I can’t say, since I don’t use it.

If you believe there is something wrong here, you could write a bug on alsa, or even on openSUSE, as I note an alsa developer also packages the alsa applications for openSUSE. Submitting Bug Reports - openSUSE … so in essence while you are raising the bug report on openSUSE you will get the attention of a Linux alsa developer, who is very good at sending alsa patches upstream to benefit all Linux distributions.

oldcpu wrote:
> suse_tpx60s;2061422 Wrote:
>> All my volume is controlled within the top 30% of the
>> volume slider.
>
> My understanding is this is linux wide and not specific to openSUSE.

i do not know what suse_tpx60s is looking at when he notes the bottom
two thirds of his slider does nothing…and, i don’t know what
(apparently) oldcpu is looking at, and agreeing such is true for all
of linux…

but, i have not noticed that at all here.

i’m using openSUSE 10.3 with KDE3.5.7 on a ASRock K8Upgrade-760GX
motherboard with built in CMedia 9761 6channel AC’97 audio, and when
using the built-in KDE3 “Sound Mixer” named KMix, on the Output tab i
have a slider named PCM (have NO idea what that means) but it smoothly
increases/decreases the volume from nothing to full, using the entire
scale to do so…

true, moving one scale mark in the top third yields a more relative
change than moving one scale mark in the lower third…which means it
is a log, rather than pure linear…but, the bottom two thirds is
not useless…

suggest maybe you need to increase the gain at the speaker amp itself,
if you have that capability…


palladium
Have a lot of fun…

I thought I made that clear.

openSUSE uses generic Linux tools: kmix, alsamixer, alsa … etc … And when openSUSE developers/packagers have fixes, they pass them upstream for all Linux. That i what I am looking at. ok ?

I’m referring to the Kmix volume slider. I have the PCM slider at 80%, any higher and I start to get distortion. If I then slide the master volume slider down I get no volume below ~60% and that is with the sound being fed into my AV amp with gain set correctly. If I listen through the laptop speakers I loose the volume below ~65%.

The strange thing is it I set the master at 100% then slide the PCM slider down the volume decreases in a linear fashion and I can still hear it right down to ~3%.

It seems the master volume isn’t following a linear path which the PCM slider does. I wonder if this is by design or not. The reason I posted this was to find out if it was 1) openSUSE specific - which I now know it’s not and 2) to see if it was perhaps my hardware causing this; and other users with different hardware don’t experience this.

Oldcpu, do you experience the same non linear scale for the volume?

@palladium, so when you adjust your volume do you open the mixer to change the PCM slider or is that set to be the master volume controller on the volume icon on the panel? Did Kmix change much between KDE3.5 and KDE4?

Yes kmix changed quite a bit between kde 3 and 4, for me at least as I noted the slider settings are a little different.

On my laptops, yes. On my desktops, No.

Same on my systems.

Desktop’s (Gigabyte GA-P35-DS3R) ‘Master’ volume slider has smooth volume adjustment.
Laptop’s (Intel GM965) ‘Master’ volume slider has sort of a ‘brake point’, which is nearly in the center.

Before this point it is too quiet. Actually position does not seem to change sound significantly - It is almost the same if set to 40%, 20% or 0% - too quiet, but I can hear it through laptop speaker even at 0%.

After this ‘break point’ volume can be adjusted smoothly as it should be.

And with ‘PCM’ (whatever it is) slider I can adjust sound smoothly.
Hmm… I guess I should set ‘Master channel’ in Kmix from ‘Master’ to ‘PCM’ (which is really odd).

I don’t remember how is it set in Windows Vista (I don’t normally boot it), and whether Vista changes PCM or Master by default, but I can check it.

That’s interesting, so it seems to be related to hardware and in particular laptops.

@Seld, how do you set the master channel from master to pcm in Kmix? I don’t see a setting for that. Is it a code hack?

Also, for me the pcm channel increases the gain so much that anything above 80% induces distortion at any given master volume level? Does that happen on desktops too?

I just checked in XP and there is no PCM channel but all the channels available in XP operate in a linear fashion.

Do you think it would be worth starting a poll to see which configurations have this non linear volume characteristic? I can then use the data to file a bug report.

A difficulty with polls related to Linux audio hardware and associated software is there are so many different configurations. Some mixers with some hardware will have Master volume, PCM volume, and a Speaker Volume. Others will have only Master volume and PCM volume. And a small minority will have the additional surround controls associated with 2.1 or 4.1 or 5.1 … systems.

I’ve noted many laptop’s mixer’s do not have a linear scale, but that may be due to the laptop’s hardware audio codec implementation.

Even with the same hardware, what an openSUSE-10.3 user will see in their KDE3 (or Gnome) mixer compared to an openSUSE-11.1 user in their KDE4 (or Gnome) mixer may be different due to changes made in alsa-1.0.14 (on 10.3) to alsa-1.0.18 (on 11.1).

Still you could create such a poll, but I’m thinking the most you can get out of it is a very general broadbased indication of how many suffer from a non-linearity in their mixer.

Yes I see your point. Too many variables.

I did some looking around and came across this bug report on Ubuntu. The interesting thing is that for humans to hear linear volume changes, the volume control should actually follow a logarithmic scale from an electronic respect.

I also discovered that running alsamixer in a terminal gives different results to the Kmixer. Alsamixer actually works correctly. Try this:
Run alsamixer in a terminal. Open Kmixer so you can see the sliders. Set volume to 100% (use arrow keys). The Kmixer volume should also be 100% now. Now reduce the alsamixer volume controller and you’ll see the Kmixer volume slider follow a different scale. So when alsamixer is at 55%, kmixer is only at 73%, with alsmixer at 20%, kmixer is at 49%, etc.

I don’t know enough about how sound works with all the different sound systems in Linux but it seems Kmixer is not working correctly and judging by that bug report the same appears with Gnome’s volume controller.

I have never tried that. I’ll have to sometime.

That difference may be worth writing a bug report.

I suspect the bug (if written on openSUSE) would be either closed immediately (as it is an upstream kmix characteristic) or the openSUSE packagers would come up with a fix and pass the fix upstream. Given both alsamixer and kmix are opensource, I suppose its possible a software developer who is familiar with the mixers might be able to spot the specific difference in the code between the two mixers wrt control linearity.

I did try that. For me, running KDE 4.3.3 and Kmix 3.5 and alsa-1.0.18-8.12.1, I found when using the arrow keys on alsamixer, Kmix went up or down proportionately. For me, it was linear.

Hmmm my Kmix is at 4.3.3-1.1 otherwise the same as you. Are you checking on a desktop or laptop? The more I’m looking at this the more references I’m finding to this problem but no fixes.

As an experiment I tried installing kamix (another KDE mixer as well as alsamixergui (a gui for alsa mixer). kamix worked as kmix and was not linear while alsamixergui was linear as expected I guess. I didn’t try kmix 3.5 as I didn’t want it to start pulling a whole of kde3.5 dependencies.

I checked mine by bringing Kmix up and going to Help>About
Otherwise rpm says kmix-4.3.3-1.4

ImageShack - Best place for all of your image hosting and image sharing needs](ImageShack - Best place for all of your image hosting and image sharing needs)

> @palladium, so when you adjust your volume do you open the mixer to
> change the PCM slider or is that set to be the master volume controller
> on the volume icon on the panel? Did Kmix change much between KDE3.5 and
> KDE4?

i never use the volume controller on the panel (actually, i don’t
remember ever trying it before…i always use KMix, which i added to a
side panel…and move the PCM slider and turn the on speaker volume
control to get the best sound for the moment…

wow, now i see that the volume controller on the panel is connected
directly to the “Master” slider in KMix, which i have mine set very
low, because it seems to only control the level of background hum,
ranging from none to way too much…

@oldcpu, now i understand your answer…sorry…


palladium
Have a lot of fun…

No worries.

This has thus far been an educational weekend for me, as lwfinger is teaching me a few things about wireless, in helping me to solve a problem of mine: problem: wireless to wlan works - no internet access - openSUSE Forums

I figure as long as I keep learning, as I use my Linux PC for day to day stuff, then all is well :slight_smile:

how do you set the master channel from master to pcm in Kmix? I don’t see a setting for that. Is it a code hack?
No, that is not a hack. Just right click on the speaker icon (in KDE 3 or KDE 4), then ‘Select Master Channel’. Though, it seems, that KDE 3 resets this setting back to ‘Master’. (And by the way Windows Vista on the same laptop does not have Master or PCM - just one slider, which works smoothly.)

Also, for me the pcm channel increases the gain so much that anything above 80% induces distortion at any given master volume level? Does that happen on desktops too?
Hmm, I hardly hear any distortions on desktop (Gigabyte GA-P35-DS3R), but I do on laptop (Intel GM965 - indeed with PCM somewhere above 80 %). But that actually is ‘normal’ behaviour, as I understand.

Try adjusting PCM through alsamixer in your laptop:
You see, then you go above green zone - 74 (it may be another number in your chipset) dB gain goes above 0.00 and the highest possible value 100 corresponds to 3.00 dB gain. Whyle on my desktop system highest possible value of PCM - 100 corresponds to 0.00 dB gain.
The same with ‘Master’ which goes up to 3.00 on Laptop (0.00 corresponds to 97) and up to 0.00 (100) on my desktop.

The interesting thing is that for humans to hear linear volume changes, the volume control should actually follow a logarithmic scale from an electronic respect.
I didn’t knew which scale (curve) it is, so I called it ‘smooth’ (maybe ‘natural’ will suit even better).

I also discovered that running alsamixer in a terminal gives different results to the Kmixer. Alsamixer actually works correctly. Try this:
Run alsamixer in a terminal. Open Kmixer so you can see the sliders. Set volume to 100% (use arrow keys). The Kmixer volume should also be 100% now. Now reduce the alsamixer volume controller and you’ll see the Kmixer volume slider follow a different scale. So when alsamixer is at 55%, kmixer is only at 73%, with alsmixer at 20%, kmixer is at 49%, etc.
Hmm, that appears to be yet another bug. In my two systems Kmix and Alsamixer map to each other well. The only difference is that Alsamixer has 100 steps and Kmix 3 has 64 steps (Kmix 4 does not show number of steps), so 25% equals to 25 steps in Alsamixer and to 16 steps in Kmix.
Nethertheless, ‘Master’ sound volume does not change smoothly (naturally) with Kmix, nor with Alsamixer.

I don’t know enough about how sound works with all the different sound systems in Linux but it seems Kmixer is not working correctly and judging by that bug report the same appears with Gnome’s volume controller.
Yes, if Kmix maps ALSA sound adjustments incorrectly, that is a bug (which is not present in my system). But Ubuntu bug report you mention is another problem - unnatural volume adjustment with ‘Master’ slider (that bug IS present in my system too).

At least that is how I understand the situation.

By the way, in the upper part of Alsamixer you can see version of ALSA, then Card and Chip. So to be sure we are on the same page I will list my systems’ specifications:

Laptop - ALSA v1.0.18 (default openSUSE 11.1 version) - Card: HDA Intel - Chip: Analog Devices AD1981. Kernel: 2.6.31.3-1-default (from openSUSE 11.2 factory repository). This one has that ‘non-smooth’ volume adjustment problem.

Desktop - ALSA v1.0.16 - Card: HDA Intel - Chip: Realtek ALC885 - kernel 2.6.25.20-0.5-default (openSUSE 11.0). This one works smoothly.

I have not actually looked into this linearity issue on our two family laptops for a long time. The last time I looked at the linearity issue, our Dell Studio 1537 laptop was running a milestone release of 11.1 and our Fujitsu-Siemens Amilo 7400M was running openSUSE-10.3 (with KDE3). Both laptops have had their OS updated since then.

I just checked our Dell Laptop, which is running openSUSE-11.1 with KDE-4.3.2. ( kmix-4.3.2-4.2) and alsa-utils-1.0.21-13.4 (which provides alsamixer). Both kmix and alsamixer volume levels move properly together. In addition, I checked the linearity of the volume control in a QUIET room. Note the room had to be quiet in order to hear the very low volume levels coming from the laptop. I have to note the volume control produced what appears to sound as a reasonably linear change, although the very low levels are VERY hard to hear (as what would be expected).

I do not have access to our Fujitsu laptop right now (my wife keeps it at the office) but it does appear based on the Dell that my earlier non-linear experiences with a laptop are not present in the Dell with KDE-4.3.2 and 1.0.21 of alsa (and a Codec: IDT 92HD73C1X5).

> I figure as long as I keep learning, as I use my Linux PC for day to
> day stuff, then all is well :slight_smile:

THAT is the truth…i now remember some guy last week saying
(something like) he now had a new hobby…

he was, i believe mostly complaining that it wasn’t all automatic, as
he thought it should be (i guess)…

heh…nope, lots of learning opportunities when you have access to ALL
the knobs and dials!! (those who use other training wheeled systems
mostly learn how to clean infected systems…boring…)


palladium
Have a lot of fun…