QJack vs ALSA sound quality

All your LV2 and LADSPA goodness and more.

Moderators: MattKingUSA, khz

amc252
Established Member
Posts: 168
Joined: Fri May 05, 2023 12:24 am
Has thanked: 105 times
Been thanked: 24 times

QJack vs ALSA sound quality

Post by amc252 »

Hi everybody,

I have recently been playing with bitKlavier Linux version, which functions very efficient with ALSA.
The other day, in order to put some plugins in line, I used QJack instead.
I have noticed a better sound quality, like a rounder, cleaner piano sound.
Is this possibe or am I kidding myself?
It seems strange that using Jack interface instead of ALSA direct connection to the system or a DAW would make a difference, yet that's the feeling I have and would like to hear other people's opinions.

User avatar
d.healey
Established Member
Posts: 685
Joined: Fri Sep 22, 2017 8:33 pm
Has thanked: 363 times
Been thanked: 117 times

Re: QJack vs ALSA sound quality

Post by d.healey »

amc252 wrote: Sun Mar 23, 2025 6:24 pm

Is this possibe or am I kidding myself?

Does it null?

David Healey
YouTube - Free HISE scripting and sample library dev tutorials
Libre Wave - Freedom respecting instruments and effects.
amc252
Established Member
Posts: 168
Joined: Fri May 05, 2023 12:24 am
Has thanked: 105 times
Been thanked: 24 times

Re: QJack vs ALSA sound quality

Post by amc252 »

d.healey wrote: Sun Mar 23, 2025 8:16 pm
amc252 wrote: Sun Mar 23, 2025 6:24 pm

Is this possibe or am I kidding myself?

Does it null?

I'm not sure I understand what you mean.

User avatar
elcalen
Established Member
Posts: 148
Joined: Mon Oct 28, 2019 12:39 pm
Location: Finland
Has thanked: 2 times
Been thanked: 22 times
Contact:

Re: QJack vs ALSA sound quality

Post by elcalen »

amc252 wrote: Sun Mar 23, 2025 9:55 pm

I'm not sure I understand what you mean.

Null testing audio means: when you have two recordings that are supposed to be identical, if you play them simultaneously but reverse the phase of one recording, the waves should cancel each other out and all you get is silence—only differences between the two waveforms would be played. Of course to properly test this you need two performances that are actually supposed to be identical, which depending on circumstances may be difficult to obtain.

But as for the original question, there really should not be any difference in quality, I think. In fact, Jack is just an intermediate layer between ALSA and applications to facilitate more advanced routing—so the audio with Jack should still technically be going through ALSA. So I don't see how sound quality could theoretically be improved by Jack (though I admit I'm not very familiar with it). If there is genuinely any difference for you, I don't think it would be due to the technology itself, but rather the particular settings and circumstances on your system. Like, were you using the same samplerates between the two, for instance?

Artist name Ben Enkindle. I (try to) make electronic music exclusively with Linux software.

amc252
Established Member
Posts: 168
Joined: Fri May 05, 2023 12:24 am
Has thanked: 105 times
Been thanked: 24 times

Re: QJack vs ALSA sound quality

Post by amc252 »

Wow, that's really interesting. Thanks a lot for the detailed explanation.
I'll try to record a MIDI file with and without Jack to see how it goes.
I agree that in theory there should be no difference and that's why I was baffled.

UPDATE:
I ran this test in Audacity.
1) Recorded a MIDI track with ALSA and then with Jack.
2) Copied and aligned the same track to see if I was getting this right. Inverted one of the tracks and indeed got silence.
3) Aligned the ALSA track and the Jack track, inverted one of them. I still get sound.

So I assume the files are indeed different.

User avatar
GarryO
Established Member
Posts: 168
Joined: Mon Apr 06, 2009 7:30 pm
Location: UK
Contact:

Re: QJack vs ALSA sound quality

Post by GarryO »

If you look on Qjackctl's Settings --> Advanced tab ( I assume you meant Qjackctl when you wrote Qjack ) you will see there is a Dither option.
If this is set to something other than "none", this might explain the results you are getting.

amc252
Established Member
Posts: 168
Joined: Fri May 05, 2023 12:24 am
Has thanked: 105 times
Been thanked: 24 times

Re: QJack vs ALSA sound quality

Post by amc252 »

GarryO wrote: Mon Mar 24, 2025 10:17 pm

If you look on Qjackctl's Settings --> Advanced tab ( I assume you meant Qjackctl when you wrote Qjack ) you will see there is a Dither option.
If this is set to something other than "none", this might explain the results you are getting.

Yes, I meant Qjackctl ;).
Dither is set to none. Also the bitrate is 48,000 both in the VST and Jack.
I haven't really touched anything.
I have uploaded my test files here:
ALSA
https://drive.google.com/file/d/1HDMYHg ... sp=sharing
jack
https://drive.google.com/file/d/13FYxYR ... sp=sharing
Just in case someone wishes to give it a listen.

jean-emmanuel
Established Member
Posts: 39
Joined: Tue Sep 21, 2021 4:47 pm
Has thanked: 1 time
Been thanked: 17 times

Re: QJack vs ALSA sound quality

Post by jean-emmanuel »

What about playing the same midi track two times with the same setup ? Does the instrument produce the exact same output everytime when the audio engine stays the same ?

User avatar
elcalen
Established Member
Posts: 148
Joined: Mon Oct 28, 2019 12:39 pm
Location: Finland
Has thanked: 2 times
Been thanked: 22 times
Contact:

Re: QJack vs ALSA sound quality

Post by elcalen »

A fundamental problem with nulling and many synthesised instruments (as well as many effects) is that there may be elements of randomness in the sound processing. This means that even when using the exact same midi, two recordings may still vary slightly, and therefore won't null perfectly. Which makes it tough to say for certain whether a difference is due to recording technology, or simply inherent to the instrument.

jean-emmanuel's suggestion to compare two recordings with the same setup could give some insight to whether this is the case here.

Artist name Ben Enkindle. I (try to) make electronic music exclusively with Linux software.

folderol
Established Member
Posts: 2172
Joined: Mon Sep 28, 2015 8:06 pm
Location: Here, of course!
Has thanked: 254 times
Been thanked: 437 times
Contact:

Re: QJack vs ALSA sound quality

Post by folderol »

As has been said, it is extremely difficult (if not impossible) to get identical results from a synthesiser - indeed, it's hard enough to get the same result for anything within a computer. Small time discrepancies can occur simply due to the machine swapping cores for thermal balancing.

The Yoshimi guy {apparently now an 'elderly'}
tramp
Established Member
Posts: 2481
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 12 times
Been thanked: 620 times

Re: QJack vs ALSA sound quality

Post by tramp »

:mrgreen: I've read the source code of JackAudioConnectionKit and I found that it use golden plated wires internal and clears the buffers with snake oil. That may explain why it sounds better. :twisted:

On the road again.
User avatar
Impostor
Established Member
Posts: 1747
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 174 times
Been thanked: 495 times

Re: QJack vs ALSA sound quality

Post by Impostor »

Louder sounds better. A volume difference of .2dB, while imperceptible as a volume difference, can already color your experience.

amc252
Established Member
Posts: 168
Joined: Fri May 05, 2023 12:24 am
Has thanked: 105 times
Been thanked: 24 times

Re: QJack vs ALSA sound quality

Post by amc252 »

All valid insight with which i totally agree.
I did use the same MIDI track and the same VI, simply changing the way i connected it to Audacity. Same bitrate etc.
I also very carefully manually aligned both the same tracks recorded with ALSA and the same tracks recorded with Qjackctl.
In both cases I got perfect silence.
When i did the same with the different recordings, I got music.
I also agree that a very minimal difference in volume could account for both Jack sounding better and the tracks not nulling.
It's weird, which is why I thought to ask.

User avatar
alex stone
Established Member
Posts: 397
Joined: Fri Jun 06, 2008 7:39 am
Has thanked: 133 times
Been thanked: 70 times

Re: QJack vs ALSA sound quality

Post by alex stone »

tramp wrote: Tue Mar 25, 2025 11:29 am

:mrgreen: I've read the source code of JackAudioConnectionKit and I found that it use golden plated wires internal and clears the buffers with snake oil. That may explain why it sounds better. :twisted:

And don't forget, Jack goes all the way up to 11......

:)

folderol
Established Member
Posts: 2172
Joined: Mon Sep 28, 2015 8:06 pm
Location: Here, of course!
Has thanked: 254 times
Been thanked: 437 times
Contact:

Re: QJack vs ALSA sound quality

Post by folderol »

Just one small point.
If you have a single audio source and destination, ALSA will always perform better. Jack goes through ALSA.

The Yoshimi guy {apparently now an 'elderly'}
Post Reply