Category Archives: Software

A HiFiBerry installation with button control and LCD display

RPi HiFiBerry 2014 openPieter Kleinjahn has installed a Raspberry Pi, the HiFiBerry DAC, some buttons and a LCD display in one box.

The buttons can be used to control MPD. Distributions like Volumio and RuneAudio are based on MPD, therefore this could be interesting for many readers. Peter has provided the Python script that controls everything. You can download it here: mydisplay-20140409. Note that we provide this “as is” without any support. However, the code is clean and well-documented. Therefore it should be relatively easy to adapt it to your needs.

piCorePlayer supports now the HiFiBerry DAC and Digi

picoreplayerSteen Pedersen has updated his piCorePlayer distribution to support the HiFiBerry Digi. piCorePlayer is an interesting distribution for people who wants to use the Raspberry Pi as a replacement for the discontinued Squeezebox.

We haven’t tested it yet. Feel free to comment and tell us about your experiences.

Experimental XBMC build with digital out of AC3 and DTS over SPDIF

imgresDom Cobley was again working on XBMC and the HiFiBerry Digi. There is now an experimental build that supports AC3 and DTS bitstream output. That means you can now send Dolby Digital and DTS soundtracks to your home theater amplifier over an coax or optical link.

The OpenElec build can be downloaded from here:

Note that this is again a very experimental setup. It needed a hack in the XBMC code. This must be fixed in the ALSA driver. While we will work on this, we can’t say, when we will be able to change this.

Check out this article how to configure it. Note that for the HiFiBerry Digi you need the following module configuration:

cat >/storage/.config/modules-load.d/hifiberry.conf  <<EOF

OpenElec experimental build

imgresMany HiFiBerry DAC users asked us about XBMC support. Today (February 2014), the ALSA sound card support in XBMC is still in an early stage in XBMCv13. For video playback there is a new “dvdplayer” that will replace the current video player in the future.

Dom Cobley from Broadcom has created an experimental OpenElec build that supports the HiFiBerry DAC. This is not an official OpenElec version yet! If it doesn’t work, there is no support. It will have bugs! This build includes a hack that forces output to 16-bit audio, as the 24-bit audio does not work at the moment with OpenElec. This seems to be a bug in the underlying I2S sound subsystem. It is not clear yet, how to fix this. We well work with the developers to find a solution. However, we can’t guarantee this.

  1. Install OpenElec
  2. Get the experimental build from here:OpenELEC-RPi.arm-devel-20140226212939-r17638-g6fc6264.tar
  3. Upload this build to the running OpenElec system via SMB. See
  4. Reboot
  5. ssh to the system (as root, default password is openlec) and create the file /storage/.config/modules-load.d/hifiberry.conf
    You can just copy/paste the following code to your command line. If you want to create the file with an editor of your choice, do not include the first line starting with “cat” and the last “EOF” line!
  6. cat >/storage/.config/modules-load.d/hifiberry.conf  <<EOF
  7. You will also want to create /storage/.xbmc/userdata/advancedsettings.xml:
    cat >/storage/.xbmc/userdata/advancedsettings.xml <<EOF
  8. Reboot and you should get a third option in settings/system/audio output/audio output device (snd_rpi_hihiberry_dac).

firfilterOne of our readers sent me a link to a filter design site: T-Filter. It specialized in the calculation of FIR filters. I had a quick look at it and it looks nice. The filter calculation was very fast. But then I noticed that I was only calculating a filter for 2000 Hz sampling frequency. This is not really a real-world audio calculation. Then I tried 48 kHz sample rate. This also work, but the default passband ripple of 5 db is way too much for HiFi audio applications. Reducing the ripple to 0.5 db often led to empty filter. But the software is still in beta, therefore it may work in the future.

High resolution sound with the Raspberry Pi using I2S

raspberry-piOur HiFiBerry project is still ongoing. The PCB design is almost finalized and we expect the device to be ready in about 4-6 weeks. With HiFiBerry you will get an inexpensive and high-quality sound card for the Raspberry Pi. However, there is one thing it cannot provide: high-resolution sound, that means sampling frequencies above 48kHz are not supported. There are a lot of Pros and Cons for or against higher samples rates than 48kHz. At least when it comes to post processing like equalizing or digital crossovers, higher samples are a good idea.

You could also add an external USB sound card. But we are looking for a real DIY solution ;-) The 2nd revision of the Raspberry Pi provides access to the I2S pins of the processor. You can add an I2S capable ADC or DAC on these pins.

Unfortunately, the Linux kernel of the standard Raspberry Pi  does not support devices connected to the I2S pins. Therefore you need to compile your own kernel. Check out the “Noise is good” blog for more information. Hmm, looks like an interesting project for another Raspberry add-on board. We will have a look into this.

CAD for speaker design (and others)

FreeCAD-logoIn the past I used TurboCAD for loudspeaker designs. Unfortunately my TurboCAD version is extremely old and also does not run on my Mac. Therefore, I was looking for a new CAD software. Sketchup is good for some designs, but has two major problems: It is not designed for the creation of small parts (it is not usable for sub-millimeter resolution) and it does not support boolean operations in 3D (the commercial version does, but not the free version).

After looking at several open source CAD systems I decided to start using FreeCAD. FreeCAD is extremely powerful, it supports even parametric modeling. Unfortunately this also means that you need some time to learn how to use it. FreeCAD is available for Windows, Linux and Mac. Unfortunately, the Mac version is a bit less stable than the Linux and Windows version.

There is another problem for Mac users: You need a third mouse key. MagicPrefs worked well with my Magic Mouse to implement this on MacOS.

Update 16.06.2013: The parametric modeling is extremely powerful if you understand how it works. It makes changes on existing components very easy. Unfortunately the MacOS version of FreeCAD has some stability issues. Therefore save often or use the Linux version in a virtual machine.