Closed Bug 1287397 Opened 8 years ago Closed 8 years ago

cannot play .wav file in new FF 47

Categories

(Core :: Audio/Video: Playback, defect, P1)

47 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla51
Tracking Status
firefox47 --- wontfix
firefox48 - wontfix
firefox49 + verified
firefox-esr45 --- unaffected
firefox50 + verified
firefox51 --- verified

People

(Reporter: kms, Assigned: ajones)

References

Details

(Keywords: regression)

Attachments

(4 files)

Attached audio sample audio file
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Build ID: 20160623154057

Steps to reproduce:

We have an audio stream that comes from IBM Watson TTS. Stream is converted on a server into a .wav format audio file and then returned to the Html page (where we want to play it), as a response with a file attachment. 
Content-Disposition: attachment; filename=tts.wav
Content-Type: application/octet-stream
We use an Audio element in the html page.


Actual results:

Until now, up to Firefox 45 we can play the audio, but with version 47 and 47.0.1 we get an error: MediaError
https://gyazo.com/2f0a05af47dad2efa7f65abb7c550dff


Expected results:

Like in the older version 45, we should be able to play the audio.
Component: Web Audio → File Handling
Product: Core → Firefox
> Content-Type: application/octet-stream

Have you already tried setting the correct MIME type instead of "application/octet-stream"?

Is there a minimum, self-contained, public testcase with the exact and complete code delivered to the browser?
Flags: needinfo?(kms)
I don't have any sample code or test cases. I did try yo set the content-type to "audio/wav", but same result. I do know that the attachment is then handled as a Blob on the front end.
If you tell what specific information you need I can try to give it to you. I have another screenshot that probably won't help at all, but just in case
http://imgur.com/a/MtLmc
Attached file testcase
Expect button to change to "Play" oncanplaythrough.
Actual button remains as "loading".
Component: File Handling → Audio/Video: Playback
Product: Firefox → Core
[Tracking Requested - why for this release]: break web site.
The problem is that the metadata states that the data chunk length is 0xffffffff:

00000000  52 49 46 46 ff ff ff ff  57 41 56 45 66 6d 74 20  |RIFF....WAVEfmt |
00000010  10 00 00 00 01 00 01 00  22 56 00 00 44 ac 00 00  |........"V..D...|
00000020  02 00 10 00 4c 49 53 54  1a 00 00 00 49 4e 46 4f  |....LIST....INFO|
00000030  49 53 46 54 0e 00 00 00  4c 61 76 66 35 36 2e 31  |ISFT....Lavf56.1|
00000040  38 2e 31 30 30 00 64 61  74 61 ff ff ff ff 00 00  |8.100.data......|

so in dom/media/wave/WaveDemuxer.cpp:119 it overflows to read aChunkSize = 0. This causes the mDataLength to be set at 0, so the duration is set at 0 too, sending the error in metadata.
Flags: needinfo?(louis)
Could be fixed with something like this, although I haven't tested it on try or een run local mochitests.
Tracking 49/50+ for this audio regression, since it is something that used to work and now doesn't.
Priority: -- → P1
We are shipping 48 with it.
Attachment #8777621 - Flags: review?(cpearce) → review+
Comment on attachment 8777621 [details]
Bug 1287397 - Fix wave chunk size overflow;

https://reviewboard.mozilla.org/r/69148/#review66984

::: dom/media/wave/WaveDemuxer.cpp:136
(Diff revision 1)
>        if (mFirstChunkOffset != mOffset) {
>          mFirstChunkOffset = mOffset;
>        }
>        break;
>      } else {
> -      mOffset += aChunkSize; // Skip other irrelevant chunks.
> +      mOffset += (aChunkSize + 1) & ~1; // Skip other irrelevant chunks.

It's non-obvious why we need to do this. Please add a comment to make it obvious *why* we need to do this.
Pushed by ajones@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7545a33148f1
Fix wave chunk size overflow; r=cpearce
I'm sorry, but I had to back this out for Valgrind test failures. e.g. https://public-artifacts.taskcluster.net/TGjgwxLFQSSDU1xSNjTLcg/0/public/logs/live_backing.log
Flags: needinfo?(ajones)
Backout by gszorc@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a3dd453166ab
Backed out changeset 7545a33148f1 for Valgrind failures
That failure had nothing to do with this patch, you can just reland it.
Hi Anthony, this bug is assigned to nobody and it seems that you are involved in this, feel free to reassign it to someone else if you disagree.
Assignee: nobody → ajones
Flags: needinfo?(ajones)
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/dbd63e535b53
Fix wave chunk size overflow. r=cpearce
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dbd63e535b53
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
This needs QE's help to verify.
Flags: qe-verify+
Hi Anthony, should the fix be uplifted to Aurora50 and Beta49? It is a P1 regression.
Flags: needinfo?(ajones)
Comment on attachment 8777621 [details]
Bug 1287397 - Fix wave chunk size overflow;

Approval Request Comment
[Feature/regressing bug #]: 1231793
[User impact if declined]: Some WAV files will not play
[Describe test coverage new/current, TreeHerder]: No new test coverage
[Risks and why]: It may affect the way we calculate the number of samples in wrongly encoded WAV files by 1 sample. This is probably a fix rather than a bustage and probably isn't noticeable either way.
[String/UUID change made/needed]: none
Flags: needinfo?(ajones)
Attachment #8777621 - Flags: approval-mozilla-beta?
Comment on attachment 8777621 [details]
Bug 1287397 - Fix wave chunk size overflow;

Fix for regression from 47. 
Assuming you want to also uplift to aurora. 
This can make the beta 8 build next Monday, I'd still like to verify it on Nightly though. Andrei can your team try it out?
Flags: needinfo?(andrei.vaida)
Attachment #8777621 - Flags: approval-mozilla-beta?
Attachment #8777621 - Flags: approval-mozilla-beta+
Attachment #8777621 - Flags: approval-mozilla-aurora+
I've managed to reproduce this bug on on an affected build - 50.0a2
(2016-08-25), using the test case and instructions provided in Comment 3 and
Comment 4.

This is verified fixed on 51.0a1 (2016-08-25), using Windows 10 x64, Ubuntu
16.04 x64 and Mac OS X 10.9.5.
Status: RESOLVED → VERIFIED
Flags: needinfo?(andrei.vaida)
https://hg.mozilla.org/releases/mozilla-aurora/rev/4cb3737983b1

Could we land a test that would have caught this regression?
Flags: in-testsuite?
Flags: needinfo?(ajones)
This is verified fixed on:

   - 49.0b8-build1 (20160829102229)
   - 50.0a2 (2016-08-31)

as well, using the testcase from Comment 3 under Windows 10 x64, Mac OS X
10.10.5 and Ubuntu 14.04 x86 - the button's label now correctly states "Play".
Gerald - can you write a mochitest for this?
Flags: needinfo?(ajones) → needinfo?(gsquelart)
Opened bug 1301226 to write mochitest.
Flags: needinfo?(gsquelart)
Version: unspecified → 47 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: