Optical audio out with a 1 cents led on RPI5

Yes, this is audio over light from a Raspberry Pi 5 GPIO.

I wrote an experimental Linux driver for the Pi 5 that generates an optical S/PDIF signal on GPIO12 using RP1 PIO + DMA. For this first test, I used a cheap LED placed close to a TOSLINK receiver.

On a bare-metal microcontroller like an STM32 or ESP32, generating a precise bitstream is fairly straightforward. On a Raspberry Pi running Linux, it is harder because the OS is not real-time enough for accurate GPIO bit-banging.

The Raspberry Pi 5 is interesting because it has the RP1 I/O chip with PIO. I use the PIO like a small hardware bitstream engine:

Linux audio -> ALSA driver -> S/PDIF encoder -> DMA -> RP1 PIO -> GPIO12 -> optical receiver

So this is not just blinking an LED. It is a real S/PDIF audio stream generated from a Raspberry Pi 5 GPIO.

Linux sees it as a normal ALSA sound card, so it can be used with CamillaDSP for routing, filters, crossover experiments, and optical output.

Full technical explanation, install notes, GPIO12 wiring, limits, and validation:

https://github.com/RASPIAUDIO/CamillaDSP/blob/main/prototypes/pi5_spdif_gpio/README.md

My mid-term goal is to build an easy-to-set-up open DSP box where the Raspberry Pi 5 is seen by a PC as an 8-channel USB sound card, using USB gadget mode and a USB-C power/data splitter. The same box can then provide S/PDIF output, demonstrated here, plus 8 analog outputs using the four I2S lanes of the Pi 5 and a DAC board.

The use case is DIY active speakers, digital crossovers, FIR/PEQ/delay, and home cinema experiments.

Ongoing project:

https://github.com/RASPIAUDIO/CamillaDSP

u/No-Consequence7624 — 12 hours ago

Raspberry Pi 5 as a USB sound card into CamillaDSP, then 8 analog outputs / TOSLINK

I’ve been experimenting with a Raspberry Pi 5 as a small open DSP box.

The PC sees the Pi as a USB audio device using USB gadget mode. With a USB-C power/data splitter, the Pi can be powered normally while also receiving USB audio from the computer.

The audio path is:

PC USB audio -> Raspberry Pi 5 -> CamillaDSP -> 8 analog outputs and/or optical TOSLINK

The goal is active crossover / home cinema / speaker DSP use: routing, PEQ, FIR, delays, gain, and output testing from a simple web interface.

Short demo:

https://youtube.com/shorts/2ND7hcqHV5Q

For the full explanation of the Raspberry Pi 5 RP1 PIO + DMA S/PDIF output, including install, GPIO12 wiring, limits, and validation notes, read: https://github.com/RASPIAUDIO/CamillaDSP/blob/main/prototypes/pi5_spdif_gpio/README.md

Project / install notes:

https://github.com/RASPIAUDIO/CamillaDSP

More info:

https://raspiaudio.com/

Still experimental, but the basic USB gadget + CamillaDSP + multichannel output path is working.

u/No-Consequence7624 — 13 hours ago

RP1 PIO + DMA for S/PDIF BMC output on Raspberry Pi 5: does this architecture look sane?

I’ve been experimenting with Raspberry Pi 5 RP1 PIO for timing-sensitive audio output.

The goal was to generate stereo S/PDIF directly from GPIO. The current prototype creates an ALSA playback card, receives 48 kHz stereo PCM, encodes S/PDIF subframes + BMC in a kernel driver, then streams the packed bits to RP1 PIO via DMA.

https://preview.redd.it/vxgxslhiv89h1.png?width=864&format=png&auto=webp&s=bf23a869d702b456939dfb8b30f59e9bb17a8fc8

At 48 kHz stereo the S/PDIF half-bit stream is 6.144 MHz. The PIO program is intentionally tiny: one output bit per clock tick. The driver keeps several ALSA/DMA periods queued to avoid underruns.

I validated receiver lock through an optical path, first with a very crude LED + TOSLINK cable test, then with a TOSLINK receiver/DAC loopback.

Code is here if useful:

https://github.com/RASPIAUDIO/CamillaDSP/tree/main/prototypes/pi5_spdif_gpio

I’m mainly looking for technical feedback:

- any obvious flaw in the PIO/DMA buffering approach?

- better way to structure the ALSA/kernel side?

- anything specific to RP1 PIO that I should avoid?

reddit.com
u/No-Consequence7624 — 11 days ago

Raspberry Pi 500 optical Audio S/PDIF out from GPIO with just an LED

I’ve been experimenting with optical S/PDIF output on Raspberry Pi 5 / Raspberry Pi 500 using the RP1 PIO block.

The current prototype creates a normal ALSA playback card called RASPISPDIF. Audio can be sent to it from aplay or CamillaDSP, then a small kernel driver encodes 48 kHz stereo PCM into S/PDIF BMC, feeds it to RP1 PIO + DMA, and outputs the signal on GPIO12.

