Closed
Bug 881092
Opened 11 years ago
Closed 11 years ago
Cannot decode wave file
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: ehsan.akhgari, Assigned: padenot)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [blocking-webaudio+][qa-])
Attachments
(3 files)
5.84 KB,
patch
|
kinetik
:
review+
rillian
:
review+
|
Details | Diff | Splinter Review |
8.75 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
896.11 KB,
image/png
|
Details |
Chrome can decode this wave file without any problems...
Comment 1•11 years ago
|
||
This is a 4-channel 16-bit pcm wav file with no channel mapping.
We don't play it because we don't support multichannel output or stereo downmix for wav files.
How does chrome interpret the channels without a channel mapping?
Depends on: 706327
Comment 2•11 years ago
|
||
http://chromium.googlecode.com/svn/trunk/samples/audio/impulse-responses/spreader50-65ms.wav looks like the same limitation.
Reporter | ||
Comment 4•11 years ago
|
||
(In reply to comment #1)
> This is a 4-channel 16-bit pcm wav file with no channel mapping.
>
> We don't play it because we don't support multichannel output or stereo downmix
> for wav files.
>
> How does chrome interpret the channels without a channel mapping?
I'm not sure, but you get an AudioBuffer if you pass this to AudioContext.decodeAudioData/createBuffer.
For Web Audio, we should not be attempting to map channels to anything, we should just give back the raw PCM version of each channel, I think.
Reporter | ||
Comment 5•11 years ago
|
||
We need to fix this before we ship Web Audio, since convolution buffers may come from wave files with more than two channels.
Ralph, do you know what's going to be involved in fixing this bug?
Blocks: webaudio
Component: Video/Audio → Web Audio
Flags: needinfo?(giles)
Whiteboard: [blocking-webaudio+]
Updated•11 years ago
|
Flags: needinfo?(giles)
Comment 6•11 years ago
|
||
Great, bugzilla outage cleared needinfo? but lost my comment.
Ehsan, to fix this properly we need to support multichannel playback. How important is the 4-channel ConvolverNode buffer? That's a more invasive change than I'd like to make to Aurora.
Currently we downmix multichannel Opus files in the decoder and reject all other multichannel files. We'd need to move the downmix code to the audio output layer. Bug 709327 is the tracking bug; it's been low priority because game dev feedback was that actual surround output wasn't important.
Then we have the issue of channel map. This file *should* fail in normal <audio> playback because there's no channel map, thus no way to play directly. Maybe we could plumb a flag which just asks the decoder to return multichannel data regardless for webaudio purposes?
Reporter | ||
Comment 7•11 years ago
|
||
(In reply to Ralph Giles (:rillian) from comment #6)
> Great, bugzilla outage cleared needinfo? but lost my comment.
>
> Ehsan, to fix this properly we need to support multichannel playback. How
> important is the 4-channel ConvolverNode buffer? That's a more invasive
> change than I'd like to make to Aurora.
>
> Currently we downmix multichannel Opus files in the decoder and reject all
> other multichannel files. We'd need to move the downmix code to the audio
> output layer. Bug 709327 is the tracking bug; it's been low priority because
> game dev feedback was that actual surround output wasn't important.
(Wrong bug #?)
Hmm, I was hoping to not require multi-channel playback as part of this. Can't we just special case the decoding done by the AudioContext to decode each channel as it is, bypassing the downmix spec
> Then we have the issue of channel map. This file *should* fail in normal
> <audio> playback because there's no channel map, thus no way to play
> directly. Maybe we could plumb a flag which just asks the decoder to return
> multichannel data regardless for webaudio purposes?
Yeah, that's exactly what I would hope that we should do here. Is that easier than the multichannel playback you mentioned above?
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → paul
Comment 8•11 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #7)
> > Then we have the issue of channel map. This file *should* fail in normal
> > <audio> playback because there's no channel map, thus no way to play
> > directly. Maybe we could plumb a flag which just asks the decoder to return
> > multichannel data regardless for webaudio purposes?
>
> Yeah, that's exactly what I would hope that we should do here. Is that
> easier than the multichannel playback you mentioned above?
Yes, that's easier. I'd recommend that unless Paul particular wants to fix multichannel playback in the timeframe we're looking at.
Assignee | ||
Comment 9•11 years ago
|
||
That's the approach I'm going to take, yes. It's going to be somewhat hacky, but well...
Assignee | ||
Comment 10•11 years ago
|
||
Chris, could you look at this one? The idea here is that we want to be able to
decode 4 channel files for WebAudio, and the WaveReader currently errors out
while reading the metadata, when the file has four channels.
Attachment #796762 -
Flags: review?(cpearce)
Assignee | ||
Comment 11•11 years ago
|
||
Test for multichannel file decoding.
This tests both that WebAudio can decode the file, and <audio> cannot.
Attachment #796764 -
Flags: review?(ehsan)
Comment 12•11 years ago
|
||
Comment on attachment 796762 [details] [diff] [review]
Allow decoding files we know we can't play, in the context of WebAudio. r=
Review of attachment 796762 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me.
::: content/media/MediaDecoderReader.h
@@ +467,5 @@
> // decode thread could start up and run in future.
> virtual void OnDecodeThreadFinish() {}
>
> + // Tell the reader that the data decoded are not for direct playback, so it
> + // can accept more file, in particular those which have more channels than
"...accept more files."
@@ +554,5 @@
> +
> + // Whether we should accept media that we know we can't play
> + // directly, because they have a number of channel higher than
> + // what we support.
> + bool mIgnoreAudioOutputFormat;
I would have called it mDecodeAllChannels, but that's not any shorter.
::: content/media/wave/WaveReader.cpp
@@ +61,5 @@
> // supported by AudioStream.
> static const uint16_t WAVE_FORMAT_ENCODING_PCM = 1;
>
> +// Maximum number of channels supported by the audio output code. We return with
> +// an error now if we are going to play back this media directly.
"We reject files with more than this number of channels if we're decoding for playback."
@@ +436,4 @@
> unsigned int actualFrameSize = sampleFormat == 8 ? 1 : 2 * channels;
> if (rate < 100 || rate > 96000 ||
> + (((channels < 1 || channels > MAX_CHANNELS) ||
> + (frameSize != 1 && frameSize != 2 && frameSize != 4)) &&
I think the direct frameSize checks are covered by the 'frameSize != actualFrameSize' check below, and technically it's wrong if MAX_CHANNELS isn't 2, but that's a separate bug. When we add multichannel playback it will show up soon enough, so I wouldn't worry about fixing it.
Attachment #796762 -
Flags: review+
Comment 13•11 years ago
|
||
Comment on attachment 796764 [details] [diff] [review]
Test that we can decode multichannel WAVE file only using decodeAudioData. r=
What happens if both SimpleText.finish() calls in decodeUsingAudioElement are invoked?
Reporter | ||
Comment 14•11 years ago
|
||
Comment on attachment 796762 [details] [diff] [review]
Allow decoding files we know we can't play, in the context of WebAudio. r=
Review of attachment 796762 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/media/webaudio/MediaBufferDecoder.cpp
@@ +512,5 @@
>
> + // Tell the decoder reader that we are not going to play the data directly,
> + // and that we should not reject files with more channels than the audio
> + // bakend support.
> + mDecoderReader->SetIgnoreAudioOutputFormat();
Shouldn't we technically call this before OnDecodeThreadStart()?
Reporter | ||
Comment 15•11 years ago
|
||
Comment on attachment 796764 [details] [diff] [review]
Test that we can decode multichannel WAVE file only using decodeAudioData. r=
Review of attachment 796764 [details] [diff] [review]:
-----------------------------------------------------------------
r=me sans the double finish bug that Ralph pointed out.
Attachment #796764 -
Flags: review?(ehsan) → review+
Comment 16•11 years ago
|
||
Comment on attachment 796762 [details] [diff] [review]
Allow decoding files we know we can't play, in the context of WebAudio. r=
Review of attachment 796762 [details] [diff] [review]:
-----------------------------------------------------------------
Chris Double wrote our wave decoder, he should be the one reviewing this.
Attachment #796762 -
Flags: review?(cpearce) → review?(chris.double)
Comment 17•11 years ago
|
||
Comment on attachment 796762 [details] [diff] [review]
Allow decoding files we know we can't play, in the context of WebAudio. r=
Matthew Gregan was the original author of the wave decoder.
Attachment #796762 -
Flags: review?(chris.double) → review?(kinetik)
Comment 18•11 years ago
|
||
Comment on attachment 796762 [details] [diff] [review]
Allow decoding files we know we can't play, in the context of WebAudio. r=
Review of attachment 796762 [details] [diff] [review]:
-----------------------------------------------------------------
To clarify: the Wave decoder is limited to mono or stereo because it only supports the original Wave header and has no support for WAVE_FORMAT_EXTENSIBLE. Supporting multichannel files reliably will require extending WaveReader to support WAVE_FORMAT_EXTENSIBLE.
Attachment #796762 -
Flags: review?(kinetik) → review+
Assignee | ||
Comment 19•11 years ago
|
||
Comment 20•11 years ago
|
||
Backed out for breaking the build:
https://tbpl.mozilla.org/php/getParsedLog.php?id=27165267&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=27165241&tree=Mozilla-Inbound
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/5e992506c2a0
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/ec9bf60a4b2e
Assignee | ||
Comment 21•11 years ago
|
||
Re-pushed with actually valid code.
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/1d14cd9307c3
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/807e7c9465eb
Comment 22•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1d14cd9307c3
https://hg.mozilla.org/mozilla-central/rev/807e7c9465eb
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Reporter | ||
Updated•11 years ago
|
Whiteboard: [blocking-webaudio+] → [blocking-webaudio+][checkin-needed-aurora]
Assignee | ||
Comment 23•11 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/df1504b82610
https://hg.mozilla.org/releases/mozilla-aurora/rev/1a1aeff8ab00
Whiteboard: [blocking-webaudio+][checkin-needed-aurora] → [blocking-webaudio+]
Reporter | ||
Updated•11 years ago
|
status-firefox25:
--- → fixed
status-firefox26:
--- → fixed
Comment 24•11 years ago
|
||
While testing for the pre-beta sign-off of this feature, I tried to verify this bug, so here are my questions and results:
- both http://chromium.googlecode.com/svn/trunk/samples/audio/impulse-responses/spatialized5.wav and the link from comment 2, work with latest Aurora (build ID: 20130902004002) on a Mac OSX 10.9 in 32bit mode machine, but don't work with Chrome (please see the attached screenshot)
Does anyone have any suggestions/thoughts? Thanks!
Flags: needinfo?
Updated•11 years ago
|
QA Contact: manuela.muntean
Comment 25•11 years ago
|
||
Paul, can you please answer Manuela's question in comment 24?
Flags: needinfo?
Comment 26•11 years ago
|
||
I'm not Paul, but the screenshot from comment 24 shows playback in the quicktime plugin, which isn't what this bug is about. You need to verify that 4-channel wav files can be passed to the web audio API context's decodeAudioData() method.
See content/media/webaudio/test/test_decodeMultichannel.html (mochitest) for an example.
Comment 27•11 years ago
|
||
Thanks Ralph. Manuela please test using the example provided in comment 26 as a guide.
Keywords: verifyme
Comment 28•11 years ago
|
||
Nevermind, that would just be repeating what we already have in mochitest. Marking [qa-].
Keywords: verifyme
Whiteboard: [blocking-webaudio+] → [blocking-webaudio+][qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•