Tweaking audio in Linux

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
4,408
Reaction score
4,601
Credits
41,638
I have mentioned in a couple of other posts that I'm usually not a fan of the onboard audio on most motherboards these days.
But for the purpose of this article, that doesn't matter too much. No matter what audio setup you have, hopefully this article will
help.

First, if you do have multiple audio sources in your computer, you need to pick the correct one.

1705257962139.png


For most people it will usually be two choices. The on-board audio chip on your motherboard, or if you have a discrete Video card like an
nVidia geForce or AMD Radeon, you can also use that as audio output. The quality from the HDMI output will be much better than your on-board sound chip. However the problem is, how do you connect HDMI output to a speaker. If your monitor has built-in speakers then it's no problem. For everyone else, you'll have to buy something like a television sound bar to connect your HDMI audio output to. Make sure it supports something called HDMI ARC. Most, but not all, do.

For nerds like me, I use neither, I have a sound card.
Once you've picked the correct sound source. It's a good idea to test your speakers.

1705258572065.png


In this case, because I chose 5.1 audio output, it's showing 5 speakers. For most people you'll only see left and right.
You can click on the "test" button for each speaker to make sure they are working. This is a good place to start, because if it
isn't working here, it won't work in any of your applications such as music players.
Once this is done, you can check the standard system applications for sound. For example the alsamixer GUI.

1705258776955.png


The standard alsamixer is fine if you only have left and right stereo channels. But if you have 2.1, or 5.1 or 7.1 audio output, you'll
likely want more control, I recommend the QasMixer. However it requires a little setup. By default it uses the on-board audio chip,
so you will have to select the correct audio source again.

1705258909911.png


But once you do that, now the screen will change, and you'll have a lot more options.

1705259011242.png


I'm pretty sure this is based on the CLI version of the alsamixer. If you open up a console and just type "alsamixer" ( without the quotes )
You should see something like this.

1705259098559.png


Well, that's not very exciting, all it is is a volume control, well again, that's the default, we have to select the audio source again. Press F6.


1705259177442.png


Now I can choose which audio source I want to use. Use the up and down arrows to pick the one you want, and press enter.

1705259236179.png


Ah ha, now I have a lot more options and control. The nice thing about doing it this way, is that it works even if you don't have a Xwindows GUI Desktop installed. Just use your left and right arrow keys to select the channels, and then use your up and down arrow keys to increase or decrease the volume. Again, for many people, if you just have the standard on board chip, you'll just see the left and right channels.

NOTE: If you get nothing else out of this article, please get this part. Many people who have extra speakers, or use headphones need to know this. Symptom. My main left and right speakers work, but my surround speakers do not, or my headphones do not, or I'm not getting any bass out of my subwoofer. This is pretty common. What can you do to fix it. In the example above, you can see I have my "Bass Red", "Front" and "Surround" channels turned up to about 85 or 86. I personally prefer my "Center" channel to be a little lower. The very first time I ran this,
my bass was set to zero. Also my LFE was set to zero. My headphones didn't work, and my Bass subwoofer was barely audible.
I turned up those two settings, and everything works great.

I'm not exactly sure how the alsamixer and volume control in your GUI work together, but I do know this. I can have my volume control on
desktop GUI turned all the way up to 100% and the volume still isn't very loud. So I go into the alsamixer, and turn up the volume there.
Now when I go back to the GUI volume control everything is quite a bit louder.
 


Just a heads up for The Viewers, Marvin.

I have a Dell Inspiron 5770 laptop. Its function keys are mapped to screen, sound and other functions and do not respond to the Terminal-driven alsamixer.

However by reading

man alsamixer

I was able to determine keyboard shortcuts for a number od the processes you show above.

I expect over time I can work them all out.

Hope this helps and thanks for the article. :)

Wiz
 
I have a Dell Inspiron 5770 laptop. Its function keys are mapped to screen, sound and other functions and do not respond to the Terminal-driven alsamixer.

Very interesting. It works on my Dell XPS. I will have to do a little more research.
 
@dos2unix :-

"Necro-posting", I know, but:-

Thanks for the "heads-up" about qasmixer, Ray! Over a decade with Linux.....and I wasn't even aware this existed.

Ya live & learn. Cheers!

I'm not exactly sure how the alsamixer and volume control in your GUI work together, but I do know this. I can have my volume control on
desktop GUI turned all the way up to 100% and the volume still isn't very loud. So I go into the alsamixer, and turn up the volume there.
Now when I go back to the GUI volume control everything is quite a bit louder.
Heh. THAT is kinda misleading, mate. Next time you go into alsamixer, take a look at those labels. It doesn't use percentages; alsamixer works in dB (decibels, which is a measurement of loudness).

Effectively, if you have alsamixer turned up to what equates to, say, "75%", then your tray volume control is "working" within the range 0-75%. Here, 100% is equivalent to alsamixer's 75%.

Likewise, if alsamixer is set to "40%", the tray will only go up to a maximum 40% of the available full range....

...and so on, and so forth.

~~~~~~~~~~~~~​

Decibels work on a logarithmic scale. I don't pretend to understand logarithms - never have! - but when our veteran developer pizzasgood built Puppy's long-standing default 'Retrovol' tray volume control back in the mid-to-late 'noughties', amongst other things he provided three possible scales to work with:-

  • Linear
  • Logarithmic
  • Exponential

"Linear" is essentially what you described above; pretty quiet, and not much in the way of adjustment. By default, OOTB Puppies come with this enabled, AND set pretty low. This is effectively a 'direct' control, with nothing in the way of software amplification.

"Logarithmic" gives a far greater scale "range", and lets you achieve decent volume levels. Most of us sooner or later end up switching to this one.

"Exponential", mm.....this one, ya gotta be careful with! It is to "Logarithmic" as that scale is to "Linear". With this one, you can achieve insane volume levels with not much movement of the tray control, but you lose the granularity. Each step represents a much larger decibel 'jump'.....and the unwary can blow their speaker's voice coils if they "overcook" this one.

And that's why there's a prominent warning attached to this setting.

(Seems pizzasgood added this last scale for one reason; because at that time, he had a pair of very elderly Compaq lappies with all but non-existent sound......and the "Exponential" scale was the only one that could make audio usable on them).


Mike. ;)
 
Last edited:
Decibels work on a logarithmic scale.

As an aside, from a perspective of loudness at a distance, dB are also impacted by the inverse-square law.

Basically, it grows more and more faint based on your distance from the source (and assuming no reflective surface).

Or, spelled out, every doubling of distance in a free field, the sound level decreases by approximately 6 dB.

This has amused me at multiple points of my life. I spent way too many years as a performing musician, even when I no longer needed the money. The lead person, often called a 'pronotor' but could be just the simple person in charge of the venue, would ask me questions like how many decibles we were putting out or, worse, how many watts we were putting out.

I'd just give them an answer that sounded good. If they really want to know, they can buy a dB reader. The watts we consumed was not a useful measurement of loudness, and figuring out how much we were 'putting out' was entirely pointless.
 
EasyEffects work well too with equalizer APO files you can download for specific speakers or headphones.
 


Follow Linux.org

Members online


Top