After having some issues with background noise on the analog output from the Pi, I was thinking about alternatives. Perhaps a silly question, but is there a way to force a TTL-level digital audio output from the headphone jack? I'm a linux noob, but recall making a passable TTL-to-Toslink optical cable with just a bright red LED at the right wavelength, an old toslink blank plug, and an appropriate resistor in order to make an old CD-ROM drive into a digital audio source for a garage stereo. I'm wondering if a similar approach might lead to a super-cheap adapter that would avoid additional interface hardware... just basically require a 3.5mm cable going to a similar LED/toslink plug. There used to be programs out there that would record AC3 audio as a WAV file for equipment demo/testing, so it's certainly theoretically possible. just not sure if the hardware supports it or if it's worth someone's time to develop. Also not sure what the maximum voltage output is from that jack, which could be a limiting factor if it's a 1V peak.
thoughts from the experts out there?