Closed Bug 1249397 Opened 8 years ago Closed 8 years ago

MP3 Decoding with Web Audio API Takes Unreasonable Amount of Time

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
critical

Tracking

()

RESOLVED WONTFIX
blocking-b2g 2.5?

People

(Reporter: davidwalsh, Assigned: 938.daisuke)

References

Details

(Whiteboard: [ft:conndevices][POVB])

While testing MP3 decoding via Web Audio API on Firefox OS TV, we found that the amount of time it takes to decode sounds (background music, for example) is unreasonable.  Test available here:

https://mozilla-tv-games.herokuapp.com/audio-test/webaudio.html

Firefox Desktop:  ~1 second to decode
Firefox for Android (Galaxy 3):  24 seconds
Firefox OS on Panasonic TV:  48 seconds

Using <audio> tag on all devices makes sound play quickly.

Filing as a Firefox OS / platform issue due to slowness on multiple devices.

This issue dramatically affects game experience on Firefox OS for TV.
Component: AudioChannel → Audio/Video: Playback
Product: Firefox OS → Core
Marking as critical; this is a major issue not only for Firefox OS but also Firefox for Android.  Getting a fix for this ASAP is important as it affects a partner and anyone looking to use MP3 decoding.
Severity: normal → critical
ni? Daosheng who helped with game performance before and might know how or who to escalate to.
Flags: needinfo?(dmu)
FxOS on foxfooding: ~6 seconds
Fennec for foxfooding: ~10 seconds

On Firefox desktop, mp3 decoder uses S/W. But on mobile devices, it uses offload decode that would leverage H/W decode to save the CPU power. It might be the reason why both of Fennec and FxOS spend much time.

But on FxOS TV, it is much slow. It would be an issue and needs to be noticed!
FxOS TV 
onload: 31 seconds
decode: 45 seconds
Well, I think XMLHTTPRequest onload time is not quite stable. It depends on content cache and network. Currently, I can get around 5 seconds for the loading time. So, I consider we needn't pay attention on onload stage.
Will be worth testing out on ogg and other media files as well.
Blocks: TV_FxOS2.5
blocking-b2g: --- → 2.5?
Whiteboard: [ft:conndevices]
Mp3 uses MhsMp3Reader at FxOS TV that is made by Pana own. I am wondering if the performance issue is because of their H/W decoder.

I have tried the ogg file on FxOS TV as well. OGG files use Gecko OggReader on FxOS TV. My ogg file size is 13.8MB, and it spends 23.4 seconds at decodeAudioData stage but on Desktop browser it just uses 2.5 seconds. It might be an another thing we need to concern.
Flags: needinfo?(dmu)
I try the same OGG file on FxOS foxfooding as well. It takes 15 seconds for decoding. The OGG decoder at both of FxOS TV and FxOS foxfooding use S/W. Therefore, the elapsed time would depend on CPU capability.

In the case of mp3 reader, FxOS TV adopts their own MhsMp3Reader to handle this stuff. I got the spend time from MediaDecodeTask decode phase to MediaDecodeTask allocateBuffer phase cost 45 seconds. That needs to confirm with Pana to understand what happens with their H/W decoder.
I have reported this issue to our vendor. That seems to be not our platform problem.
Assign to Daosheng first because he is looking at this bug.
Assignee: nobody → dmu
per comment 7, this should be a partner side fix. Re-assigned.
Assignee: dmu → 938.daisuke
Whiteboard: [ft:conndevices] → [ft:conndevices][POVB]
Hi Kusaba-san,
Do you have any update about this issue?
Thanks
Flags: needinfo?(938.daisuke)
As mailed to Daosheng in 201/03/10, this is current our status. Just enable software docoder for availablity.
 
 
"Re: Sound Issues with games during port"
MhsMp3Reader uses s/w decoder and we measured this performance.
As a result we think it may be ability now. 
(of couse it is not good performance..)

  - It takes about 5ms for 1 frame (1152 samples) decoding on TV.
  - This media file has 8493 frames (9783936 samples).
  - So, 5ms * 8493 frames = about 45s ...

  - On desktop pc, it takes about 2s by using same s/w decoder.
Flags: needinfo?(938.daisuke)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.