Skip to content

nplb: Fill the audio sink at least once in SbAudioSinkTest.ContinuousAppend - #13271

Merged
sacuff merged 1 commit into
youtube:mainfrom
hferreiro:nplb-audiosink-append
Oct 10, 2026
Merged

sacuff merged 1 commit into
youtube:mainfrom
hferreiro:nplb-audiosink-append

Conversation

@hferreiro

Copy link
Copy Markdown
Collaborator

ContinuousAppend appends a quarter second of audio and, after every append, waits for some frames to be consumed.

On Android, the buffer is larger than a quarter second and playback only starts once it has been filled. ContinuousAppend then makes a single partial append, playback never starts and the wait times out. Other platforms pass because their buffer is smaller and their sinks start without a full buffer.

Fill the buffer first, as the other tests do, through a new FillFrameBuffer helper shared with them. Stop excluding the test on Android TV and AOSP.

Bug: 532068409

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ⏳ PENDING Checks are running
CI / android ⏳ PENDING Checks are running
CI / evergreen ⏳ PENDING Checks are running
CI / linux ⏳ PENDING Checks are running
CI / tvos ⏳ PENDING Checks are running
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


starboard: Fill audio sink in ContinuousAppend

The SbAudioSinkTest.ContinuousAppend test failed on Android because the
audio sink buffer is larger than the initial quarter-second append.
Since playback often only starts once the buffer is filled, the test
would time out waiting for frames to be consumed.

This change introduces a FillFrameBuffer helper to ensure the sink is
primed before the continuous append loop begins. This logic is also
shared with other tests that previously performed this manually.
Finally, the test is enabled for Android and AOSP by removing it from
the failure filters.

Bug: 532068409

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a helper method FillFrameBuffer() in AudioSinkTestEnvironment to standardize fully filling the audio sink buffer across several tests. It also enables the SbAudioSinkTest.ContinuousAppend test by removing it from the failing tests filters for various platforms and ensuring the buffer is filled and consumed before running the test. The reviewer suggested simplifying FillFrameBuffer() by leveraging existing public thread-safe methods instead of manually locking and calling internal _Locked methods, which avoids holding the lock during the append operation.

Comment thread starboard/nplb/audio_sink_helpers.cc Resolved
@hferreiro
hferreiro requested a review from sacuff October 9, 2026 13:39
@sacuff
sacuff enabled auto-merge (squash) October 9, 2026 21:05
…Append

ContinuousAppend appends a quarter second of audio and, after every
append, waits for some frames to be consumed.

On Android, the buffer is larger than a quarter second and playback only
starts once it has been filled. ContinuousAppend then makes a single
partial append, playback never starts and the wait times out. Other
platforms pass because their buffer is smaller and their sinks start
without a full buffer.

Fill the buffer first, as the other tests do, through a new
FillFrameBuffer() helper shared with them. Stop excluding the test on
Android TV and AOSP.

Bug: 532068409
auto-merge was automatically disabled October 9, 2026 23:44

Head branch was pushed to by a user without write access

@hferreiro
hferreiro force-pushed the nplb-audiosink-append branch from 6e32f70 to 18f281d Compare October 9, 2026 23:44
@sacuff
sacuff enabled auto-merge (squash) October 9, 2026 23:56
@sacuff
sacuff merged commit 55bd04b into youtube:main Oct 10, 2026
692 of 699 checks passed
@hferreiro
hferreiro deleted the nplb-audiosink-append branch October 11, 2026 17:48
briantting pushed a commit that referenced this pull request Oct 13, 2026
…udioSinkTest.ContinuousAppend

Refer to original PR: #13271

ContinuousAppend appends a quarter second of audio and, after every
append, waits for some frames to be consumed.

On Android, the buffer is larger than a quarter second and playback only
starts once it has been filled. ContinuousAppend then makes a single
partial append, playback never starts and the wait times out. Other
platforms pass because their buffer is smaller and their sinks start
without a full buffer.

Fill the buffer first, as the other tests do, through a new
`FillFrameBuffer` helper shared with them. Stop excluding the test on
Android TV and AOSP.

Bug: 532068409

(cherry picked from commit 55bd04b)
briantting pushed a commit that referenced this pull request Oct 16, 2026
…udioSinkTest.ContinuousAppend

Refer to original PR: #13271

ContinuousAppend appends a quarter second of audio and, after every
append, waits for some frames to be consumed.

On Android, the buffer is larger than a quarter second and playback only
starts once it has been filled. ContinuousAppend then makes a single
partial append, playback never starts and the wait times out. Other
platforms pass because their buffer is smaller and their sinks start
without a full buffer.

Fill the buffer first, as the other tests do, through a new
`FillFrameBuffer` helper shared with them. Stop excluding the test on
Android TV and AOSP.

Bug: 532068409

(cherry picked from commit 55bd04b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants