How to fix volume control (ALSA problem)

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
wagalaweia

How to fix volume control (ALSA problem)

Post by wagalaweia »

Hi!
This How To is for those people who have trouble with the gnome volume control:

Problem: whenever I change the volume, it does not affect the speaker's loudness at all - just mute (or volume 0) is recognized, but whenever the volume is at some level above 0, the speaker's seem to have full volume.

Possible reason: the new gnome volume control solely controls the pulseaudio sound driver, while several tools still use the alsa sound driver (for me this was even banshee, vlc, ...). For some PCs the forwarding of the volume change in pulseaudio is not correctly forwarded to alsa: the volume change *is* forwarded to the alsa's 'Master' channel, but this is not correct for some PCs - there it has to be the 'PCM' channel.

Check if you have this problem: open a terminal and run 'alsamixer', which is a text-based volume control for all alsa-channels. Therein, you should at least see the channels 'Master', 'Speaker' and 'PCM'. Playback some music and use the arrow keys to change the alsa volumes directly. You might recognize that the PCM volume is the correct one for your needs, while the Master has no effect. Now change the volume using gnome's volume control: you see a simultaneous change of the 'Master' volume bar in the alsamixer, while PCM is always rised to full power. Thus, the problem is that the gnome volume control should control the PCM channel, while it does control the Master channel.

Solution for this problem: tell pulseaudio to let its master volume not steer the alsa 'Master', but the alsa 'PCM' channel. Open and edit with root rights the following file:

Code: Select all

sudo nano /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common
Therein, you will find the following element:

Code: Select all

[Element PCM]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
Since no 'Master' element is in this file, it seems as if the Master is the preferred slave for the volume control, and although PCM is set to 'merge' (thus, it is another volume slave), it takes not the desired effect. So, just insert the following block before the PCM-block:

Code: Select all

[Element Master]
switch = mute
volume = ignore
Then, the Master channel should be ignored, while the PCM channels gets affected correctly. You have to reboot your PC to let these changes take effect!

Open problem: at my PC, the headphones are steered by the alsa 'Speaker' channel, which is left to maximum volume (however, fortunately my headphones have their own analog volume control). For now, I didn't find a configuration to let multiple alsa volume channels get steered simultaneously, although it should be possible according to the comments in the above file. I think the best configuration would be to let the gnome volume control steer the 'Speaker' and the 'PCM' channel, but I was not able to configure this. The perfect solution would be to fix the 'volume = merge' or 'volume = <number>' attribute for alsa, so that it is possible to build a simultaneously working volume slave group in alsa. Any further help on this is appreciated! Finally, I think the main problem is that alsa does not use its 'Master' channel as it should, namely, as the master volume for all of its playback channels. If alsa would, then this problem would not exist at all.
JBB217

Re: How to fix volume control (ALSA problem)

Post by JBB217 »

Tried this and didn't work. My vol. keeps going down every song on playlist. Very annoying.
tronowski

Re: How to fix volume control (ALSA problem)

Post by tronowski »

Thanks! It solved ALSA issue for me
millusions

Re: How to fix volume control (ALSA problem)

Post by millusions »

wow! a post from 2012 fixed my issue in 2019.
can you imagine?


thank you very much! i run multiple desktops, kde, cinnamon, gnome, pretty much all (still deciding but cinnamon is great) and this was driving me crazy.
wasn't easy to find your answer but it worked perfectly
vicromano007

Re: How to fix volume control (ALSA problem)

Post by vicromano007 »

This needs to be higher in the forum results. This instantly fixed my problem. Thank you thank you thank you!!
User avatar
meleneemil
Level 1
Level 1
Posts: 13
Joined: Fri Mar 27, 2020 6:19 am
Location: Geneva

Re: How to fix volume control (ALSA problem)

Post by meleneemil »

wagalaweia wrote: Thu Jan 12, 2012 4:41 am
This just worked on my X1C7, clean 19.3 installation. Just after applying the latest fixes with the intel driver, do make the sound work ok, and allow external mic to work.
Thanks!

EDIT: FYI for the future, if after this the plugged speakers are too low, remember to go to alsamixer and put the levels to full (100), thus unlocking the potential :)
X1C7 - 20.1 - 5.4
banshee-2007
Level 1
Level 1
Posts: 4
Joined: Thu Sep 18, 2014 1:15 pm

Re: How to fix volume control (ALSA problem)

Post by banshee-2007 »

Hello Everyone!

I have had a problem getting the sound output from Bose Revolve+ SoundLink via USB.

The device I was using was HP Pavilion DV5, with an
Default Sound Card = HDA Intel at 0x9f300000 irq 35
&
LinuxMint 20 XFCE
I have implemented the solution presented in the link below.
Edit /etc/pulse/daemon.conf

Code: Select all

sudo nano /etc/pulse/daemon.conf
& add:

Code: Select all

default-sample-format = s16le
default-sample-rate = 48000
Update
/usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common

Set the volume as:

volume = ignore

Code: Select all

sudo nano /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common

Code: Select all

[Element PCM]
switch = mute
volume = ignore
override-map.1 = all
override-map.2 = all-left,all-right
https://askubuntu.com/questions/1104726 ... t-no-sound
User avatar
terry_dwyer
Level 3
Level 3
Posts: 103
Joined: Sat Nov 07, 2020 2:15 am
Location: West Aus.

Re: How to fix volume control (ALSA problem)

Post by terry_dwyer »

Thank you so much. This has been a problem ever since I installed LM 20.1 with Cinnamon. I'm now on 20.3 My machine is a Dell Inspiron 7591 just for your info.

Your edits to the audio config file were spot on. Again thanks for posting a fix for this issue

Regards,

Terry

I should have pointed out my thanks for my solution go to the OP, wagalaweia
Post Reply

Return to “Tutorials”