Tag Archives: volume control

Hardware vs. Software Volume Control

Some users asked why the HiFiBerry DAC does not support volume control. It is true that the card itself does not come with the volume control widget that can be used by “amixer”. However, most music playback software has its own volume control. How does this work? Basically, the incoming audio samples will be scaled by dividing them by a given value. Dividing by 2 gives an output voltage reduction of 6 dB.

The following picture shows what happens. At the left side is the original, unscaled signal and on the right side a signal that has been reduced by factor 3 (which is roughly a 9db voltage reduction).

sin-fullpfeil200sin-half

With volume control in the playback software, the software will do this scaling and feed the data on the right side to the DAC.

But many people tell me, that is bad! Why is it bad? Because you will lose some resolution. Reducing the volume by 50% means that you will lose 1 bit. The resulting resolution will be only 23 bits now. If you decrease the volume further, you will lose more bits of resolution.

Is it really that bad? Remember, that most music that is available today is still recorded with 44.1kHz and 16bit. That means you can “lose” 8 bit with volume control on the DAC without really loosing anything from your music.

There is another downside of digital volume control: signal-to-noise ratio will decrease. That might be an issue in some areas. But many modern DACs have the noise floor at -110dB or even lower. If this increases to e.g. -90dB it is still a good value.

But some DACs have a “hardware” volume control. Having a mixer control in Linux means, that your software does not have to scale down the samples. The DAC will reduce the output volume. But how does it do this? Just have a look at the datasheets of the chips used on these sound cards. You will notice, that almost all chips with integrated volume control also use digital volume control, that means reduce the volume by dividing the digital data by some number.  This is not better than doing it purely in software.

Summary: Software volume control might have an impact on the audible performance, but with modern 24bit DACs, it often works quite well. Not every “hardware” volume control is really hardware. In many cases, it means that the software scaling is done inside a chip, but works exactly like a software volume control.

QuadVol part list online

quadvol-acryl-squareWe’ve updated the QuadVol page. Now, the part list is online. For German customers, Reichelt Elektronik is usually a good source for standard components. However, both ICs needed for this project are not available at Reichelt. The volume control IC is often available on eBay. However, there is a risk that you get a fake IC. Therefore I would recommend to buy the parts from a well-known supplier, like Digikey, Mouse or Farnell.

Quad Volume Control PCB now available in our shop

QuadVol 1.1Finally, the Quad volume control has passed the final tests. It is now available in our shop. The documentation will be updated in the next days. There are some minor differences from our prototype:

  • Control connection can be a 4- or 5- pin molex connector or a 2×3 or 2×5 pin connector.
  • The control connection now has a common anode connection. With this connection you need only 4 cables for the connection of a microcontroller board and this circuit. The common anode will be connected to +5V/+3.3V (depending on the voltage of your microcontroller board).
  • With the new common anode, the signals will not be inverted anymore.
  • The audio connectors were moved a bit.

Note that most documentation on our site still show the old version. This will be corrected in the next days. Also expect more pictures of the finished circuit in a nice acrylic case!

QuadVol controller

6a00d8341c767353ef016762f7c808970b-800wiWe have uploaded our code to control the QuadVol circuit with an Arduino to GitHub. This version displays the volume on a 16×2 LCD display. The volume offset for each channel can be set independently. It supports IR remotes now, but support for pushbuttons and rotary sensors will follow soon.

Feel free to fork and modify the code if you like.

A first look on the 4 channel volume control

quadvol-finishedThis 4 channel volume control is based on the Burr-Brown PGA 4311. The input is buffered by a quad opamp. The module needs a +/-5V power supply. Digital input is fully isolated by optocouplers.

The circuit can be controlled from any microcontroller. Examples for Arduino and Raspberry Pi are available.

The module size is 5x5cm, expect more modules in this size in the future.

Subscribe to this site or our Facebook fan page to see more in the next weeks.

Update 25.3.13: Check out the project page for information to this project.