[wpt-sync] Sync PR 15215 - Use oversampling to compute frame number

RESOLVED FIXED in Firefox 67

Status

()

enhancement
P4
normal
RESOLVED FIXED
5 months ago
4 months ago

People

(Reporter: wptsync, Unassigned)

Tracking

unspecified
mozilla67
Points:
---

Firefox Tracking Flags

(firefox67 fixed)

Details

(Whiteboard: [wptsync downstream], )

Assignee

Description

5 months ago

Sync web-platform-tests PR 15215 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/15215
Details from upstream follow.

Raymond Toy <rtoy@chromium.org> wrote:

Use oversampling to compute frame number

When computing the frame number, round-off can happen such that the
resulting frame number is not the same as the original. To work
around this, use oversampling to compute the oversampled frame
number. Round that to the nearest frame, and then convert that back
to the desired integer frame number at the original sample rate.

This won't always work, but should make the round-off errors much less
likely.

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

Assignee

Updated

5 months ago
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Assignee

Updated

4 months ago
Component: web-platform-tests → Web Audio
Product: Testing → Core
Assignee

Updated

4 months ago
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Assignee

Comment 3

4 months ago
Ran 2 tests and 58 subtests
OK     : 2
PASS   : 36
FAIL   : 22

New tests that have failures or other problems:
/webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching.html
    # AUDIT TASK RUNNER FINISHED: 2 out of 2 tasks were failed.: FAIL
    < [buffer-stitching-1] 2 out of 3 assertions were failed.: FAIL
    < [buffer-stitching-2] 1 out of 3 assertions were failed.: FAIL
    X SNR (56.56582705421649 dB) is not greater than or equal to 65.737. Got 56.56582705421649.: FAIL
    X SNR (58.62182031202294 dB) is not greater than or equal to 85.586. Got 58.62182031202294.: FAIL
    X Stitched sine-wave buffers at sample rate 44100 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732956767082214,0.4248766303062439,0.4807544946670532,0.5347436666488647,0.5866319537162781,0.6362155675888062,0.683299720287323,0.7276993989944458,0.7692402005195618,0.8077588677406311...] with an element-wise tolerance of {"absoluteThreshold":0.000090957,"relativeThreshold":0}.
	Index	Actual			Expected		AbsError		RelError		Test threshold
	[2003]	-9.6732087433338165e-2	-9.6823699772357941e-2	9.1612339019775391e-5	9.4617680624852212e-4	9.0957000000000003e-5
	[2004]	-3.4187544137239456e-2	-3.4279607236385345e-2	9.2063099145889282e-5	2.6856520995424621e-3	9.0957000000000003e-5
	[2005]	2.8491314500570297e-2	2.8398986905813217e-2	9.2327594757080078e-5	3.2510876202481997e-3	9.0957000000000003e-5
	[2006]	9.1058239340782166e-2	9.0966261923313141e-2	9.1977417469024658e-5	1.0111157205356415e-3	9.0957000000000003e-5
	[2007]	1.5326742827892303e-1	1.5317615866661072e-1	9.1269612312316895e-5	5.9584737668585898e-4	9.0957000000000003e-5
	...and 38045 more errors.
	Max AbsError of 2.0274701528251171e-3 at index of 44050.
	[44050]	-7.1237324737012386e-3	-5.0962623208761215e-3	2.0274701528251171e-3	3.9783473164634225e-1	9.0957000000000003e-5
	Max RelError of 5.5714977262789269e+1 at index of 30419.
	[30419]	-1.4247581129893661e-3	-2.5121373255387880e-5	1.3996367397339782e-3	5.5714977262789269e+1	9.0957000000000003e-5
