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

Oboe sometimes cannot play very short sounds #2027

Open
philburk opened this issue May 28, 2024 · 1 comment
Open

Oboe sometimes cannot play very short sounds #2027

philburk opened this issue May 28, 2024 · 1 comment
Assignees
Labels
bug P1 high priority

Comments

@philburk
Copy link
Collaborator

Some apps play short sounds, eg. 30 msec, by opening a file, playing the sound and then stopping the stream.
In some cases the sound may never be heard.

One part of the problem may be here:

src/opensles/AudioStreamOpenSLES.cpp#L407

When the app callback returns DataCallbackResult::Stop, Oboe does not queue the data from that callback to OpenSL ES.

Also the Oboe requestStop() method flushes/clears the queue of any unplayed data.
The comment says it is "so the old data won't be played if the stream is restarted."
Maybe we should just clear the queue when we restart the stream instead.

We should add a "Short Sound" test in OboeTester to experiment with these various techniques.

We could tag buffers with varying frequency sinewaves that fit an exact number of cycles within the buffer.
Then we could use loopback analysis to identify which buffers get played and which get dropped.

@philburk philburk self-assigned this May 28, 2024
@philburk philburk added the bug label May 28, 2024
@philburk philburk changed the title Improve the ability of Oboe to play very short sounds Oboe sometimes cannot play very short sounds May 28, 2024
@philburk
Copy link
Collaborator Author

Internal bug at: b/333514437 | P3 | [Oboe/OpenSL] Not able to play short duration file when BTHS is connected.

@philburk philburk added the P1 high priority label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P1 high priority
Projects
None yet
Development

No branches or pull requests

1 participant