The fun part: for the first optical test I used only a standard LED on the GPIO pin and held a TOSLINK cable close to it. That was enough for an optical DAC/receiver to lock and play clean audio.

This is not a final compliant TOSLINK transmitter yet. A proper TOSLINK socket/module is the sane mechanical/product version. But as a Raspberry Pi 5/500 lab hack, it works and is now documented.

https://preview.redd.it/8scaz4tzu89h1.png?width=859&format=png&auto=webp&s=ed7102c984be17f88002f3ce8e90f2e7976e1654

I’m doing this as part of an open RASPIAUDIO / CamillaDSP effort:

https://github.com/RASPIAUDIO/CamillaDSP/tree/main/prototypes/pi5_spdif_gpio

The USB-to-CamillaDSP-to-optical profile is here:

https://github.com/RASPIAUDIO/CamillaDSP/blob/main/docs/usb_gadget_2ch_to_spdif_optical.md

I’d be interested in feedback from people with different optical DACs / AVRs:

- does the receiver lock reliably?

- any obvious issue with the RP1 PIO/DMA approach?

- better simple output stage suggestions for TOSLINK or coax?

reddit.com
u/No-Consequence7624 — 11 days ago

DIY Crossover DSP with Raspberry pi 5 -->8 USB in <--8 analog out

I now have a Raspberry Pi 5 setup where my windows computer sees the Pi as a USB 7.1 audio device. The audio comes into the Pi over USB-C, CamillaDSP processes it, and the RASPIAUDIO 8xOUT sends it to 8 analog outputs.

​

​

So this is now closer to:

​

PC / REW / DAW -> USB -> CamillaDSP -> 8 analog outputs

​

That makes it much more useful for active crossovers, PEQ, gain, delay, and time alignment. The current default config is still just 1:1 passthrough so people can validate the path before adding filters.

​ .

Updated repo:

https://github.com/RASPIAUDIO/CamillaDSP

I’m thinking the next useful docs should be practical templates: stereo 2-way + subs, stereo 3-way + subs, and maybe 7.1 home-theater passthrough. Which one would be most useful?

u/No-Consequence7624 — 16 days ago
▲ 19 r/diysound+1 crossposts

Raspberry Pi 5 + CamillaDSP + 8 analog inputs / 8 analog outputs

I have been working on a compact Raspberry Pi 5 setup that gives CamillaDSP direct access to 8 analog inputs and 8 analog outputs from one HAT. The idea is to make a small Linux DSP box for things like:

https://preview.redd.it/gkp75k5rqg6h1.png?width=578&format=png&auto=webp&s=7f36cb04f6371a2b7dbd25cbf0f6a06353913f08

- active crossovers

- room correction

- multichannel capture

- spatial audio experiments

- multi-zone audio

- audio routing / processing projects

I put the installation notes, configs, and tests here:

https://github.com/RASPIAUDIO/CamillaDSP

Current tested setup:

- Raspberry Pi 5 64-bit Raspberry Pi OS

- CamillaDSP 4.1.3

The default CamillaDSP config is intentionally boring: input 1 to output 1, input 2 to output 2, etc. I wanted the first public test to prove the basic audio path before adding FIR filters, crossovers, delays, or EQ.

I also added validation scripts for:

- ALSA inventory

- 8-channel output test

- 8-channel input capture

- CamillaDSP config checks

- systemd service test

- physical jack-to-jack loopback

- CamillaDSP SignalGenerator loopback

One loopback test uses CamillaDSP itself as the signal source. With a stereo cable connected on the second jack pair, CamillaDSP generated a 500 Hz signal on output channels 2 and 3, and the strongest captured signal came back on input channels 2 and 3, as expected.

Product page for context:

https://raspiaudio.com/product/8xin8xout/

Separate 8-output-only board, not the board used in this CamillaDSP 8-in/8-out test:

https://raspiaudio.com/product/8xout/

Installation guide / board detection notes:

https://forum.raspiaudio.com/t/8xout-8xin-out-for-raspberry-pi5-installation-guide/1273

reddit.com
u/No-Consequence7624 — 25 days ago
▲ 21 r/codex

Codex burnout

I’m using Codex more and more, and I’m starting to feel like I, the human, am becoming the bottleneck.

I now have so many projects open that I struggle to keep track of all the places where Codex is waiting for human feedback, decisions, testing, or clarification.

It feels like what I need is some kind of “meta project manager” layer: a central dashboard or reminder system that tracks all open Codex tasks across projects and shows me exactly where human input is needed next.

How are you all handling this?
Do you use a specific workflow, tool, plugin, GitHub issue strategy, notes system, or project-management setup to avoid losing track?

reddit.com
u/No-Consequence7624 — 2 months ago