Skip to content

OboeTester recording fails when channels >= 3 and Input Margin >= 3 #1701

Closed

Description

@philburk

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.

This matches internal bug b/265719561

Activity

  1. self-assigned this
    on Feb 2, 2023
  2. added a commit that references this issue on Feb 2, 2023
    b929e86
  3. added a commit that references this issue on Feb 3, 2023
    962ee70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions