Skip to content

[CoreAudio] Update bindings up to Xcode 27.0 Beta 3#26123

Merged
dalexsoto merged 3 commits into
xcode27.0from
dev/alex/xc27-CoreAudio
Jul 18, 2026
Merged

[CoreAudio] Update bindings up to Xcode 27.0 Beta 3#26123
dalexsoto merged 3 commits into
xcode27.0from
dev/alex/xc27-CoreAudio

Conversation

@dalexsoto

@dalexsoto dalexsoto commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Bind AudioServerPlugInRegisterMediaDeviceExtension for Mac Catalyst 27.0 as AudioToolbox.AudioServerPlugIn.RegisterMediaDeviceExtension.
  • Marshal the nullable interruption handler with the established BlockLiteral callback pattern.
  • Document the opaque native plug-in lifetime and remote-device restrictions.
  • Add a Mac Catalyst runtime test covering non-null and null interruption handlers, and remove the resolved CoreAudio xtro todo.

The binding is intentionally limited to Mac Catalyst because this is the only platform reported by the generated CoreAudio binding inventory and corresponding xtro todo.

Validation

  • make world
  • Clean xtro generation/classification: sanity passed
  • Clean cecil test suite: passed
  • Mac Catalyst introspection:
    • P/Invoke fixture: 8/8 passed
    • Signature fixture: 3/3 passed
  • Updated AudioServerPlugInTest: builds successfully and is correctly ignored on the local macOS 26.5 host; macOS 27 CI executes both native-call paths
  • tvOS introspection: 43/43 passed
  • macOS introspection: 32/32 passed, with 2 expected host-version ignores
  • iOS focused introspection:
    • P/Invoke fixture: 8/8 passed
    • Signature fixture: 3/3 passed

The app-size fixture discovered all 16 cases, which were intentionally skipped by the existing Xcode-beta guard. Broader monotouch runs only reported unrelated AVAudioSourceNode simulator callback-count failures and transient network timeouts. The full iOS introspection run was limited by the Xcode 27 simulator scene watchdog, and the full Mac Catalyst constructor run hit the known unsigned-app TCC abort in CLLocationButton; the binding-relevant fixtures above passed independently.

Bind AudioServerPlugInRegisterMediaDeviceExtension for Mac Catalyst 27.0.

Add AudioToolbox.AudioServerPlugIn.RegisterMediaDeviceExtension with an opaque native plug-in pointer and nullable interruption handler. Marshal the handler with the established BlockLiteral callback pattern and document the native lifetime requirements and device restrictions.

Register the new source file, add a Mac Catalyst signature test, and remove the resolved CoreAudio xtro todo.

Validation:
- make world
- clean xtro generation/classification and sanity
- clean cecil tests
- Mac Catalyst P/Invoke and signature introspection fixtures
- AudioServerPlugIn monotouch test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c27befb9-d7f9-4bb0-8b43-88a455328064
Copilot AI review requested due to automatic review settings July 15, 2026 19:12
@dalexsoto dalexsoto added this to the xcode27 milestone Jul 15, 2026
@dalexsoto
dalexsoto requested a review from rolfbjarne July 15, 2026 19:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new .NET binding for a CoreAudio API introduced in Xcode 27 (Beta 3), exposing it as a Mac Catalyst–only AudioToolbox.AudioServerPlugIn.RegisterMediaDeviceExtension helper that supports an optional interruption callback.

Changes:

  • Added a new Mac Catalyst–guarded CoreAudio P/Invoke + managed wrapper using the established BlockLiteral/BlockStaticDispatchClass pattern for the nullable callback.
  • Wired the new source file into AUDIOTOOLBOX_SOURCES.
  • Added a Mac Catalyst monotouch signature test and removed the now-resolved xtro todo entry.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreAudio.todo Removes the resolved “missing pinvoke” todo entry for the newly bound API.
tests/monotouch-test/AudioToolbox/AudioServerPlugInTest.cs Adds a Mac Catalyst signature check for RegisterMediaDeviceExtension.
src/frameworks.sources Includes the new AudioServerPlugIn.cs in the AudioToolbox source list.
src/AudioToolbox/AudioServerPlugIn.cs Introduces the Mac Catalyst 27.0 binding + wrapper and documents key usage constraints.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Comment on lines +19 to +21
Func<IntPtr, Action?, int> method = AudioServerPlugIn.RegisterMediaDeviceExtension;

Assert.That (method, Is.Not.Null);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's a rather weak test... it just asserts that the method exists.

Would it work to call the method?

AudioServerPlugIn.RegisterMediaDeviceExtension (IntPtr.Zero, () => {});
AudioServerPlugIn.RegisterMediaDeviceExtension (IntPtr.Zero, null);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 078b412. The test now calls RegisterMediaDeviceExtension with both a non-null callback and a null callback. It is gated with TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 27, 0) because the symbol is not exported by the macOS 26.5 host CoreAudio framework; the focused test builds and reports the expected ignore locally, while the macOS 27 CI host will execute both native-call paths.

Replace the signature-only test with native calls covering both a non-null interruption handler and a null handler.

Gate the test on Mac Catalyst 27.0 so older hosts skip the unavailable CoreAudio symbol while Xcode 27 CI executes both wrapper branches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c27befb9-d7f9-4bb0-8b43-88a455328064
@dalexsoto
dalexsoto enabled auto-merge (squash) July 16, 2026 16:22
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: bdc666e60afb67cd1dd8ba3ed12058805309ba99 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #bdc666e] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 195 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
⚠️ Tests on macOS Golden Gate (27): Tests skipped, incorrect beta version. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: bdc666e60afb67cd1dd8ba3ed12058805309ba99 [PR build]

@dalexsoto
dalexsoto merged commit c38213f into xcode27.0 Jul 18, 2026
55 checks passed
@dalexsoto
dalexsoto deleted the dev/alex/xc27-CoreAudio branch July 18, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants