Low sound volume in Linux?

Apparently a lot of laptop users are confronted with the issue of very low sound levels – not just in Slackware. Note that this is different from the “sound can not be un-muted” issue I experienced and which I wrote about in a previous article.

If you are among the affected users for whom the sound levels remain too low even when cranking the volume all the way up, there is away around this.

It works by enhancing the ALSA sound system with a sound pre-amplifier and adding that to the available controls. ALSA uses dmix to create the new software volume control. You can then play around with varying percentages of sound amplification. You will have to find an optimum between acceptible sound levels and the possible sound distortion which will be introduced by this pre-amp.

To add the software pre-amp system-wide you need to open the ALSA configuration file “/etc/asound.conf” in an editor (Slackware does not create that file by default, so you may have to edit a new file) and add the following definition to it (note that if you have multiple sound cards and the default is not “card 0” you may have to alter the definition a bit):

pcm.!default {
        type hw
        card 0
}
ctl.!default {
        type hw
        card 0
}
pcm.!default {
        type plug
        slave.pcm “softvol”
}
pcm.softvol {
        type softvol
        slave {
                pcm “dmix”
        }
        control {
                name “Pre-Amp”
                card 0
        }
        min_dB -5.0
        max_dB 20.0
        resolution 6
}

Then, save the file and reboot your computer (you could also try running “/etc/rc.d/rc.alsa restart” but I can not guarantee that that will re-initialize ALSA correctly).

After reboot, you will find an additional control in your mixer (alsamixer or kmix) called “Pre-Amp”. Note that KDE’s mixer does not show all controls by default and you may have to add “Pre-Amp” to the visible controls.

Eric

Addendum:

Note that initially I suggested the use of the block of code you find below. But when I installed Slackware 14 on my new desktop I experiences the same volume level issue. After adding a “pre-amp” I found that ALSA had lost its default device, which caused warning messages every time I logged into KDE and gives programs like aplay and mpg123 the fits. A comment by “d” further down in the article with the above solution worked much better for my desktop machine, so I decided to re-write this article even though I don’t usually do such a thing. I will keep the originally suggested code block below for reference – try it only if the code above does not work for you:

pcm.!default {
      type plug
      slave.pcm "softvol"
  }

  pcm.softvol {
      type softvol
      slave {
          pcm "dmix"
      }
      control {
          name "Pre-Amp"
          card 0
      }
      min_dB -5.0
      max_dB 20.0
      resolution 6
  }

If the Pre-amp control does not appear in your mixer window, you may have to replace the line that says:

type plug

with this line:

type hw

This information was taken from the unofficial ALSA Wiki: http://alsa.opensrc.org/index.php/How_to_use_softvol_to_control_the_master_volume and it was also offered as a solution in this LinuxQuestions.org post on the Slackware forum.

I received a report that the default block of code does not always work. Changing “plug” to “hw” may be necessary with some laptops.

http://www.alsa-project.org/alsalogo.gif