Skip to content

wiiu/audio: Open device in new thread #88

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

Draft
wants to merge 1 commit into
base: wiiu-sdl2-2.28
Choose a base branch
from

Conversation

GaryOderNichts
Copy link

AX initialization needs to be done on CPU1, otherwise interrupts won't be handled properly.
Previously this was attempted to be done using OSSetThreadAffinity, to change the affinity of the current thread.
Unfortunately OSSetThreadAffinity does not work when called for the currently running thread. This causes issues when opening an SDL audio device from a thread not running on CPU1.
This commit now creates a new thread running on CPU1 for AX initialization, and joins it before moving on.
Currently marked a draft until further testing is done.

AX initialization needs to be done on CPU1, otherwise interrupts won't be handled properly.
Previously this was attmpted to be done using `OSSetThreadAffinity` to change the affinity of the current thread. Unfortunately `OSSetThreadAffinity` does not work when called for the currently running thread. This caused issues when an SDL audio device was opened from a thread not running on CPU1.
This commit now creates a new thread running on CPU1 for AX initialization, and joins it before moving on.
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.

1 participant