easyeffects icon indicating copy to clipboard operation
easyeffects copied to clipboard

Add partitioned convolution to EasyEffects Convolver for low-latency true-stereo HRIR processing (JamesDSP parity)

Open LethalManBoob opened this issue 3 weeks ago • 10 comments

Hello. We recently had 4 channal stereo hrir support put into the master branch but it still seems to sound different when using them compared to jamesdsp, i queried grok for the reason and it gave me this resolution to pass to you. If i am incorrect in anything please let me know, thank you.

Since the recent stereo hrir support in master branch, the only major gap left vs jamesdsp in convolution quality is the lack of partitioned convolution. jamesdsp uses uniform partitioned fft convolution, which gives:

Much lower latency (real-time safe even with long hrirs) Lower cpu usage on long impulses No audible artefacts when changing ir's on-the-fly

Easyeffects currently uses a single block (non partitioned) convolution which gives high latency and CPU spikes with >8192-tap IRs. Please implement uniform-partitioned convolution (Zita-Convolver or similar algorithm) in the Convolver plugin so true-stereo HRIR/crossfeed reaches full JamesDSP-level performance and responsiveness.

LethalManBoob avatar Dec 03 '25 12:12 LethalManBoob

Hum. The zita-convolver library we use does partioned convolution https://kokkinizita.linuxaudio.org/linuxaudio/index.html

As far as I can see it is configured for zero delay. How big are the impulse files you are using?

wwmm avatar Dec 03 '25 13:12 wwmm

Thats strange. The initial issue was that the convolvers sound less convincing on easyeffects but i think it was psycoacoustic due to gain differences and groks information is outdated, ill do some more tests and report back might actually be nothing in the end

LethalManBoob avatar Dec 03 '25 15:12 LethalManBoob

Okay I have confirmed that easyeffects implements the efo in a different and less effective way than jamesdsp. I tested by listening to a midi soundtrack that distorts noticeably with hrtf dsp and easy effects made it sound like i had phase inversion on a headphone and didnt have the distortion (a bad thing). jamesdsp sounds perfect and has the distortion.

I can link the ost and exact hrir in question if that is ok.

Also i was listening to it with strawberry in alsa.

LethalManBoob avatar Dec 04 '25 01:12 LethalManBoob

I can link the ost and exact hrir in question if that is ok.

It should be ok to add a link. The question is if there is anything that can be done without using a completely different library.

easy effects made it sound like i had phase inversion on a headphone

Did you try different stereo width values? (100% is the same as doing nothing to it) Maybe that has to be implemented in a different way for true stereo impulses. Or maybe jamesdsp is applying a different kind of preprocessing to the impulse. Considering how many Linux projects use zita-convolver it most likely does what has to be done. Either we are not configuring it properly or other software are preprocessing the impulse file in a different way.

wwmm avatar Dec 04 '25 02:12 wwmm

I just realised the issue. It only comes up when listening to music via music players. Listening on youtube doesnt give the same out of phase-ish sound. Seems it doesnt like applying convolution to alsa or certain pipelines?

LethalManBoob avatar Dec 04 '25 10:12 LethalManBoob

The ost in question - you can tell as well by the synth hits at the beginning

The music file to compare on local music players

The exact hrtf convolution filter i used

Edit: strange, it seems if the music is running on youtube before and at runtime of the local music file, it will properly apply the convolution filter, even if the youtube video is stopped.

Grok is saying: "In EasyEffects, local music (e.g., via ALSA-direct apps like Strawberry) enters PipeWire as a raw stream without prior resampling or latency setup, causing zita-convolver to initialize with mismatched phase/stereo HRIR processing—leading to inversion or artifacts. Streamed music (e.g., YouTube) routes through browser PipeWire clients, pre-establishing normalized latency/channels, avoiding the glitch."

LethalManBoob avatar Dec 04 '25 10:12 LethalManBoob

it seems if the music is running on youtube before and at runtime of the local music file, it will properly apply the convolution filter, even if the youtube video is stopped.

I think that what you are seeing may be caused by the impulse file resampling. The impulse has to be at the same sampling rate of the audio signal. Usually youtube chooses 48 kHz. But your mp3 file plays at 44.1 kHz in a local player. And your impulse was created at 48 kHz. So when playing on youtube there is no impulse file resampling.

But to be honest I do not notice any difference in the audio because of the resampling. Whatever it is happening on your side it is too subtle or maybe non existent on my computer. But the only thing I can think of right now that could explain your report is the impulse file resampling.

wwmm avatar Dec 04 '25 22:12 wwmm

After some testing, it seems this does happen under some circumstances but not all the time, and when it does, switching to the 48khz or the other way around fixes it. Which is very strange. Maybe somthing is misconfigured in pipewire on my end, so i will keep a lookout on this. But switching from the one thats currently working, to the other one, will always have that one sound out-of-phase. So can you try the song while switching between, the hrir file i gave and this one.

EFOtech MLV-02048-44k.wav

I was listening to songs with different values. 44.1 and 48 and it would happen sometimes, again the above solution always worked. even if they mismatched in khz

to create a consistant envrionment i run systemctl --user restart pipewire pipewire-pulse wireplumber before running easy effects then strawberry to play the 2 music tracks, one at 44100khz and 48000khz.

For example, right now as im writing this comments, they both play fine on the non 44.1 version. but switching to that reengages the odd sound for BOTH of them

I agree that there is somthing wrong with the impulse file being resampled when used from easy effects, this just doesnt happen on jamesdsp

LethalManBoob avatar Dec 05 '25 01:12 LethalManBoob

So can you try the song while switching between, the hrir file i gave and this one.

I have to take some time to test with headphones. At least with my edifier speakers I can't notice any difference between these impulses.

I agree that there is somthing wrong with the impulse file being resampled when used from easy effects, this just doesnt happen on jamesdsp

Maybe jamesdsp forces a fixed sampling rate. We try to follow the one pipewire uses. And it does try to change it on the fly. Or at least my system is configured in a way that tells pipewire to do that.

wwmm avatar Dec 06 '25 00:12 wwmm

The convolution filter is designed for headphone crossfeed so that would be the best case to test on.

LethalManBoob avatar Dec 06 '25 02:12 LethalManBoob