: FAIL
/webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-scheduling.html
    # AUDIT TASK RUNNER FINISHED: 4 out of 4 tasks were failed.: FAIL
    < [sub-sample accurate start with playbackRate] 4 out of 5 assertions were failed.: FAIL
    < [sub-sample accurate start] 3 out of 6 assertions were failed.: FAIL
    < [sub-sample accurate stop] 1 out of 9 assertions were failed.: FAIL
    < [sub-sample-grain] 3 out of 16 assertions were failed.: FAIL
    X With playbackRate 0.25: output0[17] is not equal to 0. Got 0.6892558932304382.: FAIL
    X With playbackRate 0.25: output0[18] is not close to 1.0499999999999998 within a relative error of 4.542e-8 (RelErr=0.07462642306373217). Got 0.971642255783081.: FAIL
    X With playbackRate 4: output1[17] is not equal to 0. Got -0.09868232905864716.: FAIL
    X With playbackRate 4: output1[18] is not close to 1.7999999999999972 within a relative error of 4.542e-8 (RelErr=0.05661286248101295). Got 1.9019031524658203.: FAIL
    X output0 expected to be equal to the array [0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1...] but differs in 2 places:
	Index	Actual			Expected
	[3]	1.0000000000000000e+0	0.0000000000000000e+0
	[37]	0.0000000000000000e+0	1.0000000000000000e+0: FAIL
    X output0[0:33]: Expected 0 for all values but found 1 unexpected values: 
	Index	Actual
	[33]	1: FAIL
    X output0[34:8190] does not equal [1.899999976158142,2.9000000953674316,3.9000000953674316,4.900000095367432,5.900000095367432,6.900000095367432,7.900000095367432,8.899999618530273,9.899999618530273,10.899999618530273,11.899999618530273,12.899999618530273,13.899999618530273,14.899999618530273,15.899999618530273,16.899999618530273...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.
	Index	Actual			Expected		AbsError		RelError		Test threshold
	[0]	2.0000000000000000e+0	1.8999999761581421e+0	1.0000002384185791e-1	5.2631592156154129e-2	0.0000000000000000e+0
	[1]	3.0000000000000000e+0	2.9000000953674316e+0	9.9999904632568359e-2	3.4482724601392921e-2	0.0000000000000000e+0
	[2]	4.0000000000000000e+0	3.9000000953674316e+0	9.9999904632568359e-2	2.5641000560833845e-2	0.0000000000000000e+0
	[3]	5.0000000000000000e+0	4.9000000953674316e+0	9.9999904632568359e-2	2.0408143405366560e-2	0.0000000000000000e+0
	[4]	6.0000000000000000e+0	5.9000000953674316e+0	9.9999904632568359e-2	1.6949136104436064e-2	0.0000000000000000e+0
	...and 8152 more errors.
	Max AbsError of 1.0009765625000000e-1 at index of 2047.
	[2047]	2.0490000000000000e+3	2.0488999023437500e+3	1.0009765625000000e-1	4.8854341852180105e-5	0.0000000000000000e+0
	Max RelError of 5.2631592156154129e-2 at index of 0.
: FAIL
    X output0[37] should not be equal to 0. Got 0.: FAIL
    X output0[3] is not equal to 0. Got 1.: FAIL
    X output1[33] should not be equal to 0. Got 0.: FAIL
    X output1[34:8190] does not equal [1.100000023841858,2.0999999046325684,3.0999999046325684,4.099999904632568,5.099999904632568,6.099999904632568,7.099999904632568,8.100000381469727,9.100000381469727,10.100000381469727,11.100000381469727,12.100000381469727,13.100000381469727,14.100000381469727,15.100000381469727,16.100000381469727...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.
	Index	Actual			Expected		AbsError		RelError		Test threshold
	[0]	1.0000000000000000e+0	1.1000000238418579e+0	1.0000002384185791e-1	9.0909110613105290e-2	0.0000000000000000e+0
	[1]	2.0000000000000000e+0	2.0999999046325684e+0	9.9999904632568359e-2	4.7619004368509764e-2	0.0000000000000000e+0
	[2]	3.0000000000000000e+0	3.0999999046325684e+0	9.9999904632568359e-2	3.2258034744817511e-2	0.0000000000000000e+0
	[3]	4.0000000000000000e+0	4.0999999046325684e+0	9.9999904632568359e-2	2.4390221209414906e-2	0.0000000000000000e+0
	[4]	5.0000000000000000e+0	5.0999999046325684e+0	9.9999904632568359e-2	1.9607824804414951e-2	0.0000000000000000e+0
	...and 8152 more errors.
	Max AbsError of 1.0009765625000000e-1 at index of 2047.
	[2047]	2.0480000000000000e+3	2.0481000976562500e+3	1.0009765625000000e-1	4.8873419987893697e-5	0.0000000000000000e+0
	Max RelError of 9.0909110613105290e-2 at index of 0.
: FAIL

Comment 4

4 months ago
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5070af3aaa0b
[wpt PR 15215] - Use oversampling to compute frame number, a=testonly
https://hg.mozilla.org/integration/mozilla-inbound/rev/c10b10b9fcc1
[wpt PR 15215] - Update wpt metadata, a=testonly

Comment 5

4 months ago
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/aefbbbff5220
[wpt PR 15215] - Use oversampling to compute frame number, a=testonly
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd2ca5243573
[wpt PR 15215] - Update wpt metadata, a=testonly

Comment 6

4 months ago
bugherder
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.