I am assembling an audio system that uses camilladsp for equalizing my speakers and listening room. I'm using a Presonus S24 for acquiring the signal from my turntable preamp and also want to add my CD player to the system. The S24 only has 2 analog inputs and I don't want to swap connectors all the time, so I decided to use the CD player's digital output. My Rpi5 has one spare USB connector so that's sorted -- but I still had the problem of converting the SPDIF format to something that camilladsp can use.
Enter the Teensy4.0. There's a nice audio-processing library for it, which includes SPDIF input and USB-as-sound-card output, and one of the SPDIF input functions has resampling included so converting the SPDIF 48KSPS to CD-audio's 44.1KSPS is easy. The problem is that the digital audio signal is relatively low-level so a line receiver is needed to complete the signal chain. I found a nice chip for that (the LT6752), which also has adjustable hysteresis to help speed up the signal edges and avoid false triggering. Using EasyEDA, I designed and laid out a little 2-sided board -- the 3D view is below:
It just plugs into the teensy, although the two headers are shown on the wrong side of the board -- at least- for my T4.0. The Teensy should be oriented so its USB connector is on the left.
The schematic:
My original design used a trimmer to adjust the hysteresis, but the one shown here uses fixed resistors, values TBD. I haven't used the board very much so can't say what is best quite yet.
The BOM, gerbers and Teensy4.x program code are attached in one zipped file. One peculiarity with the audio library is that the processing engine only is triggered by certain input or output functions - and the asynchronous SPDIF-in and USB-out functions are NOT among them. So I added what would appear to be an unused SPDIF-output function, simply to make sure that the audio processor actually runs. The Arduino IDE also needs to be set so the Teensy's USB interface type is "audio", not "serial". Finally, you will need to install "teensyduino" in order to compile code for the Teensy series of processors.
I would like to go straight-in to camilladsp w/o resampling the 48K to 44.1K but so far my attempts to do so have resulted in a "bricked" Arduino IDE. Re-installing it solved that problem.
Enter the Teensy4.0. There's a nice audio-processing library for it, which includes SPDIF input and USB-as-sound-card output, and one of the SPDIF input functions has resampling included so converting the SPDIF 48KSPS to CD-audio's 44.1KSPS is easy. The problem is that the digital audio signal is relatively low-level so a line receiver is needed to complete the signal chain. I found a nice chip for that (the LT6752), which also has adjustable hysteresis to help speed up the signal edges and avoid false triggering. Using EasyEDA, I designed and laid out a little 2-sided board -- the 3D view is below:
It just plugs into the teensy, although the two headers are shown on the wrong side of the board -- at least- for my T4.0. The Teensy should be oriented so its USB connector is on the left.
The schematic:
My original design used a trimmer to adjust the hysteresis, but the one shown here uses fixed resistors, values TBD. I haven't used the board very much so can't say what is best quite yet.
The BOM, gerbers and Teensy4.x program code are attached in one zipped file. One peculiarity with the audio library is that the processing engine only is triggered by certain input or output functions - and the asynchronous SPDIF-in and USB-out functions are NOT among them. So I added what would appear to be an unused SPDIF-output function, simply to make sure that the audio processor actually runs. The Arduino IDE also needs to be set so the Teensy's USB interface type is "audio", not "serial". Finally, you will need to install "teensyduino" in order to compile code for the Teensy series of processors.
I would like to go straight-in to camilladsp w/o resampling the 48K to 44.1K but so far my attempts to do so have resulted in a "bricked" Arduino IDE. Re-installing it solved that problem.