Logic Pro's AU "validation" nonsense

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Error 4099 whats that? Any documentation for this stuff?

Post

camsr wrote: Mon May 08, 2023 5:52 pm Error 4099 whats that? Any documentation for this stuff?
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?

Post

Error 4099 whats that? Any documentation for this stuff?
- There seems no docmentation for error/crash codes in auval. I didn't find anything either.
I don’t know how to debug this.
- Since Big Sur it is not longer possible to debug auval without seriously messing around with your operating system security
So, what can I do here?
- 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.
https://www.tone2.com
Our award-winning synthesizers offer true high-end sound quality.

Post

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.
It doesn't crash auval - or anything else - it just says it failed validation.

So, how do you debug something that WORKS?

Post

Fender19 wrote: Mon May 08, 2023 9:18 pm
camsr wrote: Mon May 08, 2023 5:52 pm Error 4099 whats that? Any documentation for this stuff?
Not that I can find and I’ve searched Google with zero success.
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.

Post

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

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?

Post

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.
My audio programming blog: https://audiodev.blog

Post

Fender19 wrote: Tue May 09, 2023 4:47 pm
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.
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.

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

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.

Post

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.
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.
Follow me on Youtube for videos on spatial and immersive audio production.

Post

Thanks for that answer. I am just going to assume it's correct because the source is unaffiliated. However, doesn't gpt also cite sources if asked?

Post

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.

Post

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?
There's not much hope Apple will do much about it. So it needs fixing elsewhere.

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. Image
My MusicCalc is served over https!!

Post

If it passes on x86 and fails on M1, it's another strong hint that there's some kind of undefined behavior somewhere
Check out if all variables are initialized properly.
the audio channel setup
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.
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.

Post

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.

Post

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?

Post Reply

Return to “DSP and Plugin Development”