Raspberry Pi, Jackd, Audio Injector - help!

Thanks everyone - it boots in SC now - so it’s pretty close, but the audio seems to be incredibly distorted and glitched-out. I’m wondering if the bit-depth in SuperCollider can or needs to be adjusted - or if it is another problem.

Maybe it’s too loud? Try turning down the output level of your interface in alsamixer

Run:
alsamixer

Thanks everyone - it boots in SC now - so it’s pretty close, but the audio seems to be incredibly distorted and glitched-out. I’m wondering if the bit-depth in SuperCollider can or needs to be adjusted - or if it is another problem.

Try increasing the buffer size of jackd. It currently defaults to 1024
as you can read in your printout. Try 2048 or even 4096 via the
appropriate flags. Try also to run jackd with realtime priority using
the -rt flag. Try a different sampling rate using the -r flag. Change
only one of these at a time. Read the manual page by typing
man jackd
in a terminal.

I should say that the sound produced seems closer to static noise than the intended signal. I had hoped it was a buffer issue, but no luck there.

I turned down the volume in alsamixer and increased the buffer size of jackd. Sample rate change (44.1 and 48) also does not produce a difference. I also tried increasingly the output latency.

Interestingly, SC seems to default to using the jackd buffer size, regardless of what I set for the ServerOptions.

Another possible cause for high distortion could be endianness. Your jack startup output shows that jack is using little-endian format (least significant byte first). If the soundcard or device driver expects big-endian, then the first byte (which jack is using for tiny tiny changes) would be interpreted as massive changes = ear-shredding distortion.

I have one soundcard which sporadically selects the wrong endianness for input. When this happens, a mic is unusable – just noise, with some faint hints of the signal that should have been coming through.

Unfortunately I don’t see how to specify endianness in the jack command.

There is never any way for scsynth to override the settings of a running jack server.

hjh

1 Like

This seems like it could be the issue. Are there any work-arounds?

The only solution I found for that USB soundcard was to unplug it and reconnect, and hope it would get it right that time. I never investigated beyond that.

If your soundcard is built-in, then unplugging isn’t an option.

I would guess it could be an ALSA configuration problem. (JACK connects to the soundcard using a “backend,” which is usually ALSA. ALSA handles the soundcard details. So if endianness isn’t configurable on the JACK side, it may be configurable on the ALSA side. But I searched this, and didn’t find anything concrete. So I’m afraid I don’t know…)

hjh

I’m having the same problem on rpi4, aplay and mpg123 are fine but sclang sounds like a Vespa :confused:

I will add some other jackd client and see if it has the same problem. “Endianitis” sounds plausible