Skip to content

Conversation

@pwnified
Copy link
Contributor

@pwnified pwnified commented Jun 8, 2023

Thought you might check out some of these changes, the first is an optional feature to set the thread pointer manually (at the start of the audio callbacks and clear it at the end, saves a string compare for every function lookup), and the second adds support for iOS on mac (which has a differnent realtime thread name, sets it up at program launch)

pwnified and others added 16 commits December 8, 2021 16:59
You must call AERealtimeWatchdogStartMonitoring and AERealtimeWatchdogStopMonitoring at the beginning and end of any coreAudio realtime thread. All this does is set the static thread pointer to the address of the CoreAudio thread.
It's not as simple as dropping the library into a project and it magically working, like before, but performance is increased by a large amount if you call lots of obj-c (a quick profile run showed about 10% cpu savings).
Uncomment #define USE_WATCHDOG_REGISTRATION_FUNCTIONS 1 to try it out.
You must call AERealtimeWatchdogStartMonitoring and AERealtimeWatchdogStopMonitoring at the beginning and end of any coreAudio realtime thread. All this does is set the static thread pointer to the address of the CoreAudio thread.
It's not as simple as dropping the library into a project and it magically working, like before, but performance is increased by a large amount if you call lots of obj-c (a quick profile run showed about 10% cpu savings).
Uncomment #define USE_WATCHDOG_REGISTRATION_FUNCTIONS 1 to try it out.
You must call AERealtimeWatchdogStartMonitoring and AERealtimeWatchdogStopMonitoring at the beginning and end of any coreAudio realtime thread. All this does is set the static thread pointer to the address of the CoreAudio thread.
It's not as simple as dropping the library into a project and it magically working, like before, but performance is increased by a large amount if you call lots of obj-c (a quick profile run showed about 10% cpu savings).
Uncomment #define USE_WATCHDOG_REGISTRATION_FUNCTIONS 1 to try it out.
The realtime audio thread has a different name on apple silicon. This uses the __attribute__((constructor)) to set the name on startup.
Unfortunately, processInfo.isiOSAppOnMac is still required for targets "My Mac (Designed for iPad)"
To better work with swift
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