Category Archives: Finished

E-MU 0404 distortion levels

For our measurements, we use the E-MU0404 USB sound card. Its DACs and ADCs support samples rates up to 192kHz and up to 24bit precision. But how good is the card really? We did a short loopback test with inputs directly connected to the outputs of the card. Unfortunately only unsymmetrical cables were available.

Setup was the following: Windows ASIO driver, 48kHz sample rate. ARTA was used for measurements. Let’s have a look at the noise and distortion figures:

emu-thd-48The diagram does not show the noise component, because it is almost non-existent. The datasheet states -117dB.  All higher order distortion components (D4+) and D2 are below 0.001%, only D3 is above 0.001% above 1kHz, with a maximum of about 0.003% – very good.

But why didn’t I use 192kHz sampling rate? Most DACs and ADCs have their lowest distortions at the lower sample rates. Does this also happen with the E-MU 0404?


This looks almost as the 48kHz measurements. There is a small glitch, but I’m not sure if it comes from the card or the measurement setup (software?). That means, the card is performing very well at the full range of sampling frequencies – great. Note, that the frequency scale is different – it now goes up to 50kHz.

Changing the output filter characteristics of the HiFiBerry Mini DAC

hifiberry-filter-jumperThe HiFiBerry Mini has a cool feature: you can switch the characteristics of the output filter by software. The DAC chip generates high output frequencies. These have to be filtered to remove all components above the audio bandwidth. There are two parts of this filtering process: a digital filter on the DAC chip itself and a first-order analog filter. You can see the analog filter between the two RCA connectors on the port.

But let’s have a look on the digital filter. It can run in IIR and in FIR mode. There are a lot of discussion, which is better. The good thing here is: you can listen to both and find out be yourself what you like more.

There is a jumper “Filter” on the board. It can be used like this:

  • no jumper – DAC runs in IIR mode (low latency)
  • jumper left – DAC runs in FIR mode (higher latency)
  • jumper right – filter can be controlled by the Raspberry Pi

But how do you control the filter settings from the Raspberry Pi? You just have to control GPIO27 of the Raspberry.


A nice program to control the state of the GPIO ports is the WiringPi toolset.

sudo gpio export 27 out
sudo gpio readall
| wiringPi | GPIO | Phys | Name   | Mode | Value |
|      0   |  17  |  11  | GPIO 0 | IN   | Low   |
|      1   |  18  |  12  | GPIO 1 | IN   | Low   |
|      2   |  27  |  13  | GPIO 2 | OUT  | Low   |
|      3   |  22  |  15  | GPIO 3 | IN   | Low   |
|      4   |  23  |  16  | GPIO 4 | IN   | Low   |
|      5   |  24  |  18  | GPIO 5 | IN   | Low   |
|      6   |  25  |  22  | GPIO 6 | IN   | Low   |
|      7   |   4  |   7  | GPIO 7 | IN   | Low   |
|      8   |   2  |   3  | SDA    | OUT  | Low   |
|      9   |   3  |   5  | SCL    | ALT0 | High  |
|     10   |   8  |  24  | CE0    | ALT0 | High  |
|     11   |   7  |  26  | CE1    | ALT0 | High  |
|     12   |  10  |  19  | MOSI   | ALT0 | Low   |
|     13   |   9  |  21  | MISO   | ALT0 | Low   |
|     14   |  11  |  23  | SCLK   | ALT0 | Low   |
|     15   |  14  |   8  | TxD    | ALT0 | High  |
|     16   |  15  |  10  | RxD    | ALT0 | High  |
|     17   |  28  |   3  | GPIO 8 | IN   | Low   |
|     18   |  29  |   4  | GPIO 9 | IN   | High  |
|     19   |  30  |   5  | GPIO10 | IN   | Low   |
|     20   |  31  |   6  | GPIO11 | IN   | Low   |

You can now toggle the port using

sudo gpio write 2 1 # low latency IIR filter
sudo gpio write 2 0 # normal latency FIR filter

Shell script

If you don’t want to install additional software, you can also use a shell script:

sudo echo "27"  > /sys/class/gpio/export
sudo echo "out" > /sys/class/gpio/gpio27/direction 
sudo echo "1" > /sys/class/gpio/gpio27/value # low latency IIR filter
sudo echo "0" > /sys/class/gpio/gpio27/value # normal latency FIR filter

HiFiBerry Mini – distortion and noise measurements

Here are some noise and distortion measurements of the HiFiBerry Mini DAC. Without the ethernet connected, noise is practically non-existing. But also distortions look good. D2 has the highest level and higher-order noise is decreasing with each order. This is really a nice chip.


At 1kHz we see 0.0037% THD+N (distortions alone only 0.003%). However, the measurement equipment itself (an EMU0404) itself has a THD+N level of 0.002% at this frequency (in- and output together). Therefore the real noise and distortion figure might even be a bit smaller.

We also did tests at other frequencies and they look similar:


Note, that these measurements are a bit flawed, because at higher frequencies there are less harmonics within the measurement frequency range than at lower frequencies. Therefore the distortions go down. Unfortunately I was not able the extract the D2 and D3 levels alone.

There are more good news. The voltage regulation on the board works great. Even with the worst power supply I could find (a Nokia charger), the figures did not change much. THD+N went up from 0.0037% to 0.004% at 1kHz. That means there is no urgent need to upgrade the power supply of your Raspberry Pi.

 Update 1.12.2013: We did some THD+N measurements of our production version. They were even lover than the values show here.

HiFiBerry Mini and RaspyFi – the 192kHz/24bit FLAC solution

hifberry-mini-raspberryToday I did some tests with the HiFiBerry Mini and RaspyFi. I replaced the kernel by the HiFiBerry enabled kernel – and it worked perfectly.  The music was played from a cheap USB-Stick. But the most interesting part was the test with 192kHz/24bit FLAC files. And yes – it works! I think, this is the smallest Raspberry-based setup that is able to play 192kHz FLAC music.

It is also nice to see, that RaspyFi also plays MP3 files in 24bit resolution, which means potentially less distortions.

You can order it now on our HiFiBerry web site.

PCM2906C – frequency response

Today I did some measurement on the HifiBerry USB. The first measurement was the frequency response. Some interesting things happened.

For this basic test I used ARTA. Input and output of the card were directly connected. Therefore the results of these measurements represent the input and the output stage together. If there are any influence between both (e.g. crosstalk), this will have an impact on the measurements.

The frequency response was not very flat. The high frequency starts to roll of at 15kHz and the -3db limit was at about 17kHz – too low for 48kHz sample rate. There are also some glitches at 3kHz and 6kHz. See the frequency response below:


Is the chip really that bad? Or is there a problem with my hardware design? I did the same measurement with a Behringer UCA202. The frequency response was exactly the same. Then I wanted to see what happened to the roll-off if I decrease the sample rate. It should look even worse. But check out, what happens if you use 44.1kHz sample rate:


Much better! The roll-off starts at 19kHz, -3db is above 20kHz. No glitches anymore. What happened here? I guess, that the chip is resampling everything to 44.1kHz. I will contact Texas instruments to find out more about this behavior.