For the past few months, I have been working on a project to utilize a Raspberry Pi with CamillaDSP in a standalone, fully-digital DSP system. To this end, I have created an add-on board, also known as a "hat", for the Raspberry Pi that allows fully bidirectional SPDIF <-> I2S communication with the Pi. As an advantage to other designs on the market, it also performs sample rate detection, providing the information to the Pi GPIO, and allows full software control of the SPDIF transceiver IC. No resampling of the incoming/outgoing digital audio is required, and it supports all stereo formats from 44.1kHz to 192kHz as tested.
The DSP capability of a modern Raspberry Pi 4 greatly exceeds that of the ADSP/SHARC implementations available. This should open up significant possibilities for much more complex and accurate DSP.
Please read more about the project on the GitHub page:
GitHub - raptorlightning/I2S-Hat: An SPDIF Hat for the Raspberry Pi 2-X for SPDIF Communication
KiCad files, Gerbers, and code are all available for anyone to use for their own build. This post is targeted for an open discussion about the board and implementation. Please let me know if you have any questions or comments about the information on the Git page, or if there is anything I can clarify further.
The DSP capability of a modern Raspberry Pi 4 greatly exceeds that of the ADSP/SHARC implementations available. This should open up significant possibilities for much more complex and accurate DSP.
Please read more about the project on the GitHub page:
GitHub - raptorlightning/I2S-Hat: An SPDIF Hat for the Raspberry Pi 2-X for SPDIF Communication
KiCad files, Gerbers, and code are all available for anyone to use for their own build. This post is targeted for an open discussion about the board and implementation. Please let me know if you have any questions or comments about the information on the Git page, or if there is anything I can clarify further.

Last edited:
Would it be possible (I mean with reasonable effort) to make a version with more than two output channels? There are SBC:s with 8-channel i2s outputs, those could then be used for things like crossovers by driving several normal stereo dacs on separate spdif outputs.
Henrik, It might be possible using a single stereo input, as long as the SBC has proper support for I2S slaving, and configurable I2S I/O - TDM with external demux may be a possible route? There's not a lot of information on actually implementing this and there's no standards for it. Ian hasn't even attempted this one 😉
If you can find a solution for multichannel I2S output, whether that be TDM or otherwise, it's simply a matter of adding more WM8804's configured to the secondary I2C address and programming them for slave operation off of the main one with their AIF data coming from the other channel pins or demuxed TDM data.
For this project, I wanted to keep some goals in mind:
Of course, there's nothing stopping the use of a USB solution. The miniDSP USBStreamer (code left commented out in the Python file if someone wants to continue down that path) works on a RasPi, and I was using it for original testing of the "PiDSP" concept. It may be possible to use that as a multichannel output device, but all testing was done with the 2ch Stereo firmware.
If you can find a solution for multichannel I2S output, whether that be TDM or otherwise, it's simply a matter of adding more WM8804's configured to the secondary I2C address and programming them for slave operation off of the main one with their AIF data coming from the other channel pins or demuxed TDM data.
For this project, I wanted to keep some goals in mind:
- SPDIF I/O for easy use in most stereo and/or headphone listening setups.
- Keep the form-factor to something which could easily be made a finished project (fits in a commonly available box). The board is pretty full at this point - another 8804 and some circuitry could possibly fit, but the I/O would need to be stacked or have options sacrificed.
- Keep the BOM cost relatively low for people who want to make their own. A Pi4B+uSD+Case+PSU can be had for less than $100 - even lower if you check the used market. The boards cost ~$25 per 5 shipped from JLC, and the hat components are less than $100 shipped from Mouser/DigiKey+Ali for the optical modules (if desired).
Of course, there's nothing stopping the use of a USB solution. The miniDSP USBStreamer (code left commented out in the Python file if someone wants to continue down that path) works on a RasPi, and I was using it for original testing of the "PiDSP" concept. It may be possible to use that as a multichannel output device, but all testing was done with the 2ch Stereo firmware.
Would it be possible (to make a version with more than two output channels?
This would be ideal.
Also bearing in mind AES-EBU is much better then SPDIF if this could/can be an option.
The SBC I looked at (some time ago, don't remember the model unfortunately) had a pretty normal I2S interface with one set of clock lines, but with four data-out-lines instead of one. Should be rather easy to add three more slaved WM8804's then. Would be fun, but in reality I would never manage to find the time to work on something like that. Instead I was hoping that maybe someone else would get inspired 🙂
raptorlightning, thank you for this project.
Do you know whether this I2S hat will work with a Raspberry Pi 5?
Also, KiCad 8.0 provides a prompt to convert the zone fill to a new strategy in the pcb file and to use new symbol libraries in the sch file. I briefly looked at the files after the automatic changes were made and they looked fine to me. But, if you are aware of any specific issues, please let me know.
Thank you!
I ended up being lazy and just used a miniDSP MCHStreamer Kit, which connects to the Pi via USB.@TerryForsythe Were you able to finish this project? I am very interested in making this card.
@TerryForsythe I'm mainly looking to have an SPDIF or AES/EBU input and the same thing comes out of it and for camilladsp to support the change of sampling frequency., I know that it's possible with simple USB cards but the fact of going directly to I2S in the raspberry has a big advantage in terms of latency which suits me in my configuration. By chance do you know a company or site that offers to realize the circuits using the plans?
@twinki I had in the back of my mind to order the PCB online from a custom PCB vendor, ordering the parts, and using my son's reflow oven. But, I did not get beyond that. I was partially holding out to see if the OP could confirm whether it would work with my Pi 5. In the meantime I found the miniDSP unit, confirmed it would work with my Pi 5, and just went with that.
The hat may be your best option.I'm mainly looking to have an SPDIF or AES/EBU input and the same thing comes out of it and for camilladsp to support the change of sampling frequency.
The issue I had with the miniDSP unit is that camilladsp-setrate, which handles the change of sampling frequency, does not work with the miniDSP as an input. It only works with USB gadget mode or ALSA loopback. I ended up getting a streamer with a USB output so that I could use USB gadget mode and get camilladsp-setrate working.
- Home
- Source & Line
- PC Based
- I2S-Hat: A Raspberry Pi Hat for SPDIF <-> I2S Communication and DSP