Midi Overlay Panels in Compiled Plugin Crashing DAWS?
-
I have a simple test project where i use a Midi Player and 2 Floating Tiles (Midi Overlay Panels)...one of them is set to index 0 for drag n drop to DAW and the other is set to index 1 for visual representation of the loaded sequence.
I use also a Load button to load the midi file a play button for playback and 3 buttons (Half speed, Normal speed, and Double speed) to control playback speed.
Everything work as expected but the compiled plugin introduces problems (and finaly crash all DAWS that i tested).
For to be more precise on what i say the story is going like this...
In any DAW when you load the compiled plugin for the first time everything is working great...It opens as it should be with the Midi Overlay panels presented there...and not any midi file loaded...
Pressing the Load button the midi file is loaded, we have the sequence being presented to one of the midi Overlay Panels and "Drop Midi" to the other panel so it is ready for drag n drop.
The Play button and the 3 speed buttons working as expected and everything looks to be fine.
But if i close(unload) the plugin and load it again i get a crash in any DAW...
If i will not get an instant crash on the second load the plugin will be loaded without the Midi Overlay Panels...and it will stay like this (Without the Panels)...on every next load until it crashes the DAW...
The crash may happen on the second, or third, or fourth etc Load and it is tested on Mac and in all DAWS i use (Logic Pro X, Reaper, Studio One, Cubase).I narrowd my search on the problem and saw that if i delete the Midi Overlay Panels everything is ok without any crash...so the problem is the Midi Overlay Panels.
So guys if it is easy for some of you to compile the same project on your end we could see if it is a problem on my end or if it is a Midi Overlay Panel bug.
Here is the snippet
HiseSnippet 2542.3oc6Z0uaabiDeWauoQNwAIEEGt+jP3PfbcxZYGG633yHJVejnK1wBVJ4Zufhf06RIwlUja1kx0tAFHOJ8QoOB2iRdCtaH49AWIYYUiK4JtdKRr0RNC4uY3uYFJR2Jj4hihXgFlE5bV.1v7lVsOix6WsuCgZzrlg4MrNf3QZGfwdF6cVfSTD7ASy4elP.yBKXHe9zS1yw2g5hyZxv30LhKdex.BOq0VUdAw2ugiGtCYflzaTooKiVk4yFBfYdqxFANtuyoG9kNBwlyxv7Z08HbVXatCGGYXtvdLuyZ2m8STk7ulDQN1GKdYMi1v.oZtAy2SfXQqFU6S78ZkXzQFFlVsxbAyqbAeizhSaOyUbaYGnLMz8GlyMM3sl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A5Gv6rAh7DzLX7K5vHX3meXnSxyfwG0gQkS+OCLJviuOEELRNNUwQBKAysrzOgUMzT4X8E9tUhC3TQWes79ON7DbHvVTAQG2K4hito05OXis23Aat8VaaPf8uj0wFq+nsV6Aas85ORqi0i6Y8M2bixk2H9pFJaI21bwzbvM8J9XTxIQeOYeMod3SgVWCJ8kifeyY1pEmKslU+o.Mq133Qo6MGaMXieCNlaXs45k25gat81q+kwuTV3WZ.3qM4m0Rj9WpLgKu31VGv7F5KtND8aaSbEiwc.UjycAFhKofFQ3mk6Bo9bbEbyJbuiUKB2s+jw6bS.uha26yLdiuPykrp2sK1kmA1ErZ7ce9u8RcnbKETtgUa3qMHumGIP9Sx2Q+cnZE5YXJNT3TWaJWz7+bVun4fY9hlOzkCSe7AFGoOvUZiGP5.w052nmwqhvMBwu+Hwprd6UYv16mTWe5IM.ibh5zVrieIc4oCXCo4t3uQue0ElsMXdI2n7B+t9Bu+xkbX9YCtSvCZ1Zr+pItMPiGD3iqSOA6C6JThwuF1FXWmg97jVyyqOfQYA8YThq9h9QXdHoWObnN1mnA8TNO2E3+MUNB6ichxkrcef34DB9I7UzWr1r6Kl150e1RAWjHXD8+FI0m+OlI0OhMTr4kCb.h5op+lGZC4RcwhaZC1zg3qBaNmHen58xIeOt1Xpm7k+E7D24Zh2Mi6bsjN+hLGCbbCYuM9l6Db4qKaArap7O.jBVGHdGsV52F0prcYCwc48VWWg699f+Yx5r9UPmGbEzYiqfNO7JnylWAc15JnyilpNhhQOcHmMPEJBMzptZiolo+cKYNuw+FZJq5qA
and here is the midi file
BasicGroove1.midalthough i suppose any midi file will be ok to test
I am working on Develop Branch
-
Thanks @DimitrisSP
Could You Please Let Me Know What Commit You're Using?
Latest Ones Won't Build Here :/ -
@Natan Hi my friend.
I build this version of Hise on 3 September
I am not sure if it was the commit of 3 September (and i also had some compiling problems with some commits) so it is maybe the commit of 1 September if not 3 September.
-
New information...I compiled the latest commit of 6 September and nothing changed...i have crashes exactly like before.
-
Unfortunately it seems that i can't confirm 100% if it is a Midi Overlay Panel bug (because noone of the forum had the time to test it in his system)...although i am almost sure that it is a bug (if i delete the Midi Overlay Panels and compile the test plugin everything is ok without any crash)...but then it's impossible to use the drag'n'drop to DAW functionality...so dead end.
@Christoph-Hart could you please check if it is happening the same way in your system...and if so...is there a solution on this problem?
-
@DimitrisSP Bump bump.
Did anyone has test it? If it is finaly a bug it will affect anyone who uses midi files in his plugin and wants to have the functionality of Drag to DAW or any other Midi Overlay functionality.@Christoph-Hart please take a look at the problem...if it's finaly a bug it tends to be a very serious problem for this kind of plugins.
-
I can confirm what @DimitrisSP is saying about the second time loading the compiled plugin, the midi overlay panel is not visible!
I don't get a crash like Dimitris does but as I said, the Midi Overlay Panel is not visible, so it's not usable I'm afraid.
@Christoph-Hart I know you are occupied with a lot of other stuff, but could we please get a fix for this?
-
Just narrowed my crashes down to this issue. It's replicable in any project with a "MidiOverLayPanel" Floating Tile.
HiseSnippet 1154.3ocyW0saaaCElxNrq1soqsnXX6NgfcQJPVgURVR11E0I1wEFK+XDklt6JXjN1lHRjpTTIwnn.C6IqOB6QXOB8Mn6PI+iTpqgmQV27EFhmeD+N+vOdTGkzChikJhUkSGDADq6ScGHz8azmwEj1MIVeGMjK3gr.a4kfJfMvFtlEFE.j8FDwhiAehkU4WXL2pxRjzee346wBXBOXhHB4LI2CNfGx0Sj1o9uxCBZw7gS4g4rdy5s8jhFx.YBBsxzZjHl2ErdvQLiYknDq6ruOWKUtZlFhIVKsmzefae4UhL6OiGyOGAItvg3hunLwsjA9FDajRZzmG32YTJHlPrncljPJmkPdB8PtOer7IIlGlpvdhG4yGVkJBuxEfmSd3UKG7lBjJkCRe0nZTJjvZAnRgxCnG1tYa6LINE.RiDkBDZW3MIvMJHCUcpBSs4qcGHkQ6KXH77yK171OGM0MBJpvp7bGqNyLVIlvpEO.LOmKrWJKreD00SwizSzXh86QaKzfpKyqXGYlsDq2SaHQCD5mExt.ZovEicX0spUaMa7um9KcSDdZtTXKEGI0vwhUeZ02VsR02U09lp51cp5LaiRFD.pop1zfqlkiqJRBOGTqYeIKHAFaHF9ESuz4K85kE04LTJZK35ii.wmq+mLLUgO8x1MYZF1+YMTFZWDnzbCDrZBWhGlyJKUnMg3KzxHrWsgLLRJLuAq6nS0t7nhFS.ADNVZtKM8YGx04aFGjewUbec+wBd+eTuOv60WmWBI2Vsrd3I0rspUfjo4hdmhcRo63WSyKpvF6WexFWGpOLVyBrGmdL63LVuL7eduQbRUtSylM+nwMtFBGI89zMWemsc1X6eZ8cxoX8gZVeqs1rVsMIooVqinusps8JiK.s8W4msWI+I4UVyXPagObMppV5JjAKPd0qjpKhQNQ.kqUIP02cij1eEcyj1ueV8IHZi7QfFtV+ow0TNAhTdR+j.ltHOng7enBritvoPyQMQLWOn.gQoYwc+YIGmM287B2GQ6v0d8mNdKME7Z3f+WFuCupYY59c6Bd5IfcIZqeal2qbqCkGjAk6Qc4BHcTfTf7MoqseE6Rv9Ef.TljpyLFA3Om2Q.hl6Q.N1SiaOdckHNRFW3E6Bg7SQ1f37BeYLR2Cu4DSUtv8dRlZpp9vyagA4T8wkoSTosK6FJSD5BsGkm6Zx+fQQV5+cih7kiPXwmVxpymLQ6CwVWy7p6KtDBv6vRw3iwKs5xRBzijVrW9PoPF0WJ3d4Kzm.ZEuWOPkG6SMf1UqKLT0SpeBD.r7Msee8CvlMlBySvBlKbl+bwrpWeKMCt1lCf1+mT2tUHuKOWj22JXbwIrW7s+DYhYDlCYXSHNAC8njPWjazCvcWfCmXFMzpjgeKacMy5LxQge5hOh+Fpzwr1ZnRmQJ+hrGgLOk70dYC8Z5SuapDLtEoebWE5gl01NjzAgQ+n0dVMRHxv8ZOOSJ9GPByo6y5KfOar.9r4B3yOt.9r0B3y1KfO6LSeLWtrahVFlcjCEzY+rQXsF+chVkI+MH3xKMC
*1st instance in DAWs: works fine.
Close+reopen: the MidiOverLayPanel fails.
Close+reopen again: DAW crashes.*
In larger projects with presets/midi file menus/etc, the bug becomes prominent enough that it crashes HISE reliably. In DAWs that save plugin states, the plugin can become unusable in end users' saved projects. All of those problems vanish when the MidiOverLayPanel is removed.
I hope to see this one get resolved. The Drag & Drop tile is an important element, and the other midi tiles are a great alternative to connectToPanel code.
-
Im testing a project build with the latest develop branch with two Midi Overlay Floating tiles with the update after init set to off, im cleaning all the midi sequences on init as well and loading them to the Midi Player from the expansion callback, seems to be working (at least for me) since the timeline simulator function was implemented, I can open a lot of instances of the same plugin, an copying with out crashing... however, if you I open another plugin made with earliest versions of hise sometimes it crashes, I updated every project and no problems for now, tested on Logic and Reaper only.
-
@Soundavid That sounds great. How are you cleaning the midi sequences on init? I couldn't find anything in the API regarding the MidiPlayer's "clear all" button, closest thing I spotted was Engine.clearMidiFilePool();
-
@Goodflow Im just Calling this On init
MIDIPlayer1.setFile("", true, false);
-
@Soundavid Thank you, I somehow got it into my head that setFile wouldn't work without a file name.
Unfortunately, the problem persists. I also just compiled my earlier snippet with updateAfterInit disabled + no midi file/sequence present, and am getting the same crash.
Just to clarify, the crashes aren't occurring when opening a second (or third, or 10th) instance of the compiled plugin. Are you able to load your plugin onto a channel, remove it, then load the same plugin back into that same channel without any errors?
-
@Goodflow Yes I can remove it and load it again, Im going to check my project and do some tests because I remember setting the floating tile to Empty and calling the MIDI Player and Index data with the setPropertiesFromJSON from the expansion Callback, maybe that's why is not crashing when the plugin loads but im going to make deeper tests with expansions.
-
@Soundavid That's an elegant way of going about it. I tried this with a preset callback, and it definitely pushes the problem off of initialization in my project.
Added:
- Changed the Tile to "Empty", removed all data.
- Added a preset setPostCallBack to enable/show/set ContentType and Data for the Tile (unless it's the "init" preset, which clears/disables/hides the Tile)
- tested with "UpdateAfterInit" enabled, disabled, and with it toggled via the setPostCallback
- tested with & without an onInit call to load the "init" preset, just to ensure that everything gets cleared.
Ultimately, the problem shows back up when
- The plugin is loaded
- A preset is loaded
- The plugin is removed and loaded again
- A preset is loaded
Hopefully that's not the case with your project/method. It just seems like no matter where the MidiOverlayPanel is fired up, something lingers on close and breaks on the next loaded MidiOverlayPanel.
-
@Goodflow Ok I debugged a lot this problem and I think I found the culprit... the problem persisted in my project when i called an expansion that loads the Midi Overlay and this is what I found.
-
The Plugin Crashes when is removed and loaded again but only if there is one instance running.
-
If you have multiple instances and remove/load the plugin works fine but when you remove the last one and try to load it again it crashes.
This means that the problem is when the plugin is closed completely so I checked the Midi Overlay Factory class in the source code and I found that the class is derived from the DeletedAtShutdown class from JUCE, this class deletes everything when the app is closed but maybe JUCE doesn't call this in plugins until the last instance is closed...
So, I removed the DeletedAtShutdown from the Midi Overlay Factory class in the Source code of the plugin (not re-building hise) and the problem disappears in the plugin...
I tested the plugin today in Logic checking memory and Cpu loads and works perfectly for now but maybe this could be a problem with another type of Midi Overlays or using the Standalone App or Windows (im using two MO tiles, Drag n drop and Midi Viewer).
@Christoph-Hart Maybe you might want to check this out
-
-
@Soundavid I was just going through the .h file doing the complete opposite, moving code INTO the DeletedAtShutdown class line by line. You just saved me hours of wheel-spinning, I can't thank you enough.
Trying this out now.
-
@Soundavid Can confirm this worked for me in the plugin. Also tried recompiling HISE with the change, and it's more stable in handling the project now
Thoroughly crash tested the midi note display and drag&drop, all good. The other MidiOverlayPanels seem to work smoothly from cursory checks, as well.
-
@Goodflow Its working like charm for me too in my system, Im going to build it on windows today and report
-
@Soundavid All good on Windows here so far (tested HISE & plugin). Firing up a Linux vm to complete the trifecta, but this really seems to have done the trick.
-
@Soundavid said in Midi Overlay Panels in Compiled Plugin Crashing DAWS?:
@Goodflow Ok I debugged a lot this problem and I think I found the culprit... the problem persisted in my project when i called an expansion that loads the Midi Overlay and this is what I found.
-
The Plugin Crashes when is removed and loaded again but only if there is one instance running.
-
If you have multiple instances and remove/load the plugin works fine but when you remove the last one and try to load it again it crashes.
This means that the problem is when the plugin is closed completely so I checked the Midi Overlay Factory class in the source code and I found that the class is derived from the DeletedAtShutdown class from JUCE, this class deletes everything when the app is closed but maybe JUCE doesn't call this in plugins until the last instance is closed...
So, I removed the DeletedAtShutdown from the Midi Overlay Factory class in the Source code of the plugin (not re-building hise) and the problem disappears in the plugin...
I tested the plugin today in Logic checking memory and Cpu loads and works perfectly for now but maybe this could be a problem with another type of Midi Overlays or using the Standalone App or Windows (im using two MO tiles, Drag n drop and Midi Viewer).
@Christoph-Hart Maybe you might want to check this out
I have the same crash and I want to try your solution but I'm a little bit confused about what to delete where to delete? Can you point it more clear for a newby please?
-