HiFiBerry – A class(y) D ampli for Raspberry PI part 1

HiFiBerry amplificatore classe D

You are a computer science geek. You enjoy the creation of electronic gadgets. And you love to listen to good music. Sadly, it’s quite hard to enjoy these three passions at the same time. As you probably know, audio playback on digital systems does not guarantee the same sound quality of analogic devices.

A bit of history

The digital audio playback has been quality-limited by many factors. A HiFi digital audio file is weighty, hard to share, requires space and resources to be processed. MP3 codecs have been invented for such reasons. They allow the audio to be compressed, to make it more commercially profitable.

But the MP3 format is lossy, loses definition as the compression grows up. And the definition is everything in HiFi. This is why we got in time to the FLAC (Free Lossless Audio Codec) format, that allows a digital audio file to be compressed with no loss of detail (even if using a different, lower compression ratios than with the MP3 codec).

But even the FLAC codec had its own issues, related to the fidelity of the audio playback. As a matter of fact, the digital process tends to “sample” a system that is intrinsically continuous (the audio wave) in discrete elements to play back in sequence. Such operation is susceptible of unavoidable “roundings”, or interpolations, that in time will smooth the spikes and the quickest transients present on the analog audio tracks. Even this source of distorsion might be sweetened taking the sampling frequence from 44.100/48.000 kHz to 192 kHz.

But a last, stubborn variable remains to prevent the success of the operation, a last requirement to buy off the audio purists, those who will never consider the digital audio playback as HiFi.

Mr. jitter, the stranger…

With jitter we intend the phenomenon related to the clock anomalies on a digital signal. Suppose that our computer generates a signal (clock) to direct a series of operations for coding and decoding. Since the signal transmission is not instant, a minimum temporal delta will elapse between the clock impulse and the acknowledgement of the same by that part of the system that it drives.  The image shows how the propagation delay sums up to the propagation time of the signal itself, thus producing a phase displacement on the digital conversion.

HiFiBerry Raspberry PI jitter

The Pc integrates many different interfaces to transfer the audio files to the DAC of a streaming audio machine. The most common interface for portable devices is with no doubts the USB (universal serial bus). The USB 2.0 standard interface implemented in today’s PC has an extreme specific value of jitter that compromises the quality of sound, taking it to a unacceptable level.

DAC, digital-to-analog converter

The high-performance digital-analogic audio converters usually require a very precise sampling master clock to avoid the degradation of the audio quality. Such clock impulses often come from quartz oscillators, producing a jitter less than 100 ps (picoseconds, o billionths of second). In some systems the oversampling audio frequency is not a “convenient” fraction of the reference frequency of the quartz oscillator. Therefore, if you want a HiFi digital audio playback, it becomes necessary to have a very precise DAC.

HiFi and Raspberry PI

The Raspberry PI is a rather “skinny” SBC from the audio point of view. The system as a jack socket, quite useful when you need to playback sound effects or talk. However, when you desire to acquaint a better audio production, you should add a USB audio board to improve quality and level of the sound. The audio is in fact generated on the PI through a PWM (pulse-width modulation) output, a technique to obtain a result similar to the analogic but using digital systems.

HiFiBerry Raspberry PI PWM

It is clear that such system is scarce in resolution, and consequently susceptible to the jitter phenomena seen before. Of course, this does not imply that we can’t use our Raspy to playback HiFi audio. The problem is to find a high quality DAC to interface the PI.

The HiFiBerry production: DAC+, DIGI+, AMP+

The HiFiBerry website shows three different solutions to the issue of audio reproduction with HiFi DACs and amplifiers on Raspberry PI. Let’s take a look.

The HiFiBerry DAC/DAC+ is a high-resolution digital-to-analog converter for the Raspberry Pi. It’s available for every Raspberry Pi Model—just pick the right board that matches the motherboard you want to use.

