You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OboeTester recording fails when channels >= 3 and Input Margin >= 3 #1701
Android version(s): all
Android device(s): all
Oboe version: 1.7.0 and earlier
App name used for testing: OboeTester
Short description
Input Margin can be set larger than the capacity. Then recording is corrupted.
Steps to reproduce
Launch OboeTester.
Press RECORD AND PLAY
Select 3 channels.
Set Input Margin to 4.
RECORD
PLAY
Expected behavior
good recording
Actual behavior
no recording, frame counters barely advance
When setting channels >= 3 the stream switches from MMAP to Legacy.
Multi-channel legacy streams have larger bursts and smaller capacity.
On Pixel 7 Pro I had a burst size of 960 frames and a capacity of 2880.
So the capacity is only 3 bursts.
When the Margin is set to 3 or 4, OboeTester was waiting for the buffer to fill up to capacity, or even above capacity.
It can't fill up that much so the callback is timing out.
The solution is to clip the margin to the (bufferCapacity-burstSize) in Oboe.
Activity
oboe: clip waitForAvailableFrames
oboe: clip waitForAvailableFrames (#1702)