Pi 5 Becomes ALSA-Compatible TOSLINK Sound Card

Wait 5 sec.

This is one of those hacks that makes you stop in your tracks and say, “wait, you can do that!?” — before realizing, oh, yes, of course you can do that. With enough computational power, you can do a lot of things, and the Raspberry Pi 5 is a far cry from the single-board computer’s humble beginnings. In this case, the “you can do that!?” is both that [Oliver] was able to get the digital audio TOSLINK working via an LED tied to one GPIO pin on the Pi, but also the larger project that is embedded in: using the Pi as a full featured 8-channel USB sound card called Camilla DSP.For the first one: the old TOSLink standard is very simple, and all you need to do is blink an LED quickly enough. Considering the clock frequency of the Pi 5 is in the GHz range and the TOSLINK is the same 3.1 Mbit/s S/PDIF signal you could pull off your CD-ROM drive to your Sound Blaster, there’s no problem there. Except, wouldn’t the operating system get in the way? Well, not when you have enough clock cycles to throw at the problem. Using a Pi 5 doesn’t hurt: the RP1 I/O chip included on the board is keeping things smooth with its included PIO while Linux mucks about in the background. There’s a reason we called it the most important product Raspberry Pi ever made.As for making a USB sound card from an SBC — well, we’re not sure why that got the “you can do that” reaction. The Raspberry Pi family had ‘gadget mode’ for over a decade now, allowing you to present the computer as a USB device, so why not a sound card? That’s a valid class of USB device.