-
Notifications
You must be signed in to change notification settings - Fork 573
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
Adjust OpenSL ES buffer queue length based on capacity #744
Comments
Allow OpenSL ES to specify a total buffer size for a fast track |
No. This issue is still open. |
Measure the effect of changing kBufferQueueLength on Sargo running SP2A with OpenSL ES with Low Latency.
Latency increases by 2 msec (96 frames) per buffer. Not 192! Used main Oboetester screen to set frames per callback to 96.
The latency still increases by 2 msec/buffer but the latency is lower! I then set kBufferQueueLength and added some code to the beginning of processBufferCallback(). Burst = 192.
This does not seem to affect latency! I expected it to limit the amount of data in the buffer. |
I then added a loop in processBufferCallback:
In the first callback I could see the depth grow to four then stabilize.
At 9 it failed to start because there were only 8 buffers allocated. |
Hypothesis: in Android S the kBufferQueueLength affects the size of the internal buffer, which increases latency and should afford some glitch protection. Enqueuing multiple buffers increases the queue depth, adds latency. But I suspect these buffers are stored on the client side and will not help with glitch protection. |
Testing on a Nexus 6 running SDK 6.0.1, burst = 192.
Latency, and glitch protection, does not increase with the number of buffers. That was added in 7.0. ag/941250 |
Testing on a Nexus 6 running SDK 7 MR2, burst = 192.
Latency, and glitch protection, increases with the number of buffers. |
Change kBufferQueueLength constant to mBufferQueueLength variable.
Set mBufferQueueLength based on capacity and callbacksize.
See experiment on the effect of kBufferQueueLength on latency in:
Why Oboe only enqueue one buffer? #464
Understanding FramesPerCallback / kBufferQueueLength / Buffer Size #736
According to this internal bug:
b/27819623 | Allow OpenSL ES to specify a total buffer size for a fast track
starting in N, adding more buffers would improve glitch protection. So this change would help devices running 7.0, 7.1 and 8.0. That would be about 1/3 of Android devices. For 8.1 and later, AAudio is available.
[Update: as of August 2022, 17.5% of devices are running < 8.1]
The text was updated successfully, but these errors were encountered: