Closed
Bug 1119266
Opened 11 years ago
Closed 11 years ago
Investigate test_oscillatorNodeNegativeFrequency.html failures on Android
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: padenot, Assigned: padenot)
Details
Attachments
(3 files)
No description provided.
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → padenot
Keywords: leave-open
| Assignee | ||
Comment 1•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ef7d3c854571
This disable the test for now.
| Assignee | ||
Comment 3•11 years ago
|
||
| Assignee | ||
Comment 4•11 years ago
|
||
Those two file have been produced by:
+ printf("j1: %u, j2: %u, sampleInterpolationFactor: %f, basePhaseIncrement: %f, mFinalFrequency: %f\n", j1, j2, sampleInterpolationFactor, basePhaseIncrement, mFinalFrequency);
after the mPhase update in ComputeCustom.
(and __android_log_print for Android of course).
| Assignee | ||
Comment 5•11 years ago
|
||
On ARM, casting a negative float to an unsigned integer yields zero, whereas on
x86, it wraps. When the OscillatorNode had a negative frequency, the code would
just interpolate between the first and second value of the wave table, instead
of interpolating backward.
Attachment #8547529 -
Flags: review?(karlt)
Comment 6•11 years ago
|
||
Comment on attachment 8547529 [details] [diff] [review]
Properly wrap the table index in ComputeCustom on ARM. r=
>On ARM, casting a negative float to an unsigned integer yields zero, whereas on
>x86, it wraps. When the OscillatorNode had a negative frequency, the code would
Thanks for the nice analysis. Conversion from float to unsigned (or signed) integer has undefined behavior when outside the range of the destination type.
>+ j1Signed += periodicWaveSize;
Can you remove this line please?
There is nothing to ensure that j1Signed is >= -periodicWaveSize, so I'd
prefer not to have this line implying that it is.
The line is unnecessary because periodicWaveSize is a power of 2 and here
>+ uint32_t j1 = j1Signed & indexMask;
the implicit promotion from j1Signed to uint32_t (when int does not have more
bits than uint32_t - perhaps either indexMask should be unsigned int or an
explicit conversion to uint32_t should be applied, to avoid 2s complement
assumptions if int ever has more bits than uint32_t) for the bitwise & is
defined to follow the expected modulo behavior. Adding a power of 2 that is
greater than indexMask will have no effect on the result (unless signed
overflow introduces technically undefined behavior).
Attachment #8547529 -
Flags: review?(karlt) → review+
| Assignee | ||
Comment 7•11 years ago
|
||
| Assignee | ||
Comment 8•11 years ago
|
||
Comment 9•11 years ago
|
||
Flags: in-testsuite+
| Assignee | ||
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 10•8 years ago
|
||
Removing leave-open keyword from resolved bugs, per :sylvestre.
Keywords: leave-open
You need to log in
before you can comment on or make changes to this bug.
Description
•