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

Sub-sample accurate start for ABSN #13061

Merged
merged 1 commit into from
Jan 28, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 18, 2018

Implement sub-sample accurate start for AudioBufferSourceNode.
Previously, if the start time was between sample boundaries, we would
start the output at the frame before the start time. This is actually
incorrect because we haven't actually started yet. We should start
the output at the next boundary, and interpolating the value based on
the true start time and the sample boundary.

Many tests needed to be updated. Basically for each test that needed
to be changed, the sample rate is set to a power of two and all ABSN
sources are updated to make sure the source starts exactly on a frame
boundary. We also took the opportunity to adjust the error thresholds
for the tests in case lower values could be used.

Some additional notes for the tests:

audiobuffersource-playbackrate-zero.html: Add new test to make sure
sub-sample accurate start handles a zero playback rate.

audiobuffersource-loop-points.html: add some code to save the actual
output. This is needed because a new reference file is needed since
the sample rate has changed.

Also manually tested all of the modified tests with Firefox nightly.
They all pass still (except for the new sub-sample test because
Firefox doesn't do sub-sample accurate start/stop).

Bug: 876917
Test: the-audiobuffersourcenode-interface/sub-sample-scheduling.html
Change-Id: Ib13ba30eaa160cfd10739feabac961bf074ee309
Reviewed-on: https://chromium-review.googlesource.com/c/1212270
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626753}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

Already reviewed downstream.

Implement sub-sample accurate start for AudioBufferSourceNode.
Previously, if the start time was between sample boundaries, we would
start the output at the frame before the start time.  This is actually
incorrect because we haven't actually started yet.  We should start
the output at the next boundary, and interpolating the value based on
the true start time and the sample boundary.

Many tests needed to be updated.  Basically for each test that needed
to be changed, the sample rate is set to a power of two and all ABSN
sources are updated to make sure the source starts exactly on a frame
boundary. We also took the opportunity to adjust the error thresholds
for the tests in case lower values could be used.

Some additional notes for the tests:

audiobuffersource-playbackrate-zero.html: Add new test to make sure
sub-sample accurate start handles a zero playback rate.

audiobuffersource-loop-points.html: add some code to save the actual
output.  This is needed because a new reference file is needed since
the sample rate has changed.

Also manually tested all of the modified tests with Firefox nightly.
They all pass still (except for the new sub-sample test because
Firefox doesn't do sub-sample accurate start/stop).

Bug: 876917
Test: the-audiobuffersourcenode-interface/sub-sample-scheduling.html
Change-Id: Ib13ba30eaa160cfd10739feabac961bf074ee309
Reviewed-on: https://chromium-review.googlesource.com/c/1212270
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626753}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 00fa506 into master Jan 28, 2019
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-1212270 branch January 28, 2019 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants