Pirate Radio Audio Issue - Scratchy

@calleblyh

there is an updated version hradwarewise on the market

Yes. We realised shortly after the switch from Jessie to Stretch that Pulse - which was previously installed by default and part of the audio stack - had been removed entirely. This exposed what I still believe to be a bug in ALSA (although I’ve had a whale of a time tracing it back) where it would run the I2S clock even when no data was being output. This has the unfortunate side-effect of causing the attached DAC to clamp the left/right terminals to +5v and GND, causing a constant current through the speaker :( (Note: This is bad!)

After much searching for a viable software fix, we decided to roll a small update to the hardware in the form of a transistor/capacitor gate on the clock signal. A capacitor is charged up by the I2S frame-sync/LRClock (this is the signal that tells the DAC whether the left or right audio data is currently being sent) and this capacitor opens a transistor that otherwise gates the clock line. This elegant fix makes the board immune to otherwise invalid signals.

Now, my conundrum is that software has no way of telling between the old board and the new board so I’m forced, in all cases, to take precautions as if it were the old board to prevent things going awry.

Unfortunately those precautions have had some side-effects in Jessie which I’d failed to catch, and they also produce scratch/awful audio under some circumstances.

In my PiratePython Radio software I cheated. I went right down to the base I2S kernel module and hacked it to squash the bug- eliminating the need for PulseAudio on either version of the hardware.

Welcome to my world ;)