Closed Bug 1669166 Opened 4 years ago Closed 3 years ago

AAC decoding trimming improvements

Categories

(Core :: Web Audio, defect, P2)

Firefox 83
x86_64
Windows 10
defect

Tracking

()

RESOLVED DUPLICATE of bug 1703812
Tracking Status
firefox83 --- affected

People

(Reporter: jujjyl, Assigned: padenot)

References

Details

It looks like Web Audio backend is no longer properly implementing seamless looping of WebAudio AudioBufferSourceNodes, when playing back .mp3 or .m4a (AAC) files.

STR: Visit http://clb.confined.space/audio_test_suite/8bit_detective/8bit_detective.html and click on either of the buttons

8bit_detective_8000hz_11kbs_mono_ffmpeg2.2.2_aac.m4a
8bit_detective_8000hz_8kbs_mono_lame3.99.mp3

under the "Play uncompressed" section. Notice that the looping is not seamless. Playing back the same files either in Google Chrome or Audacity does reproduce seamlessly looped playback.

I write regressed, because I am quite sure that when I originally wrote the audio test suite, that seamless looping was working in Firefox. (although it's been a long ago, not 100% sure - but if it had not worked then, I am sure I would have reported a bug)

The STR repository can be also found in https://github.com/juj/audio_test_suite

The mp3 case is handled by bug 1566389, that is landing today. I'll have a look at the AAC case.

Depends on: 1566389
Severity: -- → S2
Priority: -- → P2
Depends on: 1669503

The cause for this is likely to be encoder delay. This is fixed for mp3, on nightly, and improved by 1669503 for the particular test case here, that contains a weird file where the encoder padding spans two mp3 packets, but only when encoded using Audacity, not when using ffmpeg or lame on the command line.

AAC is known to be a mess (maybe even more than mp3), and the way to find the amount of frames to trim can be specified in multiple ways. This needs investigation.

Summary: Seamlessly looped playback of uncompressed AudioBufferSourceNodes has regressed → AAC decoding trimming improvements
Assignee: nobody → padenot

Hi,

Could you check if the issue still occurs on the latest Firefox?
I'm not entirely sure how to reproduce this.

Thank you!

Flags: needinfo?(jujjyl)

This is being handled in bug 1703812 -- almost done there. This still is an issue in current Firefox release.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE

I realize there is a better test case in the audio_test_suite repo for this than the 8bit_detective audio clip. Updated STR:

  1. Visit http://clb.confined.space/audio_test_suite/car_acceleration_high/car_acceleration_high.html
  2. Click on any of the buttons on the page.

Expected:

Under the "Uncompressed" section, for all files, there should be a seamlessly looping audio playing back of a car engine revving up, and then down.
Under the "Compressed" section, for all files, there should be a seamlessly looping audio playing back of a car engine running at constant pitch.

Observed:

Both in the uncompressed and compressed sections, the .m4a file format playback contains pauses in the audio loop.
In the compressed section, the .mp3 file format playback contains pauses in the audio loop.

Tested today on Windows 10 and Firefox 92.0.

Flags: needinfo?(jujjyl)

I'm almost done with this, but had to delay finishing the patch set up because of other, more important things. I should get back to it, there's not much left to do.

You need to log in before you can comment on or make changes to this bug.