It is no secret that the sound quality of the onboard sound of the Raspberry Pi is not really good. Last week the Raspberry Pi foundation announced a new model B+ that is improved in some details. One aspect that was pointed out was the sound quality. It should be better with the new model. I was curious, therefore I ordered some new model B+ Raspberry Pis.
What changed on the audio section? According to the Raspberry Pi foundation, there is an additional voltage regulator for the audio output and an additional output driver to drive low-resistance loads like headphones. However it is still using pulse-width modulation (PWM), which has a major impact on sound quality. The output voltage is still very low. I’ve measured less than 0.4Vrms. But let’s see how other performance parameters changed.
The test setup is as follows: The Raspberry Pi is connected to the network with a UTP cable. This reduces noise coupled in from the Ethernet port. Total harmonic distortions + noise (THD+N) is measured by a special HP8903B audio analyzer. This specialized instrument is able to measure THD+N down to 0.002% and allows also to measure the output voltage to test the linearity of the output. The input impedance of the audio analyzer is 100kOhm. The Raspberry Pi is powered by an external linear power supply.
For THD+N measurements the measurement bandwidth is 30kHz, for the frequency response we used 80kHz bandwidth to make sure that the instrument’s filter does not impact the audible frequency range.
On the Raspberry Pi, the volume was set to the maximum volume that works without clipping:
amixer sset "PCM" 95%
Test tones were created using SoX. Note that I’m not sure if SoX itself creates optimal sine waves. Therefore a minor part of the distortions might also com from the sine generator. However they will be are in the range < 0.1%. Also, you should not compare the absolute figures here to other measurements. While the HP8903B audio analyzer is a very good instrument, lots of factors influence the result. At THD+N levels < 0.1%, slight changes in the measurement setup can have huge impact on the results.
The following diagram shows the sum of the total harmonic distortions and noise (THD+N) of the old and the new Raspberry Pi. The lower the values the better the system performs.
What happened here? The new Raspberry Pi performs even worse than the old Model B on frequencies below 1kHz. As the distortions are driven by the frequency is seems that there is much more noise at lower frequencies. Didn’t they say the audio performance was improved by an additional voltage regulator? Yes, but the old Raspberry Pi used a linear voltage regulator to provide the 3.3V to many of the components on the board while the new one uses a switching regulator. Both can perform reasonably well. However switch mode power supplies often show higher noise figures. I will have a look into this in a later article soon.
Why aren’t there data for frequencies above 15kHz? The PWM of the Raspberry Pi is not able to create a signal that is at least similar to a sine wave at these frequencies. Therefore the audio analyzer was not able to determine the base frequency and therefore could not do any measurements. Have a look how a 20kHz sine wave looks on the Raspberry Pi output:
Conclusion: Don’t buy the new Raspberry Pi just to get better onboard sound. You won’t get it. However, there are use cases were the new one is better, e.g. if you need 4 USB ports or low power consumption is important. For high-quality sound you still need an additional DAC like the HiFiBerry DAC+.