Digitalone1 / EasyEffects-Presets

Presets for EasyEffects and PulseEffects.
MIT License
329 stars 30 forks source link

Audio clipping when using Crossfeed + LoudnessEqualizer #8

Closed mobad closed 2 years ago

mobad commented 2 years ago

I'm using easyeffects 6.2.8 with Jmeier Crossfeed where recommended (https://github.com/Digitalone1/EasyEffects-Presets#using-headphones) between Equalizer and Limiter and I've noticed notification sounds like https://github.com/signalapp/Signal-Desktop/blob/main/sounds/notification.ogg produce some really bad clipping/popping when played with no other sounds playing (or even with). When I turn off Crossfeed or move it before Gate things seem to sound fine though.

To reproduce I've attached my preset (just the default LoudnessEqualizer preset with Crossfeed added where recommended) LoudnessEqualizer.json.txt and you can just play notfication.ogg a few times with headphones and Crossfeed off/on to compare.

Is moving before Gate the correct solution? Or does the extra dB that Crossfeed adds make everything before it need to be changed or something?

Digitalone1 commented 2 years ago

Hello, I never experienced noticeable bad clipping on that preset with crossfeed between equalizer and limiter.

But I'd like to play that notification sound on my system in order to reproduce your issue. Anyway if you're good with the crossfeed at the first position, you can go with it, there's nothing wrong or correct about it. :)

Unfortunately now I can't play anything, but tomorrow I should be able to test with that notification sound and I'll report my thoughts.

Note that the last release changed the gate plugin, so if you have the older preset, the gate may not work properly (I assume you already updated the preset, but I'm not sure).

mobad commented 2 years ago

@Digitalone1 Thanks! Yeah I'm using the latest from like 2 days ago.

Digitalone1 commented 2 years ago

So I tested the notification sound and don't hear nothing wrong. No clipping at all. Anyway I played it with mpv celluloid. Maybe signal-desktop is playing it with more gain and the clipping occurs for that reason, I don't know.

Are you sure Crossfeed is adding ex entra db to the signal? On my system I see the Crossfeed is outputting at a db less than the input. Please test with the white noise test signal inside EE (enable it in the Pipewire tab).

Besides the Crossfeed should have a built-in limiter because it does not output above 0 db. Tested increasing the input level by +36 db, the output is just 0.

At the time I wrote the README I intended to always have the Limiter at the last position for security reasons. But now I have not the same idea. Some exceptions can be made and considering that:

I would say that the correct position for the Crossfeed is the last one, after the Limiter.

Let me know your thoughts. Tomorrow I will update the README with these info.

mobad commented 2 years ago

I tried playing it manually with play and mpv but I'm still running in to the issue though and I can clearly see the clipping when recording system audio with audacity. The clipping isn't actually at 0dB but -1dB so it looks like the Limiter is working but I can clearly see flattening on the output waveform in audacity. So I'm thinking this isn't an issue with this preset and probably with easyeffects Crossfeed (or the archlinux bs2b library maybe). When I add/remove Crossfeed it looks like the Limiter goes from applying a -7dB to a -1dB which makes me think bs2b is clipping things.

Are you sure Crossfeed is adding ex entra db to the signal? On my system I see the Crossfeed is outputting at a db less than the input. Please test with the white noise test signal inside EE (enable it in the Pipewire tab). Besides the Crossfeed should have a built-in limiter because it does not output above 0 db. Tested increasing the input level by +36 db, the output is just 0.

You're right, for some reason I thought it would make things louder by mixing but it looks like it makes thing quieter. But yeah it looks like Crossfeed has its own limiter that (at least for me) seems to clip when its input is > 0dB. So I think Crossfeed should never be supplied with >0dB input as it'll never output >0dB which means it makes sense to put the Limiter first imo. But I'm surprised that you're also seeing Crossfeed never outputting > 0dB and not hearing the clipping though, at least on my system playing the notification sound on a loop and toggling Crossfeed off and on when between the Equalizer and Limiter makes the notification sound very different.

Thanks for looking in to it! Your solution of moving Crossfeed after the Limiter works well for me and makes sense if it should never be provided >0dB input and always lowers the output.