HISE Logo Forum
    • Categories
    • Register
    • Login

    Midi Overlay Panels in Compiled Plugin Crashing DAWS?

    Scheduled Pinned Locked Moved Bug Reports
    22 Posts 6 Posters 2.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DimitrisSPD
      DimitrisSP @DimitrisSP
      last edited by

      @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.

      1 Reply Last reply Reply Quote 1
      • ulrikU
        ulrik
        last edited by

        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?

        Hise Develop branch
        MacOs 15.3.1, Xcode 16.2
        http://musikboden.se

        GoodflowG 1 Reply Last reply Reply Quote 0
        • GoodflowG
          Goodflow @ulrik
          last edited by

          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.YBBsxzZjHl2ErdvQLiYknDq6ruOWKUtZlFhIVKsmzefae4UhL6OiGyOGAItvg3hunLwsjA9FDajRZzmG32YTJHlPrncljPJmkPdB8PtOer7IIlGlpvdhG4yGV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WE5gl01NjzAgQ+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.

          1 Reply Last reply Reply Quote 0
          • S
            Soundavid
            last edited by

            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.

            GoodflowG 1 Reply Last reply Reply Quote 1
            • GoodflowG
              Goodflow @Soundavid
              last edited by

              @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();

              S 1 Reply Last reply Reply Quote 0
              • S
                Soundavid @Goodflow
                last edited by Soundavid

                @Goodflow Im just Calling this On init

                MIDIPlayer1.setFile("", true, false);
                
                GoodflowG 1 Reply Last reply Reply Quote 1
                • GoodflowG
                  Goodflow @Soundavid
                  last edited by

                  @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?

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    Soundavid @Goodflow
                    last edited by

                    @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.

                    GoodflowG 1 Reply Last reply Reply Quote 1
                    • GoodflowG
                      Goodflow @Soundavid
                      last edited by

                      @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.

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        Soundavid @Goodflow
                        last edited by

                        @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 :backhand_index_pointing_up:

                        GoodflowG M 3 Replies Last reply Reply Quote 2
                        • GoodflowG
                          Goodflow @Soundavid
                          last edited by

                          @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.

                          1 Reply Last reply Reply Quote 0
                          • GoodflowG
                            Goodflow @Soundavid
                            last edited by

                            @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 :folded_hands:

                            Thoroughly crash tested the midi note display and drag&drop, all good. The other MidiOverlayPanels seem to work smoothly from cursory checks, as well.

                            S 1 Reply Last reply Reply Quote 1
                            • S
                              Soundavid @Goodflow
                              last edited by

                              @Goodflow Its working like charm for me too in my system, Im going to build it on windows today and report :crossed_fingers_medium-light_skin_tone:

                              GoodflowG 1 Reply Last reply Reply Quote 0
                              • GoodflowG
                                Goodflow @Soundavid
                                last edited by

                                @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.

                                1 Reply Last reply Reply Quote 0
                                • M
                                  mehmethand @Soundavid
                                  last edited by

                                  @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 :backhand_index_pointing_up:

                                  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?

                                  GoodflowG 1 Reply Last reply Reply Quote 0
                                  • GoodflowG
                                    Goodflow @mehmethand
                                    last edited by

                                    @mehmethand

                                    HISE/hi_components/midi_overlays/MidiOverlayFactory.h

                                    Line 40:

                                    class MidiOverlayFactory: public DeletedAtShutdown
                                    

                                    gets changed to

                                    class MidiOverlayFactory
                                    
                                    M 1 Reply Last reply Reply Quote 1
                                    • M
                                      mehmethand @Goodflow
                                      last edited by

                                      @Goodflow thank you so much.

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post

                                      16

                                      Online

                                      1.7k

                                      Users

                                      11.8k

                                      Topics

                                      102.4k

                                      Posts