-
-
Notifications
You must be signed in to change notification settings - Fork 293
Possible fix for audio.onComplete #657
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
Conversation
…nd buffer and assignment logic Next up, prepare details from graphics.defineEffect()
…from Program Slight redesign of TimeTransform with caching (to synchronize multiple invocations with a frame) and slightly less heavyweight call site
Err, was calling Modulo for sine method, heh That said, time transform seems to work in basic test
Fixed error detection for positive number time transform inputs Relaxed amplitude positivity requirement
Maintenance Revert Test
My mistake adding back changes made
This reverts commit 0b5e1e9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems legit. Lets' hope it won't cause wake locks/ANRs
I've converted the scheduler to use atomic variables rather than the If this is needed sooner one of us can make a PR. There are other issues: the Lua state being used on the audio thread, or rather the smart pointer to it, is not safe at all. The cleanup of |
I took the sample in this issue and seemed to pin down where the crash itself was happening. A description and analysis are mentioned in my comments here.
The comment here, right before the task was issued, was on the right track. The
Append()
is being performed in the audio thread but theRun()
is happening in the main thread. Since there was no synchronization anAppend()
would occasionally happen during aRun()
.This adds a couple mutexes to guard against this. (
Rtt_Scheduler
seems to be a singleton, so I made themstatic
rather than add<mutex>
in the header file, but they could just as well be astatic
or even regular member.)Since you could have patterns like in the test, I added
Task
s to a list and synchronized them at certain points. That way theRun()
shouldn't be stallingAppend()
s repeatedly. One possible issue is thatDelete()
could miss between extracting the list and synchronizing it, due to the two mutexes, but I didn't see any evidence of its use in the codebase. (Looks like apart from playing sounds, only the shell executing at startup and audio recording use the scheduler.) I think the sync in the destructor will account for any last-minute additions, since it happens in the same thread asRun()
.