Raspberry Pi Pico as S/PDIF Digital Audio Receiver
Explore S/PDIF signals with a Raspberry Pi Pico project. Ideal for audio enthusiasts, this receiver accommodates various sampling frequencies and outputs I2S audio.
Years ago, I had a LaserDisc player that output 2-channel, 44.1 kHz uncompressed digital audio via an RCA coax connector that, just like the one for composite video, had a 75 Ω impedance and voltage that fit within video’s 1 VPP specification. The interfaced available was the S/PDIF (Sony/Philips Digital Interface).
I experimented and was able to modulate the digital audio using a powerful PAL-I VHF video modulator (Ch. 4 / 175–183 MHz), transmit it through the airwaves via a VHF antenna, then receive and demodulate it using a VCR on the other end. There, it could be piped it into a DAC, reproducing that perfect digital stereo audio wirelessly—all using only video equipment for the “broadcasting” job.
I’ve been wanting to investigate and take a closer look at S/PDIF for a while, without having to resort to a whole lot of complex circuitry. Hat tip to Anne Barela at Adafruit for finding this: There’s a simplest-of-simple circuit to explore S/PDIF signals (regardless of whether they come in via coax or optical) on a Raspberry Pi Pico, brought to us by Elehobica on GitHub.
The schematic is quite simple, so the workload comes down to the software that Elehobica wrote for the RP2040.
So, here we have a unique S/PDIF receiver that leverages the Raspberry Pi Pico board and its hardware PIO functionality to process 2-channel audio in 16- or 24-bit formats. It’s ideal for exploring the S/PDIF format. It accommodates a wide range of sampling frequencies, including 44.1 kHz, 48 kHz, 88.2 kHz, 96 kHz, 176.4 kHz, and 192 kHz, and offers a signal-detection function compatible with these frequencies.
Tailored specifically for the Raspberry Pi Pico, the project is compatible with the RP2040 chip. Comprehensive instructions are provided using Pico SDK 1.4.0, and the process is confirmed to work with Developer Command Prompt for VS 2019 and Visual Studio Code on Windows platforms.
Sample applications included in the project enable users to identify sampling frequencies, display S/PDIF frame details, and convert S/PDIF input into I2S 32-bit output.
To access the project files and learn more, visit Elehobica's GitHub repository at: https://github.com/elehobica/pico_spdif_rx.git.
Subscribe
Tag alert: Subscribe to the tag Raspberry Pi and you will receive an e-mail as soon as a new item about it is published on our website! S/PDIF in 2023: On a Raspberry Pi Pico
Although we took a step backward from that kind of uncompressed PCM audio when we switched to DVD (although we gained multichannel sound), MP3, and the like, equipment such as DVD / Blu-ray players and decent media streaming boxes still commonly have S/PDIF outputs.I’ve been wanting to investigate and take a closer look at S/PDIF for a while, without having to resort to a whole lot of complex circuitry. Hat tip to Anne Barela at Adafruit for finding this: There’s a simplest-of-simple circuit to explore S/PDIF signals (regardless of whether they come in via coax or optical) on a Raspberry Pi Pico, brought to us by Elehobica on GitHub.
Conversion to I2S
A bonus extra feature is that there’s also code to convert from S/PDIF to I2S serial audio format, which is intended for transporting audio between ICs and is available on tiny microcontroller-compatible modules. That means you can pump your digital audio through, for example, a tiny DAC (smaller than a US Quarter) initially designed for bigger Raspberry Pi cousins.Tailored specifically for the Raspberry Pi Pico, the project is compatible with the RP2040 chip. Comprehensive instructions are provided using Pico SDK 1.4.0, and the process is confirmed to work with Developer Command Prompt for VS 2019 and Visual Studio Code on Windows platforms.
Sample applications included in the project enable users to identify sampling frequencies, display S/PDIF frame details, and convert S/PDIF input into I2S 32-bit output.
To access the project files and learn more, visit Elehobica's GitHub repository at: https://github.com/elehobica/pico_spdif_rx.git.