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

improve sleeptime between stop() and close() #1500

Closed
philburk opened this issue Mar 3, 2022 · 2 comments · Fixed by #1593
Closed

improve sleeptime between stop() and close() #1500

philburk opened this issue Mar 3, 2022 · 2 comments · Fixed by #1593
Assignees
Labels
P1 high priority
Milestone

Comments

@philburk
Copy link
Collaborator

philburk commented Mar 3, 2022

There are ongoing problems with callbacks running after the stop.

In AudioStreamAAudio::close() we stop the stream and then sleep before closing the stream.

        usleep(kDelayBeforeCloseMillis * 1000);

We should a call that allows the developer to change that sleep time.

Also the default should be based on the framesPerBurst, which may be 20 msec on some devices.

@philburk
Copy link
Collaborator Author

API could maybe scale sleep time to (appScaler * burstTime)

@robertwu1
Copy link
Collaborator

We should be careful if they aren't using Low Latency. Burst sizes are quite large for Power Savings

@philburk philburk added this to the V1.7.0 milestone Apr 6, 2022
philburk added a commit that referenced this issue Aug 5, 2022
Add: AudioStream::setDelayBeforeCloseMillis(delay)

This can be used to avoid use-after-free bugs
cause by callbacks running when close is called.

Fixes #1500
philburk added a commit that referenced this issue Aug 6, 2022
Add: AudioStream::setDelayBeforeCloseMillis(delay)

This can be used to avoid use-after-free bugs
cause by callbacks running when close is called.

Fixes #1500

Add test for delay before close.

Bump version to 1.6.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants