-
-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macOS] How to add fallbacks for AudioComponent
in a better way? (to fix build on 10.5)
#898
Comments
Hmm, Apple documentation may actually be wrong on this, which explains why I had no errors on 10.6 ppc. |
error: ISO C++ forbids declaration of 'AudioComponent' with no type [-fpermissive]
etc.AudioComponent
in a better way? (to fix build on 10.5)
@mackron I guess we have the fix in principle, we just need to decide how to add it in a neat way. |
The difference is that functions to use on 10.5 are from Core Services, not CoreAudio, like: https://developer.apple.com/documentation/coreservices/1516552-findnextcomponent Just to get a picture where we have related stuff, see: barracuda156@01aeaac |
Thanks. I'm actually not sure on the best solution to be honest. Apple is a platform that I lean on the community quite heavily so I'd be happy to take your advice. And I do indeed like to support old operating systems (miniaudio supports Windows 95) so I'm receptive to this change, just so long as there's no ill effects towards modern systems. |
@RJVB Could you take a quick look at this? Maybe you can suggest the right way to fix it. (I think you do not have 10.5 installed, but I can ask someone to run the build with a patch applied. The issue is not arch-specific and not related to 10.6 ppc.) |
A quick look isn't going to be of much help I'm afraid because all that makes me think is something like "erm, too complicated, too long a log to wade through, sorry, not concerned enough". 10.12+ is mentioned, so this application is presumably not going to build on 10.9 either ... but my system headers seem to define AudioComponent types?! If CoreServices.framework still exists on modern OS versions the simplest way to address the which-library question is to link it in unconditionally. Chances are it'll get pulled in at runtime anyway and even if not it shouldn't bite or add an impossible amount of overhead. The question to be answered first (don't think I've seen that here) is what those new/missing functions are used for in miniaudio, if they're indispensable and if so, how they can be replaced on older systems. I don't really know how to answer that (but there is a CoreAudio mailing list...) |
The draft PR you mentioned looks reasonable enough in concept to me. A few things are questionable, particularly this part:
Looks like a copy/paste error? Setting a function pointer called Regardless, if you like you can submit a PR and we can talk about it further from there. I won't have a way to test this personally though. |
@RJVB Thank you for responding!
It looks like Apple docs are wrong on that, and all (An unrelated issue on < 10.8 was fixed earlier in 6700c7e and with that the build worked fine on 10.6+.)
At least at the moment |
@mackron Yes, that was just a mechanical copy-paste (which is why I did not open a PR) simply to highlight instances to deal with. I have no idea of CoreAudio internals, will try to figure out how to make a reasonable fix. (I won’t be able to test it myself on 10.5, though perhaps I can artificially force a fallback to be used on 10.6 to see if that works. But in about two weeks time, since no access to the hardware until then.) |
This error is confirmed on 10.5.8 with gcc13/gcc14:
The build uses
miniaudio
from 88436b2 commit. As a matter of fact, that did work on my 10.6 ppc somehow, at least when the port was updated last time.It looks like
AudioComponent
andAudioComponentInstance
exit only on 10.12+:https://developer.apple.com/documentation/audiotoolbox/audiocomponent
https://developer.apple.com/documentation/audiotoolbox/audiocomponentinstance
Which means they cannot be present in 10.6 ppc either.
AudioComponentInstanceDispose
is supported in 10.6+, however, so probably exists in 10.6 ppc, but not in 10.5.8: https://developer.apple.com/documentation/audiotoolbox/1410508-audiocomponentinstancedisposeSee also: https://trac.macports.org/ticket/70289#comment:11 (and the log attached there).
@mackron Could you suggest how to address this in a better way?
The text was updated successfully, but these errors were encountered: