Hello,
I am trying to use Sonic Pi on an old laptop. I’m running NixOS unstable and use Pipewire using the default audio configuration.
I noticed that certain samples (in particular bd_boom.flac) have a reproducible cracking when the sound is emitted from the laptop speakers but not when using headphones.
Does anyone have any suggestion on how I could diagnose what the cause of the problem could be?
One potential source of crackling I found comes from different layers of the audio stack using different sample rates. But unsure if this the case here since your headphone jack and speaker presumably get the output from the same audio card.
If it’s a certain sound only, also consider root causes in the lower layers.
The laptop sound chip might be applying DSP to the output and that can have audible artifacts such as cracking when certain sounds play.
Laptop speakers are usually garbage, so it might even be a hardware issue.
A good sanity check would be to use pulse audio instead of pipewire. If it also happens in pulse, the root cause is unlikely to be the sound server and rather the kernel driver for your sound chip, the sound chip itself or the HW.
I’m thinking to install OS X on an external drive and see if the issue reproduces there. That at least should help me figuring out if the problem is due to the hardware itself or to drivers