-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLAME Butterworth Lowpass/Highpass (Lv2 versions) generate damaged audio #5767
Comments
Got a backtrace LogsClick to expand
|
@zonkmachine Many thanks for the backtrace! Is line 243 in iir.h for you
this one? (I think |
Upstream issue that could be related: swh/lv2#2 |
Yes. https:/swh/lv2/blob/master/util/iir.h#L243
|
I also got a different crash with the same test. Just adding a GLAME Butterworth Lowpass filter to the default project 3osc and hitting the test key. This second case was from swh-lv2 master. LogsClick to expandThread 13 "Mixer::fifoWrit" received signal SIGFPE, Arithmetic exception. [Switching to Thread 0x7fffbd5ad700 (LWP 94108)] 0x00007fffebd148ba in runButtlow_iir () from /home/zonkmachine/.lv2/butterworth-swh.lv2/plugin-Linux.so (gdb) bt full #0 0x00007fffebd148ba in runButtlow_iir () at /home/zonkmachine/.lv2/butterworth-swh.lv2/plugin-Linux.so #1 0x000055555583af31 in lilv_instance_run(LilvInstance*, uint32_t) (instance=0x55555a0092c0, sample_count=256) at /usr/include/lilv-0/lilv/lilv.h:1704 #2 0x000055555583c4ce in Lv2Proc::run(short) (this=0x555559f94250, frames=256) at /home/zonkmachine/builds/lmms/src/core/lv2/Lv2Proc.cpp:328 #3 0x000055555583269b in Lv2ControlBase::run(short) (this=0x7ffff2b20c08, frames=256) at /home/zonkmachine/builds/lmms/src/core/lv2/Lv2ControlBase.cpp:148 c = std::unique_ptr = {get() = 0x555559f94250} __for_range = std::vector of length 2, capacity 2 = {std::unique_ptr = {get() = 0x555559f94250}, std::unique_ptr = {get() = 0x55555964b8f0}} __for_begin = std::unique_ptr = {get() = 0x555559f94250} __for_end = std::unique_ptr = {get() = 0x20} #4 0x00007fffbcc50c30 in Lv2Effect::processAudioBuffer(std::array*, short) (this=0x7ffff2b20660, buf=0x7ffff2a61860, frames=256) at /home/zonkmachine/builds/lmms/plugins/Lv2Effect/Lv2Effect.cpp:79 outSum = 4.6355744483413371e-310 corrupt = 85 d = 0 w = 0 #5 0x000055555578f880 in EffectChain::processAudioBuffer(std::array*, short, bool) (this=0x555559b10a70, _buf=0x7ffff2a61860, _frames=256, hasInputNoise=false) at /home/zonkmachine/builds/lmms/src/core/EffectChain.cpp:199 it = 0x55555a0cd638 moreEffects = false #6 0x0000555555827d5a in AudioPort::processEffects() (this=0x7ffff2aa5990) at /home/zonkmachine/builds/lmms/src/core/audio/AudioPort.cpp:97 more = false #7 0x00005555558286a2 in AudioPort::doProcessing() (this=0x7ffff2aa5990) at /home/zonkmachine/builds/lmms/src/core/audio/AudioPort.cpp:222 fpp = 256 me = false #8 0x00005555557a5a05 in ThreadableJob::process() (this=0x7ffff2aa5990) at /home/zonkmachine/builds/lmms/include/ThreadableJob.h:74 expected = ThreadableJob::ProcessingState::Queued #9 0x00005555557c623b in MixerWorkerThread::JobQueue::run() (this=0x555555ae5e00 ) at /home/zonkmachine/builds/lmms/src/core/MixerWorkerThread.cpp:84 job = 0x7ffff2aa5990 i = 2 processedJob = true #10 0x00005555557c64cb in MixerWorkerThread::startAndWaitForJobs() () at /home/zonkmachine/builds/lmms/src/core/MixerWorkerThread.cpp:157 #11 0x00005555557bddfe in Mixer::renderNextBuffer() (this=0x7fffec0032a0) at /home/zonkmachine/builds/lmms/src/core/Mixer.cpp:470 last_metro_pos = { = {m_ticks = -1, static s_ticksPerBar = 192}, m_timeLine = 0x0, m_currentFrame = 0, m_jumped = false} song = 0x555555e82170 currentPlayMode = Song::Mode_None p = { = {m_ticks = 0, static s_ticksPerBar = 192}, m_timeLine = 0x0, m_currentFrame = 0, m_jumped = true} playModeSupportsMetronome = false it_rem = {i = 0x7fffa80025f0} fxMixer = 0x7fffc4016060 #12 0x00005555557c0735 in Mixer::fifoWriter::run() (this=0x555558ff3230) at /home/zonkmachine/builds/lmms/src/core/Mixer.cpp:1274 buffer = 0x7fffa8004a50 b = 0x555555fbca40 frames = 256 |
I don't get the crash on swh-lv2 when I build it from master. I think this could have been fixed partially fixed here: It still hit us with crap data though, only no infinite number. I've disabled checking for nan on my build for now but we have some printf() statements in there still.
|
Does it work with different resonance values? Does valgrind detect anything, like an uninitialized read? |
I can't use valgrind. My computer is much too weak to work with it in a meaningful way. My attempts with different filter settings has so far been inconclusive. |
It works for me with dummy audio backend. Maybe If it doesn't work I can try valgrinding it, too. |
You mean somehting like this? If data output from valgrind rendering an lmms project is what you want I can let it run over night. You will have to give me the commands though.
|
If there were no lines starting with "==" between the start and "Bad data", then it already means there were no memory errors. 😢 |
As I understand it the ladspa and lv2 versions are supposed to be pretty much the same, right? When comparing the two there are differences. This specific example when applied to the Butterworth issue didn't make a difference but I think it's enough to suggest that the issue probably is in swh-lv2 for now as the other plugins just seem to work. I'm looking for where the filter coefficients are initialized to 0 but haven't found that place yet. https:/swh/ladspa/blob/0c94d096a2202c83dcb89b5b66bd6047cb0e98c7/util/iir.c#L86-L92 void free_iir_stage(iir_stage_t *gt){
int i;
for(i=0;i<gt->availst;i++)
if (gt->coeff[i]) free(gt->coeff[i]);
if (gt->coeff) free(gt->coeff);
if (gt) free(gt);
} https:/swh/lv2/blob/1aa77e5f443b16c5802beef5d5dc0d6075113d89/util/iir.c#L85-L91 void free_iir_stage(iir_stage_t *gt){
int i;
for(i=0;i<gt->availst;i++)
free(gt->coeff[i]);
free(gt->coeff);
free(gt);
} |
It's a good idea to compare LADSPA and LV2, but I can't find any difference from the sources that could be relevant. I still think it's a bug in our LV2 interface (maybe because this is a mono effect, and we are somehow routing the mono output in a wrong way to the LMMS stereo). |
I found what's going wrong: the |
Bug Summary
GLAME Butterwort Lowpass and Highpass (Lv2 versions) generate damaged audio in many cases. LADSPA versions work. Lv2 versions work in Audio. Conclusion: LMMS Lv2 implementation is broken.
Thanks to @IanCaio for reporting!
Steps to reproduce
Turn off speakers. Then use the effect and play any audio through them.
Expected behavior
Normal filter output.
Actual behavior
Corrupted audio. Can cause ear or speaker damage.
Affected LMMS versions
Master only.
The text was updated successfully, but these errors were encountered: