Logic Pro's AU "validation" nonsense
-
- KVRian
- Topic Starter
- 641 posts since 30 Aug, 2012
Not that I can find and I’ve searched Google with zero success.
I don’t know how to debug this. The plugin does not crash auval, or Logic or any other DAW and seems to run in Logic without any issues (after sidestepping validation). It also passes every test of Tracktion’s Pluginval tool on level 10.
So, what can I do here? How do I fix what everything but Logic 10.7.7 says is not broken?
- KVRAF
- 1752 posts since 2 Jul, 2018
- There seems no docmentation for error/crash codes in auval. I didn't find anything either.Error 4099 whats that? Any documentation for this stuff?
- Since Big Sur it is not longer possible to debug auval without seriously messing around with your operating system securityI don’t know how to debug this.
- Let the plugin create a log file. Then check out where to log file stops. This is the location in your plugin where it crashed during auval.So, what can I do here?
https://www.tone2.com
Our award-winning synthesizers offer true high-end sound quality.
Our award-winning synthesizers offer true high-end sound quality.
-
- KVRian
- Topic Starter
- 641 posts since 30 Aug, 2012
It doesn't crash auval - or anything else - it just says it failed validation.Markus Krause wrote: Tue May 09, 2023 6:26 am - Let the plugin create a log file. Then check out where to log file stops. This is the location in your plugin where it crashed during auval.
So, how do you debug something that WORKS?
-
- KVRAF
- 2814 posts since 26 Jul, 2015 from Philadelphia
I don't want to be a smart-ass, but using Google for this purpose isn't really getting you anywhere anymore these days. Here is what ChatGPT 4.0 had to say:
The "ERROR: 4099 IN CALL" message you're seeing is likely a system error code indicating a specific type of failure. In the context of macOS and iOS development, error 4099 is often associated with a failed inter-process communication, typically due to an XPC connection.
XPC is a low-overhead interprocess communication mechanism that can be used to organize an app’s code into reusable services. It allows for the transfer of data between processes and can manage resources for you, restarting services when necessary.
When your plugin attempts to establish a channel for the audio data, it seems to be unable to do so, hence the error message.
However, note that this is a bit of an educated guess as the error codes can depend on the context in which they are used and the specifics of the implementation. The precise meaning might vary between different APIs, systems, or even versions of the same API.
As a plugin developer, you should look into the part of your code where the audio channel setup is happening, as the error seems to indicate an issue at this point. Also, ensure that all necessary resources for inter-process communication are available and working as expected. The problem might also be related to permissions or sandboxing, depending on the specifics of your implementation and the environment in which the plugin is running.
If you're using Apple's Audio Unit framework, you should also check the official documentation or any associated header files for any potential hints about this specific error code. Sometimes, these resources provide specific descriptions of error codes and their meanings.
Follow me on Youtube for videos on spatial and immersive audio production.
-
- KVRian
- Topic Starter
- 641 posts since 30 Aug, 2012
Thank you for that info however the plugin DOES establish channels and it processes audio. It fails validation - but it works. THAT is the issue.mgw38 wrote: Tue May 09, 2023 4:11 pm When your plugin attempts to establish a channel for the audio data, it seems to be unable to do so, hence the error message.
I have now tested it on Logic 10.7.7 (complaining user's version) in Monterey on Intel Mac and it validates and runs without any issues. So it seems this is an ARM/M1-only problem and only with Logic (it works in other DAWs on M1).
This plugin was built from a framework and compiler settings I have used to build a dozen other plugins that work properly everywhere - so what could it be? Again, how do you debug something that WORKS? Since it doesn't crash or fail in some way how do I find the problem?
- KVRist
- 100 posts since 2 Jul, 2021 from Netherlands
That ChatGPT answer is a lot of words for pretty much zero information. I'm curious what the prompt was that you used.
For Mac / iOS error codes in general, there is https://www.osstatus.com but that doesn't have all error codes, only the ones that could be obtained from public headers etc. Note that `strings /usr/bin/auval | grep -i error` gives `ERROR: %d IN CALL %s` so that's a very generic error message.
For Mac / iOS error codes in general, there is https://www.osstatus.com but that doesn't have all error codes, only the ones that could be obtained from public headers etc. Note that `strings /usr/bin/auval | grep -i error` gives `ERROR: %d IN CALL %s` so that's a very generic error message.
My audio programming blog: https://audiodev.blog
-
- KVRAF
- 2814 posts since 26 Jul, 2015 from Philadelphia
It has been a while since I did heavy coding (I started my academic career as a CS Prof at a research University but have since moved on to other disciplines). My point was that you debug this with the help of coding agents.Fender19 wrote: Tue May 09, 2023 4:47 pmThank you for that info however the plugin DOES establish channels and it processes audio. It fails validation - but it works. THAT is the issue.mgw38 wrote: Tue May 09, 2023 4:11 pm When your plugin attempts to establish a channel for the audio data, it seems to be unable to do so, hence the error message.
I have now tested it on Logic 10.7.7 (complaining user's version) in Monterey on Intel Mac and it validates and runs without any issues. So it seems this is an ARM/M1-only problem and only with Logic (it works in other DAWs on M1).
This plugin was built from a framework and compiler settings I have used to build a dozen other plugins that work properly everywhere - so what could it be? Again, how do you debug something that WORKS? Since it doesn't crash or fail in some way how do I find the problem?
Programming languages are just languages, which is why formal training in CS usually includes introductory theory in linguistics. Large Language Models are incredibly good interpreting languages and therefore also programming languages.
For debugging you would simply use a coding agent (does not have to be GPT4, there are plenty out there these days). You start a conversation with the agent in the same way you would start a conversation with a fellow coder. And you would continue that conversation until you reach a conclusion.
In order to get to the above statement I needed to have a bit of a back and forth with ChatGPT. The next step most likely would be to show it your code and simply ask if it finds anything that could trigger that error. It is very well possible that parts of your code are non-compliant in a way that just did not cause any issues yet.
Once again, I did not want to come across as a smart-ass. If I do, my apologies. But if you are not integrating coding agents into your debugging workflow at this point, you will have challenging times ahead of you.
Follow me on Youtube for videos on spatial and immersive audio production.
-
- KVRAF
- 2814 posts since 26 Jul, 2015 from Philadelphia
It was an entire conversation. Took only about 5 minutes though. This is as far as I could take it without actually knowing the code. In general, this would only be the start of the debugging session.kerfuffle wrote: Tue May 09, 2023 7:00 pm That ChatGPT answer is a lot of words for pretty much zero information. I'm curious what the prompt was that you used.
Follow me on Youtube for videos on spatial and immersive audio production.
- KVRist
- 362 posts since 1 Apr, 2009 from Hannover, Germany
It says "Problem with initial Channel layout state", so I would focus on anything to do with channel layouts (again: "it works" does not imply bug-freedom). Do some oldschool log debugging and add log outputs to the most important functions (things like ctor/dtor, prepareToPlay, reset, process etc., at the start and end of those functions, probably including inputs and results, maybe some states). That will tell you roughly what happens right before auval exits, and give you a hint on what the test routine actually does.
If it passes on x86 and fails on M1, it's another strong hint that there's some kind of undefined behavior somewhere, maybe you're making some assumption that only holds on Intel (memory layout, order of execution, that kind of stuff). Even if it "works" (= you're lucky), it can break anytime even due to a totally unrelated change. It's a good thing that such kind of stuff can surface earlier with a test tool.
If it passes on x86 and fails on M1, it's another strong hint that there's some kind of undefined behavior somewhere, maybe you're making some assumption that only holds on Intel (memory layout, order of execution, that kind of stuff). Even if it "works" (= you're lucky), it can break anytime even due to a totally unrelated change. It's a good thing that such kind of stuff can surface earlier with a test tool.
- KVRAF
- 16826 posts since 8 Mar, 2005 from Utrecht, Holland
There's not much hope Apple will do much about it. So it needs fixing elsewhere.Fender19 wrote: Tue May 09, 2023 4:47 pm I have now tested it on Logic 10.7.7 (complaining user's version) in Monterey on Intel Mac and it validates and runs without any issues. So it seems this is an ARM/M1-only problem and only with Logic (it works in other DAWs on M1).
This plugin was built from a framework and compiler settings I have used to build a dozen other plugins that work properly everywhere - so what could it be?
Remove as much code as you can from this project while it still fails validation on Apple Silicon.
File a bug report to the framework builder, attach that "Hello AU Validation" project and let them figure it out.
We are the KVR collective. Resistance is futile. You will be assimilated. 
My MusicCalc is served over https!!
My MusicCalc is served over https!!
- KVRAF
- 1752 posts since 2 Jul, 2018
Check out if all variables are initialized properly.If it passes on x86 and fails on M1, it's another strong hint that there's some kind of undefined behavior somewhere
I had an issue like you with Steinberg's VST 3.7 SDK (natively) running as a SingleComponent when exporting to AudioUnit. The VST3 SDK has many bugs. It took me one year to find out what was happening. It was highly annoying as I lost income because I was not able to ship the product with AUv2.the audio channel setup
If you use this combination I can send you my code that fixed it.
https://www.tone2.com
Our award-winning synthesizers offer true high-end sound quality.
Our award-winning synthesizers offer true high-end sound quality.
- KVRAF
- 8489 posts since 12 Feb, 2006 from Helsinki, Finland
Have you tried AddressSanitizer (compile with -fsanitize=address)? That should (usually; ASan might be marginally less reliable than valgrind, but sadly I don't think valgrind works with recent versions of macOS anymore) tell you if it's a memory issue or a logical bug.
-
- KVRian
- Topic Starter
- 641 posts since 30 Aug, 2012
Well - to add to the frustration - I've asked some new beta testers to try the plugin in Logic on their M1 machines and - like here - it works! Validates and runs. No issues.
So now the bigger question - why does it PASS validation on some M1's but FAIL on others?
Another thing I noticed is this plugin requires REBOOT before Logic sees it. Other plugins I have written are visible right away. My "installation" process is to simply copy and paste (or drag) the plugin.component file from the notarized DMG bundle to the user's plugins/components folder (no "installer", no registration/system commands, etc.). I've been using this simple method for years with no issues.
I updated Xcode and my OS recently - did Apple change something here?
So now the bigger question - why does it PASS validation on some M1's but FAIL on others?
Another thing I noticed is this plugin requires REBOOT before Logic sees it. Other plugins I have written are visible right away. My "installation" process is to simply copy and paste (or drag) the plugin.component file from the notarized DMG bundle to the user's plugins/components folder (no "installer", no registration/system commands, etc.). I've been using this simple method for years with no issues.
I updated Xcode and my OS recently - did Apple change something here?
