Blog

 

TechTalk: What is software volume control and is it a bad thing?

You may have heard terms such as “software volume control” or “hardware volume control” while configuring your digital equipment. If you read a bit on the Internet you might get the feeling that “software volume control” is not a good thing. But let’s have a look at this.

Definitions

First, let me clarify MY definition of software/hardware volume control.

Software volume control is a method to use the player software (or some other software running on the system) to actively modify a digital audio data stream to decrease (or sometimes increase) the playback volume. Many applications implement this.

Hardware volume control is a volume control that the hardware (e.g. a DSP or a DAC) board provides. The application sends the unmodified data to the devices that handles the volume control internally. An example for this is the tool “alsamixer” used with our DACs or amplifiers. alsamixer just sends a message to the board like “set the volume to 67%”.  Note that this method is different than the volume control on an amplifier, which is an analog method of attenuating (decreasing) the signal being passed from the preamplifier section to the main amplifier section of your receiver, integrated amp or main amplifier.

What’s the problem with volume controls?

There are two things that can happen:

  • If you increase the playback volume, clipping can occur. This means, the output volume is higher than the maximum volume your device can handle. This will create distortion. Especially with a large amount of clipping, you will notice this easily as it just sounds – distorted.
  • Noise. There is noise in any analogue audio device (and even in digital, but that’s a completely different thing). Ideally the noise has a very low volume and you will only hear the music and not the noise. But what happens if you reduce the playback volume? Will the noise also be reduced? That depends. And unfortunately the answer is more complex than “hardware is better than software”.

Signal-to-noise ratio and dynamic range

Modern audio playback hardware often has a signal-to-noise ratio of 100dB or even more (in studio equipment you will often see something in the range of 110 to 125dB). This means if the system can produce a signal that is 100dB louder than the background noise. In a normal living environment it will be very hard to have normal background noises below 30dB. If you try to play back music at 110dB and you don’t live somewhere in the woods kilometers away from other people, you will definitely make your neighbors angry. So a signal-to-noise ratio of 100dB should be more than appropriate – and usually it is.

  • To get an idea about different dB-levels, have a look at this table.
  • If you want to learn a bit more about signal-to-noise ratio and dynamic range (a similar measurement), check out this website.

What happens when reducing the volume?

This depends on how software control is implemented. In “classic” amplifiers the volume control is often implemented with a variable resistor. Turning down the volume often also reduces the noise. With software it is often different. When you just reduce the playback volume in software, the background noise will stay the same. This means, the signal-to-noise ratio will decrease – this isn’t good.

How bad is it?

In many cases it is not as bad as you might think. Vinyl records never reached 100dB signal-to-noise ratio, depending on the quality they where between 60dB and 70dB. Yet, there are still people who prefer Vinyl over digital, so this doesn’t seem to be a big deal. The truth is somewhere in between. Having a good signal-to-noise ratio is usually a good thing, but very few people will be able to use the full dynamic range of their audio equipment.

Measurement setup

Let’s have a look at real-world measurements. We’ll do 2 things. Using one DAC board, we’ll show the impact of the hardware and software volume control.  As our audio analyzer can’t just measure signal-to-noise ration, but THD+N, the numbers don’t show the signal-to-noise ratio, but a measurement that included distortions created by the software and the DAC. The objective is to no look at the absolute numbers, but how they change.

The test setup is as follows: The DAC output is connected to a Audio Precision analyzer that measures distortions and noise in the range of 22Hz-22kHz. With hardware volume control, the volume control of the DAC chip itself is in use. With software volume control, the “softvol” ALSA module is applied with the following configuration:

pcm.softvol {
  type softvol
  slave.pcm "hifiberry"
  control {
    name "Master"
    card 0
  }
  min_dB -90.2
  max_dB 3.0
}

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

Measurement results

Note again, that these measurements do not show signal-to-noise ratio, but total harmonic distortions and noise. The signal-to-noise ratio will be higher than shown here.

HardwareSoftware
Hardware volume control 100%-97dB-97dB
Hardware volume control 50%-98dB-98dB
Hardware volume control 25%-94dB-94dB
Hardware volume control 10%-89dB-88dB

These results might not be what some readers had expected. The numbers are almost exactly the same. So shouldn’t software volume control be worse than hardware volume control? Not really. Many current DAC chips include a volume control feature. However, internally the DAC does not use variable resistors to reduce the volume as in an analog system, but simply internal calculations that modify the the digital data.

You also see that the DAC seems to perform better at 50% than at 100% volume. This difference is very small, but this is a behaviour that is quite normal and many audio circuits (not only digital

Conclusion

There is no simple “hardware volume control is better than software volume control”. While some audio components might perform better when using hardware volume control, many current DACs also control the volume in the digital domain which results in a similar audio performance as controlling the volume in software.

Danielimage-mask
Posted by Daniel on March 23, 2018