Audio components
The Raspberry Pi has two ways to connect digital audio: I2S and USB. This page shows what hardware you can connect to I2S or USB. The Pi 5 has a major upgrade for I2S: it has 8 channels in + 8 channels out; the Pi 4 has 2 in + 2 out.
- The latency via I2S is said to be in the range of milliseconds; via USB it is typically tens of milliseconds. I have not found sources that actually measured this though.
- I2S and S/PDIF only transfer audio data and no extra information such as the sample rate or volume. Both sides of the connection must either be in agreement about the used sample rate or the receiving end must have a detection mechanism. With USB audio the sample rate is communicated.
Raspberry Pi HATs
This is e.g. the HiFiBerry DAC8x:
These are companies I'm aware of that make HATs (plug-on boards for the Raspberry Pi) for various audio applications. This list may be incomplete. They make use of the I2S interface on the Pi's GPIO pins. There are many different HATs available to get audio into and out of the Pi.
Company | Notes |
---|---|
Allo (India/France) | |
Audiophonics (France) | Webshop that also has their own products. |
HiFiBerry (Switzerland) | I'm using the DAC8x for the Pi 5, which has 8 DAC channels. By stacking the ADC8x you will also have 8 ADC channels. |
IAN Canada | |
JustBoom (UK) | It is unclear whether they still exist. Their own webshop is offline. |
Raspberry Pi (UK) | IQaudIO (UK) was acquired by Raspberry in 2020. Those products now carry brand name “Raspberry Pi”. |
Raspiaudio (France) | Offers the only other HAT with 8 input and 8 output channels for the Pi 5 that I know of. |
Suptronics (Hong Kong) |
USB DAC
There are separate DAC boxes that take USB as input. Some typical brands are Topping and Schiit. Ones with more than 2 output channels (i.e. stereo) are relatively rare and can be expensive.
You could use them like this with a Pi:
- You should not use multiple independent USB DACs that don't share their audio/media clock (which is used for the DAC step itself). If you use such as a set-up to play multichannel music (e.g. one DAC for a subwoofer and another for your main speakers), they won't stay in sync. Independent clocks will drift apart over time.
- The Raspberry Pi 2 and 3 have issues with outputting audio to USB. (Source: forum thread). The Pi 4 and 5 should be fine.
Audio interface
Focusrite, M-audio, MOTU, RME and Roland are examples of well-known brands that make audio interfaces. This is e.g. the Focusrite Scarlett Solo:
An audio interface is meant to be connected to a computer via USB. The Raspberry Pi is also a small computer with USB. Connecting them to a Pi gives you options to both get audio into and out of the Pi, all via a single USB connection.
Audio interfaces are typically used as shown below in studios, also small home studios, and to connect studio monitors (which are active speaker) to a PC. In this diagram blue means digital audio and red means analog audio.
interface
core]) audio_if_adc([ADC]) audio_if_dac([DAC]):::analog audio_if_analog_in([ ]):::analog audio_if_analog_out([ ]):::analog speakers([fa:fa-volume-high studio
monitors]):::analog headphone([fa:fa-volume-high headphone]):::analog %% arrows pc <-- USB --> audio_if audio_if_analog_out --> speakers audio_if_analog_out --> headphone synth --> audio_if_analog_in mic --> audio_if_analog_in subgraph subgraph_audio_if ["audio interface"] audio_if_analog_in --> audio_if_adc --> audio_if --> audio_if_dac --> audio_if_analog_out audio_if_analog_in -- direct
monitoring --> audio_if_analog_out end
Audio interfaces have analog inputs for microphones and musical instruments, analog outputs for headphones and speakers and the USB connection for the PC has bidirectional audio. Some have additional interfaces such a digital audio inputs and outputs. Audio can be streamed between any of its connections.
TOSLINK to USB converter
There are two connection variants for S/PDIF: TOSLINK (an optical cable) and coax. My Samsung TV has TOSLINK as digital audio output (besides HDMI), which I wanted to connect to my Raspberry Pi:
These are some affordable TOSLINK⇒USB converters. I found most through this forum thread on audiosciencereview.com. The prices are as of April 2025.
Company | Product | Conversion | Notes |
---|---|---|---|
Cubilux (China) | multiple ($20-35) | depends on model, all TOSLINK | Cmedia chip, support only stereo |
ESI (Germany) | U24 XL (€80) | coax/TOSLINK⇔USB, max 24 bit/48kHz | From forum: mixed results, some problems. |
Hifime (UK) | S2 Digi (€54) | TOSLINK⇔USB, 16/24/32 bit, max 192kHz | I have this one. Works very well for TOSLINK⇒USB. Did not get simultaneous USB⇒TOSLINK to work well (audio drop-outs). |
Hifime (UK) | UR23 (€33) | TOSLINK⇒USB, 16/24 bit, max 96kHz | Mixed results in forum |
Leagy (China) | USB 7.1 External Sound Card (€28) | TOSLINK⇒USB, 16 bit, max 48kHz; USB⇒TOSLINK, 16 bit, max 96kHz | Cmedia CM6206 chip. I have this one. In my set-up it frequently causes loud white noise.1) |
Leagy (China) | 6 Channel External Sound Card... (€17) | TOSLINK⇔USB, max 48kHz | |
miniDSP (Hong Kong) | MCHStreamer Kit ($105) | coax/TOSLINK⇔USB, max 24 bit/192kHz | |
StarTech.com (Canada) | ICUSBAUDIO2D ($43) | TOSLINK⇒/⇐USB, max 24 bit/96kHz | Cmedia CM6533 chip, DTS/AC3 passthrough |
Terratec (Germany) | AUREON 7.1 USB (€40) | TOSLINK⇔USB, 16 bit, max 48kHz | Cmedia CM6206 chip, DTS/AC3 passthrough |
Terratec (Germany) | AUREON XFIRE8.0 HD (€100) | TOSLINK⇔USB, max 24 bit/192kHz |
These seem unusable, because they don't actually route TOSLINK to USB:
Company | Product | Notes |
---|---|---|
Delock (Germany) | USB Sound Box 7.1 | Looks just like StarTech.com product. |
LogiLink (Germany) | USB Sound Box Dolby 7.1 | Looks just like StarTech.com product. |
StarTech.com (Canada) | ICUSBAUDIO7D | CM6206 chipset. Not usable. Documentation says TOSLINK doesn't go to USB. |
Other options are:
- A HAT with TOSLINK input
- An audio interfaces with S/PDIF input. These are relatively rare, probably because it's not typically needed in a studio.
- Some Sound Blaster products have/had a TOSLINK input
- The TV must be set to output stereo uncompressed/PCM audio to S/PDIF. It is possible to send multichannel audio over S/PDIF, but that is compressed/encoded (primarily in DTS or AC3 format). I have not investigated for all converters above whether they can pass compressed audio (as a bitstream), nor have I looked into how to decode that on the Raspberry Pi.
- Most TVs will always output audio with sample rate 48 kHz, which simplifies things.
- Many S/PDIF converters misbehave when the input signal stops or the sample rate changes. (Source: forum thread.) The good news is that there are no issues when capturing TOSLINK from a TV with the Hifime S2 Digi (at least not in my set-up).
- You may need to change the volume and/or the capture input selection for the device using alsamixer before you get any audio input. See also: page about ALSA.