HISE Logo Forum
    • Categories
    • Register
    • Login

    Help with: Buffer_Not_Writeable_By_vImage

    Scheduled Pinned Locked Moved General Questions
    18 Posts 2 Posters 706 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.
    • Dan KorneffD
      Dan Korneff @Christoph Hart
      last edited by

      @Christoph-Hart should I try to cherry pick this JUCE commit? I'm not sure how different the message system is between 6 and 7....

      Dan Korneff - Producer / Mixer / Audio Nerd

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @Dan Korneff
        last edited by

        @Dan-Korneff nice find! Yes, please try to cherry pick this, if it works, it would be awesome.

        Dan KorneffD 1 Reply Last reply Reply Quote 0
        • Dan KorneffD
          Dan Korneff @Christoph Hart
          last edited by

          @Christoph-Hart I tried.. 😖

          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(295,22): error C2065: 'lock': undeclared identifier (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(300,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(300,26): error C2146: syntax error: missing ';' before identifier 'scope' (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(300,26): error C2065: 'scope': undeclared identifier (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(393,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(393,22): error C2146: syntax error: missing ';' before identifier 'scope' (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(393,22): error C2065: 'scope': undeclared identifier (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(409,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ..\..\JuceLibraryCode\i
          nclude_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(409,22): error C2146: syntax error: missing ';' before identifier 'scope' (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          
          HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(409,22): error C2065: 'scope': undeclared identifier (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
          

          Looks a bit more involved.

          Dan Korneff - Producer / Mixer / Audio Nerd

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @Dan Korneff
            last edited by

            @Dan-Korneff alright, I‘ll take a look.

            Dan KorneffD 1 Reply Last reply Reply Quote 1
            • Dan KorneffD
              Dan Korneff @Christoph Hart
              last edited by

              @Christoph-Hart greatly appreciated !

              Dan Korneff - Producer / Mixer / Audio Nerd

              Christoph HartC 1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @Dan Korneff
                last edited by

                @Dan-Korneff OK, I've manually patched the files (and I needed to pull in another class from JUCE 7 to compile), however now I'm hitting a few weird assertions that I didn't before so I'm a bit uncomfortable pushing this "fix" - it might be possible that there are other changes to JUCE 7's message handling and this would be a Frankenstein thing.

                Christoph HartC 1 Reply Last reply Reply Quote 2
                • Christoph HartC
                  Christoph Hart @Christoph Hart
                  last edited by

                  @Christoph-Hart Following the JUCE discussion, this might be a "better" fix (in the sense that it's less intrusive than the JUCE 7 fix):

                  https://forum.juce.com/t/blockingmessage-accessing-messagemanager-lock-that-went-out-of-scope/51901

                  Dan KorneffD 3 Replies Last reply Reply Quote 1
                  • Dan KorneffD
                    Dan Korneff @Christoph Hart
                    last edited by

                    @Christoph-Hart I can give this a try:

                            if (blockingMessage != nullptr)
                             {
                              {
                             ScopedLock lock(blockingMessage->ownerCriticalSection);
                                 blockingMessage->owner.set(nullptr);
                              }
                                 blockingMessage->releaseEvent.signal();
                                 blockingMessage = nullptr;
                             }
                    

                    Dan Korneff - Producer / Mixer / Audio Nerd

                    1 Reply Last reply Reply Quote 0
                    • Dan KorneffD
                      Dan Korneff @Christoph Hart
                      last edited by

                      @Christoph-Hart Do you have any plans to eventually bump to JUCE 7?

                      Dan Korneff - Producer / Mixer / Audio Nerd

                      1 Reply Last reply Reply Quote 0
                      • Dan KorneffD
                        Dan Korneff @Christoph Hart
                        last edited by Dan Korneff

                        @Christoph-Hart Does this look right? It's throwing a bunch of errors.

                        void MessageManager::Lock::exit() const noexcept
                        {
                            if (blockingMessage != nullptr)
                            {
                                {
                                    ScopedLock lock(blockingMessage->ownerCriticalSection);
                                    blockingMessage->owner.set(nullptr);
                                }
                                blockingMessage->releaseEvent.signal();
                                blockingMessage = nullptr;
                            }
                        
                            const ScopeGuard scope{ [&] { blockingMessage = nullptr; } };
                        
                            blockingMessage->stopWaiting();
                        
                            if (!blockingMessage->wasAcquired())
                                return;
                        
                            if (auto* mm = MessageManager::instance)
                            {
                                jassert(mm->currentThreadHasLockedMessageManager());
                                mm->threadWithLock = {};
                            }
                        }
                        

                        EDIT: operator error. This works:

                        void MessageManager::Lock::exit() const noexcept
                        {
                            if (lockGained.compareAndSetBool (false, true))
                            {
                                auto* mm = MessageManager::instance;
                        
                                jassert (mm == nullptr || mm->currentThreadHasLockedMessageManager());
                                lockGained.set (0);
                        
                                if (mm != nullptr)
                                    mm->threadWithLock = {};
                        
                                if (blockingMessage != nullptr)
                                {
                                    {
                                        ScopedLock lock(blockingMessage->ownerCriticalSection);
                                        blockingMessage->owner.set(nullptr);
                                    }
                                    blockingMessage->releaseEvent.signal();
                                    blockingMessage = nullptr;
                                }
                            }
                        }
                        

                        Testing now

                        Dan Korneff - Producer / Mixer / Audio Nerd

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

                        32

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        102.8k

                        Posts