HiFiBerry software configuration (Linux 3.12)

 

HiFiBerry software configuration (Linux 3.12)

This is an archived documentation. It won't be updated anymore and it might not be accurate anymore.

This is an outdated guide. Linux 3.12 isn’t actively developed anymore. You should upgrade your system to Linux 4.x and use our updated guide.

Upgrade your Linux kernel

Often the Linux distribution does not include the latest kernel drivers. Therefore one of our drivers might be missing. The easiest way is using the standard Raspbian distribution (or other distributions, that are based on it). You only have to update your system to the newest kernel. Login at your raspberry and use the following commands:

sudo rpi-update
sync
sudo reboot

On other distributions you might have to install rpi-update first. Have a look at our Linux kernel update guide.

Configure the drivers

Remove drivers from the blacklist

Remove the following lines from /etc/modprobe.d/raspi-blacklist.conf on Raspbian. If you’re using another distribution, check where it configures module blacklists.

blacklist i2c-bcm2708
blacklist snd-soc-pcm512x
blacklist snd-soc-wm8804

Remove the driver for the onboard sound

Remove the line

snd_bcm2835

from /etc/modules

Configure correct modules

Most likely, the modules are not enabled yet on your system. Add the following lines to the file /etc/modules:

DAC/DAC+ light

snd_soc_bcm2708
bcm2708_dmaengine
snd_soc_pcm5102a
snd_soc_hifiberry_dac

DAC+ standard/pro

snd_soc_bcm2708
bcm2708_dmaengine
snd_soc_pcm512x
snd_soc_hifiberry_dacplus

Digi and Digi+

snd_soc_bcm2708
bcm2708_dmaengine
snd_soc_hifiberry_digi

Amp and Amp+

snd_soc_bcm2708
bcm2708_dmaengine
snd_soc_hifiberry_amp

Configure ALSA

Create /etc/asound.conf with the following content:

pcm.!default  {
 type hw card 0
}
ctl.!default {
 type hw card 0
}

Reboot again now

Test it

Check, if the sound card is enabled with “aplay”:

pi@raspberrypi ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

You can use aplay, to playback a WAV file. Note that aplayer won’t convert files that are in a format that is not natively supported from our drivers. (e.g. mono files or different sample rates). For other file formats (MP3, FLAC, …) We recommend to use mplayer.

sudo apt-get install mplayer

Some users have reported problems with MP3 playback of mplayer. It seems, that the MP3 codec is not installed by default on all systems. We found the FLAC format to be best supported by mplayer.

Depending of the board you’re using it will show another HiFiBerry sound card (DAC,DAC+, Digi or Amp)

Having problems?

Please post your question in our forum.

Last updated: October 25, 2021