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

AudioPlayer completionHandler #2916

Open
mahal opened this issue May 15, 2024 · 1 comment
Open

AudioPlayer completionHandler #2916

mahal opened this issue May 15, 2024 · 1 comment
Labels

Comments

@mahal
Copy link
Contributor

mahal commented May 15, 2024

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

Running AudioKit Cookbok Recipe "Completion Handler" plays two files then stops. In Simulator as well as on actual device.

I digged a bit round and found that internalCompletionHandler is called too late when status is already == .stopped and then completionHandler() isn't called.

There seems to be some threading issue as the log always shows
Thread Performance Checker: Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions

Crash Logs, Screenshots or Other Attachments (if applicable)

No response

@mahal mahal added the bug label May 15, 2024
@NickCulbertson
Copy link
Member

Yes, I'm seeing this issue in the Cookbook example too. I think the thread performance part has to do with the Timer running on the main thread. As for the completion handler, it seems like status is set to .stopped and is never set back to .playing. There are a lot of checks on status that are blocking methods from executing.

emurray2 added a commit to emurray2/AudioKit that referenced this issue May 16, 2024
emurray2 added a commit to emurray2/AudioKit that referenced this issue May 16, 2024
Otherwise we will run into many bugs when these same variables are being read by another thread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants