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

                            8

                            Online

                            1.7k

                            Users

                            11.8k

                            Topics

                            102.3k

                            Posts