Repository navigation
Conversation
libSceAudioIn and libSceAudioOut linked SDL2 statically, as every library that uses it does. On macOS the Objective-C runtime registers the classes of SDL from each copy it finds, and when two libraries of one process hold a copy the runtime warns that one of the two is used and which one is undefined. They link libSceAgcDriver instead, which holds the SDL of the process. The other platforms are unchanged. Co-authored-by: mugurc <mceker@gmail.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head afdd82c67b3372af27242bbfcec44374010fbf31. The Apple-only link changes make AudioIn and AudioOut depend on the existing AgcDriver shared target, whose own link line owns SDL2-static; their non-Apple SDL links remain unchanged. #10669 is still open and is correctly named as the dependency. The author reports the macOS duplicate-class warnings dropping from 42 to 14, with the remaining 14 coming from VideoOut, plus 51 audio tests passing. Hosted conventions/intake/eligibility checks pass; platform build jobs are skipped by path policy. I reviewed the CMake dependency and overlap context; I could not run the Apple build here.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head afdd82c67b3372af27242bbfcec44374010fbf31. On Apple, AudioIn and AudioOut now depend on the existing libSceAgcDriver shared target, which owns SDL2-static; the non-Apple SDL links remain unchanged. The PR declares its dependency on #10669. The author reports 42 duplicate Objective-C SDL class warnings before and 14 after (the remaining 14 are from VideoOut, outside this PR), and 51 audio tests passing on macOS x86-64 under Rosetta. Hosted conventions, eligibility, intake, labels and report checks pass; platform build jobs are skipped by path policy. I could not independently rerun the Apple build or audio tests on this Linux host.
|
M4 data point for the Setup: Apple M4, macOS 27.0.1, Apple clang 21, x86-64 Release under Rosetta 2, MoltenVK 1.4.2 (LunarG SDK 1.4.363.0). Tree:
Are you planning that follow-up yourself? If not, I'd be happy to open it with AI-assisted: yes |
|
@Betr0x Thanks for the M4 run and for working out the test executables. Yes please, go ahead and open the |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed afdd82c67b3372af27242bbfcec44374010fbf31. Pending review.
CMake linkage branches are verified; native macOS SDL behavior remains unverified in this review.
Validation: Executed the submitted AudioIn/AudioOut CMake on head and base across Darwin/Linux/Windows branches. Darwin uses libSceAgcDriver and drops the extra SDL2-static/exclude-libs linkage; the Linux/Windows link commands retain their old behavior.
Scope / next step: This does not prove Mach-O symbol resolution or Objective-C class identity. The author describes a combined macOS-series run; I did not independently execute or certify that integration. Native Apple evidence remains the limit on approval.
|
On macOS, with this branch merged into
target_link_libraries(audio_out2_timing_tests PRIVATE libSceAudioOut libc)
if(APPLE)
target_link_libraries(audio_out2_timing_tests PRIVATE libSceAgcDriver)
endif()With that, AI-assisted: yes |
|
Hi imellag, Thanks for the macOS work here. One thing to fix before this can land: once this branch is merged with current main, a test target on macOS stops linking, as javierUDP reported on 4 Nov ( What I see in the merged tree (merge of this head into main 5b1d381, no conflicts): main's Please link the test targets that call SDL themselves to the library that now provides it on Apple, for example for The same check is worth doing for the other test targets in |
|
@oneandonlydean @javierUDP thanks, fixed in 978f05f (after a merge of I built every audio test target on macOS in a tree with this head, current The others you listed:
AI-assisted: yes |
malekaifa
left a comment
There was a problem hiding this comment.
@imellag I confirmed the Nov. 20 blocker against current head 978f05f4427bb05cc914c12756c62c0d2ab688d0. On Apple this PR makes libSceAudioIn and libSceAudioOut share the SDL copy from libSceAgcDriver, but AudioIn still calls SDL_InitSubSystem(SDL_INIT_AUDIO) under its own g_mutex, while AudioOut calls InitializeSdlAudio_nid_no_patch() under a different static initialization mutex. That leaves concurrent AudioIn/AudioOut opens able to enter SDL audio initialization independently on the same SDL instance. Romannachwievor reproduced failures/crashes with concurrent real-CoreAudio starts and 0 failures after routing Apple AudioIn through InitializeSdlAudio_nid_no_patch(). Please fold that serialization into this PR (the proposed Apple-only AudioIn -> libSceAudioOut link has no reverse dependency) and retain the existing audio-target build/test coverage. This is also a prerequisite blocker for #24341. AI-assisted: yes
What
This is mugurc's
63db337cd8from his macOS series (ci/macos-series-2, listed on #1). mugurc is co-author of the commit. It sits on #10669, whose--exclude-libslines it moves into the non-Apple branch.On macOS the Objective-C runtime registers SDL's classes from every copy in the process.
libSceAgcDriver,libSceVideoOut,libSceAudioInandlibSceAudioOuteach link SDL2 statically, so a relinked game prints, for each of 14 SDL classes and each extra copy,Class SDL_... is implemented in both ... One of the duplicates must be removed or renamed, and the runtime warns this "may cause spurious casting failures and mysterious crashes".On Apple,
libSceAudioInandlibSceAudioOutnow linklibSceAgcDriver, which holds the process's SDL, instead of their own copy. Linux and Windows are unchanged.Tested
Apple M4 Pro, macOS 27.0.1, Apple clang 21, x86-64 Release under Rosetta 2 (
-DCMAKE_OSX_ARCHITECTURES=x86_64, Ninja,BUILD_TESTING=ON).mainalone doesn't build the libraries on macOS, so the tree ismain61fc572ceewith #10423, the open macOS build PRs (#10366, #10419, #10552, #7631, #7804, #4630, #10540, #10659, #10660, #10669, #10676), #10889, #10898 and the parts of mugurc's series that #7201 also carries. Planet of Lana (PPSA19450) is relinked with that tree's relinker (--macos --to-rosetta).libSceAudioIn,libSceAudioOutandlibSceVideoOutagainstlibSceAgcDriver.libSceVideoOut, which still links its own copy. Moving it the same way is a follow-up. The Lana runs in feat(libkernel): thread-local storage for Mach-O guests #11047 and feat(libkernel): start the guest off the main thread on macOS #11048 were made with this change.ctest -R audio(51 tests) passes without and with it.Linux and Windows: not built; the change only adds an
if(APPLE)branch.check_conventions.py --base upstream/mainpasses.pr_overlap.pyreports no conflict; it couldn't compare #7201 and #5021 on the two CMake files, because both conflict withmain.#7201 (the whole macOS port) and #5021 (the native ARM64 AOT draft) carry their own versions of these functions. #7201's head (
6687cbac29, 2026-10-16) conflicts withmain, needs a rebase anyway, and is being split into smaller PRs such as #10552 and #10419. #5021 is a draft of more than 43,000 lines that conflicts withmainand says no merge intomainis implied. If either lands first with these functions, this PR is not needed and I will close it.Checklist
main; no other open PR implements the same functions (except Macos port #7201 and feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, see the end of Tested)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)