How do I change Alsa sample format from 24bit int to 32

Hi!
I’m setting up supercollider on a new computer, and sound is working but sounding … weird.

Examining the startup patter, I notice

ALSA: final selected sample format for capture: 24bit little-endian

while on my old computer it’s 32 bit.
I haven’t been able to find out where to change this. Does anyone know how to fix this issue?

Thank you!

Could you be more specific? “Weird” could be anything, so there’s no way to make a meaningful guess as to the cause.

Is it only JACK apps, or all audio? Specific soundcards or all of them?

As I understand it, JACK and ALSA are supposed to abstract the hardware sample format away from you. It’s entirely normal for ALSA to select an integer format and shouldn’t be necessary to be float here; SC and JACK will continue to use floats internally.

hjh

(Sorry if you got an incomplete version of this, I accidentally sent too soon)

Thanks for helping me look into this!

Youtube sounds normal, Timidity sounds normal, Reaper sounds normal (PulseAudio). I’m not sure how to check for JACK apps in particular.

What I meant by “weird” on supercollider: I was testing with {SinOsc.ar(x,0,0.2)}.play –
x = 300 sounds like sharp tone at 300hz (NOT a sine)
x = 440 sounds like buzzy oscillator 80hz
x = 800 sounds like sharp tone at 800 hz
x = 900 sounds like sharp tone at 600 hz

This kind of behavior is part of why I thought numbers were just being interpreted wrong e.g. interpreted in 24 bits rather than the expected 32, as it seems to say in my start up dialog.

As far as I know I just have the one built-in soundcard. I did try all of the different interfaces in qjackctl. The computer is a new Dell XPS 13, running the latest Linux Mint.

What are all of your JACK settings and server options? Especially these:

  • JACK: Sample rate, buffer size, periods per buffer
  • s.options.blockSize

hjh

s.options.blockSize is 64
JACK samplerate was 44100, tried changing it to 48000 to match sc, sounds the same as before.
JACK Frames/Period is 1024, Periods/Buffer is 2.

I have to admit, I don’t have a solid idea what’s going on.

How to check JACK apps… Reaper can play through JACK, if you’re using the native Linux version instead of the Windows version with Wine.

If Reaper → JACK and SC → JACK both sound bad, then it would be a JACK configuration problem.

If Reaper → JACK sounds ok while SC does not, then :angry: it gets interesting.

What does the waveform look like for the bad sine waves?

hjh

The waveform looks exactly as it should.

I think it’s a JACK problem, not a SuperCollider problem. In fact, I’m pretty sure it’s clipping – somewhere along the line the signal is being multiplied by a lot. SinOsc.ar(440,0,0.0002) sounds about right.

None of the JACK configurations seem to be wrong, though, and I don’t see a place to add a multiplier to JACK to counteract this. Maybe it’s some audio driver issue causing this… Still looking into it…

Just to follow up on this – I ended up installing pipewire (an odyssey in itself) which seems to have solved the problem.

Just to follow up on this – I ended up installing pipewire (an odyssey in itself) which seems to have solved the problem.
Have you ever asked about your problem on the Linux Audio Users mailing
list yet?

Just to follow up on this – I ended up installing pipewire (an odyssey in itself) which seems to have solved the problem.

Have you ever asked about your problem on the Linux Audio Users mailing
list yet?
(retrying from mailing list mode with different formatting now)

I’m curious about your experience there (or from anyone else who has switched to Pipewire). I ran into heavy xrun issues when trying out Pipewire for the first time a few weeks ago, so I reverted to my beloved JACK… I thought Pipewire wasn’t ready yet, but it seems some people are using it just fine.

I did not ask on the Linux Audio Users mailing list. I was looking at the linuxaudio subreddit, but didn’t end up posting there either. Their discussion of pipewire was helpful though!

I found a few mentions of the problem various places onlline, never with any solution (other than pipewire).

I dd post an issue to the github for Jack, though I’m not sure how useful this will turn out to be. https://github.com/jackaudio/jack2/issues/816#issuecomment-981974055

Right now
I’m no longer trying to debug this, as pipewire seems ok (though I haven’t tested extensively). But if I get back to this problem I’ll try the Linux Audio Users group!

Well, I just did a bare minimum test to see that my initial problem was gone, and I have sound that sounds correct. I still have to install the rest of my stuff and do more testing!

That said, my stuff is pretty much all NRT, except for some small testers. If I understand correctly, xruns are more of a problem with real-time / interaction. If there’s a stress-test script I could run to see if I get xruns, I’d be happy to do that.

A few of the people over at r/linuxaudio seem to be happy with pipewire, but I’m not sure if I saw anything supercollider specific. It may be worthwhile starting a separte topic here to see who’s all using Pipewire.