Skip to content
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

Fix AudioUnit linking #51

Merged
merged 4 commits into from
Jan 27, 2022
Merged

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Dec 9, 2021

Replaces / builds upon #49, see that discussion first.

In particular, I've reverted the linking on iOS, since there, the AudioUnit framework is not (and newer were) linkable, instead one should link to AudioToolbox.

Kinda weak source, but verified by looking at simulator runtimes (this is what I could find) for version 9.3 and 10.3, on both of these AudioUnit does not contain a dylib (unlike most other frameworks). Also, in all SDK versions it's missing an AudioUnit.tbd file (which describes e.g. which symbols the library exposes).

A quick tip: You can gain a lot of knowledge from looking at the headers from previous SDKs e.g. these for macOS or these for iOS (both links are non-official).

Copy link
Member

@simlay simlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Given that this issue popped up with rust nightly, let's add that to CI. Also, let's bump the version. Unclear if this is a breaking change or not. It'll get pushed to crates.io on merge.

@madsmtm
Copy link
Contributor Author

madsmtm commented Dec 17, 2021

I would argue that it isn't a breaking change, or at least, it's such a small one that it doesn't warrant a major version bump:

Remember, the headers that bindgen uses haven't changed, and so accordingly, the generated code haven't changed (apart from ordering); only the linking is different.

Of course, every change is observable; technically the user could have only enabled the audio_unit feature, and then expected the symbols (specifically just the symbols, not the bindgen-generated functions) from AudioToolbox to be available. In reality, nobody would be doing this.

(Also note that the first linking change was not something widely noticed the first time around, and was done in 0.2.5 -> 0.2.6).

@MichaelHills
Copy link
Contributor

@simlay looks like the requested changes have been made?

@madsmtm Also my apologies for ever changing this in the first place... at the time somewhere in the back of my mind I was thinking maybe I should just leave it alone, but the Apple documentation seemed crystal clear. Thanks for diving into it and figuring out the details. Next time I'll just tread lightly and not make arbitrary changes unless I have all the details figured out.

MichaelHills and others added 4 commits January 26, 2022 19:28
On iOS, the AudioUnit framework is not (and newer were) linkable, instead one should link to AudioToolbox.

Source: https://stackoverflow.com/a/14120936

Verified by looking at simulator runtimes (this is what I could find) for version 9.3 and 10.3, on both of these AudioUnit does not contain a dylib (unlike most other frameworks). Also, in the SDK it's missing an AudioUnit.tbd file in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AudioUnit.framework
@simlay
Copy link
Member

simlay commented Jan 27, 2022

I've just verified that this works with the bevy iOS example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants