Adding Optical Audio to the Raspberry Pi with One Chip

In the home theater space most people would tell you the age of optical audio, known officially as TOSLINK, is over. While at one time they were the standard for surround sound systems, the fiber cables with their glowing red tips have now been largely supplanted by the all-in-one capabilities of HDMI on new TVs and audio receivers. But of course, that doesn’t mean all that TOSLINK-compatible hardware that’s in the field simply disappears.


If you’re looking to connect a Raspberry Pi to the optical port of your AV system, [Nick Sayer] has you covered. His “TOSLINK Transceiver Hat” utilizes a WM8804 chip from Cirrus Logic to go from the Pi’s I2S audio output to S/PDIF. From there the signal goes directly into the TOSLINK input and output modules, which have the appropriate fiber optic hardware and drivers built-in. All you have to do from a software standpoint is enable a boot overlay intended for a digital-to-analog converter (DAC) from HiFiBerry.



The WM8804 is joined by a handful of passives.

Speaking of which, comparing this project with commercial offerings from companies like HiFiBerry is somewhat unavoidable. While we can’t say for sure how the simple design [Nick] has come up with compares to more expensive (or even cheaper) options on the commercial market, obviously going the DIY route always nets you extra points here at Hackaday. Plus, we’ve always been fascinated with projects that tackle this relativity rare example of consumer-grade fiber optic technology.


adding optical audio raspberry