My project got delayed by a few days as I thought my Codec Zero had died. I waited for a new one to arrive, but it turns out that I just needed to reload the
iqaudiocodec.state from the pi-Stomp GitHub repo using
alsactl restore.
Interestingly, I found out that the output level drops significantly as soon as something is plugged in either to the USB ports or directly to the 5V pin of the Pi. Have you noticed something like that happen before? And even without plugging anything else in, the output level for my headphones is a bit too quiet. Do you think adding a small amplifier circuit before the output jack would work?
I've not experienced your issue of volume drop when using USB to power peripherals.
I think I've found out the reason for that. As soon as the Pico is powered on, the output level drops significantly. It doesn't matter where I power it from – Pi's USB port, Pi's 5V pin, or using an external adapter. It happens immediately. I suspect it's because I'm making all the connections to the leads of the jacks on the PCB itself, it's connected to the ground in some way? So the signal gets grounded and hence drops in volume as soon as the Pico is powered on?
I experimented with a variety of small amplifier circuits to provide more drive for headphones with less sensitivity. Even with significant power supply filtering, they all were too noisy.
My experiments with boost converters didn't yield a noise floor low enough. I tired 5 different converters with lots of filtering. Basically, the pi supply rail is just incredibly noisy and not a friend of any analog audio.
Unfortunately I also reached the same conclusion. I tried connecting the power input of the amplifier to the Pico, but it just doesn't have enough juice to drive the amplifier. Then I tried powering the amplifier from the Pi's 5V line after it passes through the boost converter. Unfortunately the output signal is way too noisy. So I've given up on using an amplifier in the chain altogether.
If you can live with mono, you could maybe use the IQAudio onboard speaker output, but my recommendation would be to use more sensitive/higher impedance headphones and to make sure your Alsa settings are not reducing the output unintentionally - there are many stages the audio goes thru: Aux > Mixins > Mixouts > ADC > (software gain) > DAC > Headphone. Check those using alsamixer.
This actually helped a lot, thank you! I was using the default
iqaudiocodec.state file. I checked alsamixer and raising the "Headphone" level to 100% significantly improved things. I also tried raising the "DAC" level, but I couldn't increase it past like 65%, otherwise it would start clipping. This configuration actually does make everything at least as loud as I want it to be, at least as long as the Pico is off. But still it's much better than it used to be even when the Pico is off. I saved a new
.state file and I load it on boot.
Regarding a fan, I've never had an overheating problem with a pi3 or pi4 which has passive heat-sinks. pi5 does require active cooling, but the $5 fan cooler I got does the trick and doesn't add any noticeable power supply noise.
I have somewhat gotten around this too. Adding a fan just makes everything way too noisy, even with a boost converter in line. I had to simplify some of my pedalboards, so that they use a little less CPU. I was running pretty complex pedalboards, something like this:
I had to cut back either on the number of NAM instances to 3, or substitute them with AIDA-X. Now, even when the Pi reaches a temperature of 83?C, I don't suddenly start getting a lot of XRUNS. Whereas earlier, once it reached that temperature, the Pi would start throttling and would completely freeze the unit.