A Digital Audio Recorder For TOSLink

Every now and then in our travels we come upon a project with such an obvious need that it’s almost a surprise nobody has thought of doing it before. So it is with [Elehobica]’s project, an audio recorder for S/PDIF audio streams. It’s the device you could have used, years ago!

S/PDIF, or its optical fiber cousin TOSLINK, is the digital output you’ll find on the back of Hi-Fi equipment, it’s a serial encoding of an uncompressed digital audio data stream dating from the era when CDs were new. Its relative simplicity may be what’s given it longevity — it’s easy to implement so it plugs into pretty much everything.

Perhaps back in the day it might have been a pain for an 8-bit microprocessor to handle, but in 2026 it’s no bother for a Raspberry Pi Pico. The project is a small PCB with the Pico, a few interface components, and an SD card socket, and it sends what it hears on the input to the card as WAV files. We particularly like its smart sample rate and bit depth detection, and the way it cuts up tracks based on periods of silence. If you work with SPD/IF, this is going to be a useful tool.

Perhaps it could even be fed with a laser!

14 thoughts on “A Digital Audio Recorder For TOSLink

    1. You can, with enough memory, trade off a signifigant amount to lookup tables to greatly speed up compute. Write some python code to rewrite your other code using as many LUTs as you can afford storage wise. The trick is to profile the code and then use that insight to prioritise how you spend your storage budget, LUT the most expensive compute first.

          1. You and KDawg haven’t read correctly what 𐂀 𐂅 wrote.
            “Write some python code to rewrite your other code […]” doesn’t mean the python is the code that will be fast.

        1. you precompute tables using python on a real computer and then compile them into your C code. it’s not rocket science that prototyping stuff in python is easier.

  1. I’ve never seen it spelled out with the slash, so had to go look it up to find out what it actually was an initialism for: Sony/Philips Digital InterFace

    A non-audio application: If you need an isolated low-noise data acquisition system and audio bandwidth is sufficient, then a battery-powered analog-to-TOSLINK adapter makes a very good and very cheap solution.

    Good for working with high voltage standoffs, or for direct-detection VLF radio receivers you don’t want to contaminate with a wired connection to a noisy computer or line power. (but, sorry, it can’t receive NAA)

    All the ADCs I’ve found integrated in the analog-to-TOSLINK adapters have an astonishingly sharp brick wall filter at 22 kHz. No doubt because of the crazy oversampling and digital filtering in the Σ-Δ (sigma delta) ADC they employ. Which also has the added benefit of its noise shaping property, reducing the in-band noise to very low levels.

    The low end response (typically) blocks DC unless you hack it, and that rolloff is not well defined. I’ve seen between 0.5 Hz and 10 Hz. Even if you hack the high-pass DC block, the DC performance is pretty sucky, so don’t use it to (say) measure temperature or DC voltage.

    1. Often the TOSLINK optical receiver is the limiting factor in the minimum frequency or DC block. While the transmitters can do DC only the original Toshiba receivers were speces down to 0Hz and they are obsolete. Current equivalents implement the NZR in the receiver. Makes it a challenge for High Voltage sensing or control experiments.

  2. There was such a thing in the mid 90s. You could use a minidisc player/recorder connected via TOSLINK to a CD Player to record audio tracks (albeit compressed). Most would detect and create new tracks between songs and some cd player + md recorders would transfer CD-Text for naming the recorded audio tracks. If you had a soundcard with spdif output, then you could record mp3s from PC to minidisc.

    Some DAT recorders (Digital Audio Tape) also had toslink input and would save uncompressed recordings.

    1. Somehow I had nothing but trouble trying to to record from PC to minidisc over TOSLINK. There would never be any errors shown anywhere but my music would be basically unlistenable: several seconds of music, and then SQUEEBLORP, followed by more music, and SQUEEBLORP, etc., etc. I have to assume it was some fault of the minidisc recorder as I’ve not experienced that fault with other TOSLINK devices.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.