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

[macOS] Replace deprecated CoreServices audio API with AudioToolbox #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FtZPetruska
Copy link

The CoreServices Audio API used to find/open/close audio components has been deprecated since macOS 10.8 (around 2012).

While the framework has not been removed yet, I found that when running on macOS 13 on my M1 mac, FindNextComponent would systematically fail to find any component.

The solution I found was to replace CoreServices with AudioToolbox. It provides a very similar API and is available since macOS 10.0 so it would not change the minimum supported version. Additionally, AudioToolbox already provides AudioUnit, so linking the latter is no longer needed.

The main difference is how errors are handled. Errors are returned in the OSStatus type, and should be checked against the noErr constant.

Additionally, the files/class were renamed from coreaudio to audiotoolbox, this is mainly for consistency so the name in the settings and in source actually corresponds to what is being used.

The audio API from CoreServices has been deprecated since 2012 and no
longer seems to work on recent hardware.
This keeps naming consistent with what is actually being used.
@entrpntr entrpntr self-requested a review May 27, 2023 18:20
@entrpntr
Copy link
Contributor

(I'm not very active with development anymore, but as the main contributor who's worked on Mac support, this is probably my area.)

This all looks fine on the surface. The OS-specific code from Gambatte is quite old (it in fact predates macOS 10.8), and if it's starting to cause issues on newer Macs, it's a good time to change it. The r717 release builds only worked on 10.13+ anyway. (FWIW, I do not get this issue on my M1 machine running macOS 13.1.)

Unrelated, but since Mac issues are somewhat rare I'll note it here: the current release builds take an excessive amount of user effort to get around security restrictions in newer macOS versions.

I'll try to take a look at this before too long and make sure there aren't issues on the Macs I have to test with.

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.

2 participants