HiFiBerry Raspberry PI DAC

  • Directly powered from the Raspberry Pi—no additional power supply
  • Ultra-low-noise voltage regulator for optimal audio performance
  • Available with different output connectors: RCA or 3.5mm phone jack (DAC+ Light and Pro only available with RCA jacks)

For HiFiBerry DAC/ DAC+ standard and DAC+ pro:

  • Dedicated 192kHz/24bit high-quality Burr-Brown DAC for best sound quality (ESS instead of Burr-Brown on DAC+ Light)
  • Hardware volume control—you can control the output volume using “alsamixer” or any application that supports ALSA mixer controls (not available on DAC+ Light)

DAC+ Light19.90$
DAC+ Standard24.90$Volume control, jack
DAC+ Pro34.90$XLR connector
DAC+ Zero11.90$PI Zero form factor

The HiFiBerry Digi+ family contains high-quality S/PDIF output boards with the following characteristics:

HiFiBerry PI DIGI

  • Dedicated S/PDIF interface chip supports up to 192kHz/24bit resolution
  • Optical (Toslink) and electrical outputs
  • Bit-perfect output—audio data stream will not be modified in any way
  • Connects directly to the Raspberry Pi—no additional cables needed
  • Directly powered from the Raspberry Pi—no additional power supply
  • Optional: high-bandwidth output transformer provides full galvanic isolation of the electrical output (not in the standard version)
  • Integrated EEPROM for automatic configuration
  • Comes with all components required to mount it (we include fitting spacers to fix the board onto the Raspberry Pi)

DIGI+ Standard22.90$HAT compliant
DIGI+ Transformer29.90$Galvanic isolation
DIGI+ Pro34.90$Dual low-jitter oscillator, BNC connectors

The HiFiBerry Amp+ is a high-quality, highly efficient Class-D power amplifier for the Raspberry Pi. Mount it onto the Raspberry Pi and you have a stereo audio system. You only have to connect your loudspeakers. It’s the ideal building block for multi-room audio installations.

HiFiBerry AMP+

  • Up to 25W output power
  • Capable of driving 4 Ohm speakers (also works with higher impedance speakers)
  • Fully controllable from the Raspberry Pi
  • 44.1kHz and 48kHz sample rates
  • Digital-analog conversion included—no need for external DACs or sound cards
  • Fully digital sound path for optimal audio performance
  • Connects directly to the Raspberry Pi—no additional cables needed
  • Only one 12-18V external power supply needed for both AMP and the Raspberry Pi—no need for USB power supply anymore
  • Comes as a pre-fabricated kit—no soldering needed

Raspberry Pi compatibility: The Amp+ works with all Raspberry Pi models with the 40-pin GPIO connector.

AMP+45.90$Sells alone or in bundle with either Raspberry PI 3 or 4, case, PSU, SD card, remote control.

How does it work?

Unfortunately, space and time don’t allow us to add the results of a thorough test we did on the amplifier. But the sample of the audio board HiFiBerry AMP+ is still there, on our laboratory, close to the Raspberry PI. We will talk about it in a next article. Showing the installation and configuration steps, and giving an objective evaluation of the sound characteristics of the amplifier.

Keep following us!

Definire ciò che si è non risulta mai semplice o intuitivo, in specie quando nella vita si cerca costantemente di migliorarsi, di crescere tanto professionalmente quanto emotivamente. Lavoro per contribuire al mutamento dei settori cardine della computer science e per offrire sintesi ragionate e consulenza ad aziende e pubblicazioni ICT, ma anche perche’ ciò che riesco a portare a termine mi dà soddisfazione, piacere. Così come mi piace suonare (sax, tastiere, chitarra), cantare, scrivere (ho pubblicato 350 articoli scientfici e 3 libri sinora, ma non ho concluso ciò che ho da dire), leggere, Adoro la matematica, la logica, la filosofia, la scienza e la tecnologia, ed inseguo quel concetto di homo novus rinascimentale, cercando di completare quelle sezioni della mia vita che ancora appaiono poco ricche.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.