rncbc / qtractor

Qtractor - An Audio/MIDI multi-track sequencer
https://qtractor.org
GNU General Public License v2.0
495 stars 86 forks source link

commit 10dfd45 crashed when loading existing project #392

Closed suedwestlicht closed 6 months ago

suedwestlicht commented 1 year ago

commit 10dfd4593d15ef4f0ee5a23fc95a08fb3dceb72a Author: rncbc rncbc@rncbc.org Date: Sun May 14 12:02:17 2023 +0100

- Fixed a zero-day blunder that was keeping the real-time process
  cycle from having the uniform block-size of 64 frames per period;
  (thus, probably inefective since v0.9.30). (EXPERIMENTAL)

This commit crashes Qtractor immediately after loading the project I am working on. Returning to 6fd9182a00b13c7a3e42d0916898dfe087d2c8e6 fixes it.

rncbc commented 1 year ago

can you build for debug (cmake -DCMAKE_BUILD_TYPE=Debug ...) and watch for a stacktrace dump?

also, does it crash on every project you load or is there sth special with that one? and what buffer-size?

suedwestlicht commented 1 year ago

Maybe the compiler warning gives a hint, too. warning.txt dump.txt

rncbc commented 1 year ago

the compiler warning is of no consequence here (warning.txt)

the crash seems to be on some old JUCE plugin, KlangFalter? what happens if you don't use or activate that plugin?

suedwestlicht commented 1 year ago

Compiling the most recent DISTRHO-ports (klangfalter) doesn't help.

Inactivating klangfalter in the qtr-File with an text editor helps a bit. I can load the song. Activating a klangfalter instance immediately crashes Qtractor.

rncbc commented 1 year ago

definitely an issue with klangfalter; I suspect it doesn't support short periods/buffer-sizes (eg. 64 frames)

may you investigate on the klangfalter/juce source and tell what the heck is going in there?


JUCE Assertion failure in juce_AudioSampleBuffer.h:747
JUCE Assertion failure in juce_AudioSampleBuffer.h:596
suedwestlicht commented 1 year ago

These asserts are on multiple places, e.g. in a clear function and in an applygain function:

jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size);

I see these asserts in juce5, 6 and 7 header files.

rncbc commented 1 year ago

what happens if you comment out those jasserts?

but again, what's or was your nominal buffer-size?

also please. what happens if you change this line from 64 to 128? https://github.com/rncbc/qtractor/blob/10dfd4593d15ef4f0ee5a23fc95a08fb3dceb72a/src/qtractorAudioEngine.cpp#L70

suedwestlicht commented 1 year ago

Usually I use a jack_bufsize of 256.

When I delete the asserts then Qtractor crashes as well – except when I use a jack_bufsize of 64.

When I don't delete the asserts then Qtractor crashes even with a jack_bufsize of 64.

Changing BLOCK_SIZE to 128: no crash with jack_bufsize of 64 or 128, crash with 256

rncbc commented 1 year ago

but all crashes are due on klangfalter plugin and only right?

suedwestlicht commented 1 year ago

Yes. There are several other plugins in the session but only klangfalter crashes Qtractor when activated.

rncbc commented 1 year ago

I assume you're using the KlangFalter.lv2

what about the vst2 plugin version which I think is also bundled in distrho?

suedwestlicht commented 1 year ago

Yes it is: /usr/local/lib/vst/KlangFalter.so

But Qtractor doesn't recognize it, even after a rescan.

It's built with: cmake -DCONFIG_LV2_UI_GTKMM2=no -DCONFIG_VST3SDK=/home/hm/src/qtractor/vst3sdk ..

  Qtractor 0.9.33.18git.10dfd4.dirty (Qt 5.5.1)

  Build target . . . . . . . . . . . . . . . . . . .: release

  JACK Audio Connection Kit support  . . . . . . . .: yes
  ALSA MIDI Sequencer support  . . . . . . . . . . .: yes
  General audio file support (libsndfile)  . . . . .: yes
  Ogg Vorbis audio file support (libvorbis)  . . . .: yes
  MPEG-1 Audio Layer 3 file support (libmad) . . . .: yes
  Sample-rate conversion support (libsamplerate) . .: yes
  Pitch-shifting support (librubberband) . . . . . .: yes
  Beat-detection support (libaubio)  . . . . . . . .: yes
  OSC service support (liblo)  . . . . . . . . . . .: yes
  Archive/Zip file support (zlib)  . . . . . . . . .: yes
  IEEE 32bit float optimizations . . . . . . . . . .: yes
  SSE optimization support (x86) . . . . . . . . . .: yes
  LADSPA plug-in support . . . . . . . . . . . . . .: yes
  DSSI plug-in support . . . . . . . . . . . . . . .: yes
  VST2 plug-in support . . . . . . . . . . . . . . .: yes
  VST3 plug-in support . . . . . . . . . . . . . . .: yes
  CLAP plug-in support . . . . . . . . . . . . . . .: yes
  LV2 plug-in support  . . . . . . . . . . . . . . .: yes
suedwestlicht commented 1 year ago

I have to investigate what happened. There was a time when I could load vst plugins.

rncbc commented 1 year ago

indeed there's sth funky with the KlangFalter plugins: the lv2 does crash on small jack-buffer-sizes/periods; but the vst2 doesn't; however, the later may present a larger head-latency (>=1024) than its lv2 counterpart, when it runs on the same jack-buffer-size setting (>=128) and doesn't crash :(

suedwestlicht commented 1 year ago

I had old qtractor plugin programs in /usr/local/bin. I deleted them and now I can load vst plugins. Will investigate it tomorrow.

rncbc commented 1 year ago

maybe this would make no harm: qtractor >= 0.9.33.19git.58cbd3

just maybe, you tell me ;)

suedwestlicht commented 1 year ago

Partial successful. The crash is avoided but klangfalter's reverb sounds metallic. kick.mp3.zip

rncbc commented 1 year ago

ok. thanks. that's positive progress :)

now please try qtractor >= 0.9.33.20git.7f74de

suedwestlicht commented 1 year ago

Works. Thank you, Rui. klangfalter_ok.mp3.zip

rncbc commented 1 year ago

thanks, please report if you find any other glitch, most esp. re. inserts and aux-sends (which I believe you abuse of ;)

cheers