Closed Bug 1624026 Opened 5 years ago Closed 5 years ago

Distorted sound of MUSIC on YouTube when changing the playback speed

Categories

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

74 Branch
Desktop
Windows
defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox82 --- wontfix
firefox83 --- fixed

People

(Reporter: ltlehtyrj, Assigned: padenot)

References

Details

(Keywords: regression, Whiteboard: [media-audio] )

Attachments

(6 files)

Attached audio firefox-74-1.25x.mp3

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0

Steps to reproduce:

Open any video on YouTube. Set the playback speed higher or lower. 1.25x for example.

Actual results:

It sounds distorted (the bass destroys it).

Expected results:

It should sound a lot cleaner and focused, like in Chromium.

Attached audio chromium-80-1.25x.mp3

In one of the recent versions of Firefox the sound was quite normal. I don’t remember which version it went wrong with.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
OS: Unspecified → Windows 8.1
Hardware: Unspecified → Desktop
Summary: Distorted sound on YouTube when changing the playback speed → Distorted sound of MUSIC on YouTube when changing the playback speed

I remember we've tweaked some settings for a similar issue in bug 1427267 and the quility issues seems to be fixed (bug 1427267 comment 34) in Firefox 73.

Paul, do you have any idea? The difference of the audios, starting from 33 seconds on the above links, is clear to me.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(padenot)
Priority: -- → P3
See Also: → 1427267

We need a regression range for this, to at least make sure we're looking at the right thing: https://mozilla.github.io/mozregression/install.html

Flags: needinfo?(padenot)

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression

(In reply to Paul Adenot (:padenot) from comment #5)

We need a regression range for this, to at least make sure we're looking at the right thing: https://mozilla.github.io/mozregression/install.html

ltlehtyrj,

It would be great if you can help us to identify if we did some change that causes this problem, or this is a problem for ages, by using the tool in above link.

Flags: needinfo?(ltlehtyrj)

I also attempted to provide a regression range, but I do NOT notice a difference between Nightly, Beta and Release versions. I do hear a very small difference between these three and the ESR version, but I need a test case (a good sound that helps me notice the difference better).

Reporter? cand you help here? Or at least provide the sound you "reproduced" the problem with?

since a few releases, from time to time, you get distorted sound on streamed video playback. Restarting FF helps.

Last seen: 75.0 today Linux 64bit.

Edit: "Last seen 2 days ago .. PRE 75.0" .. (today the video had really a distorted sound .. what a coincidence)

We've also gotten recent bug reports on this in Fenix for Android see https://github.com/mozilla-mobile/fenix/issues/8456

Whiteboard: [media-audio]

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)

Severity: normal → S3

Adding the QA Whiteboard [qa-regression-triage], but please remove it if new info is available for QA to reproduce the issue.

QA Whiteboard: [qa-regression-triage]

I can second the regression / issues on mobile. Before the "refresh" that happened a day or so ago, audio quality at 1.25x was virtually indistinguishable from normal speed. Now, it sounds like absolute garbage to the point that even speech is painful to hear. However, FF on desktop (80.0) doesn't seem to be affected.

I could try to provide comparisons if it helps. As for test cases, ANYTHING. Literally anything. Here's a completely random example: https://www.youtube.com/watch?v=iTD53t2NhoA.

That said... only my phone seems to be affected. Despite my (much older and lower spec'd) tablet also running the new version, it is fine. However, I'd never experienced the problem prior to the "refresh". Restarting the browser didn't help.

I had the exact same experience as Matthew. Audio quality was fine before the UI refresh update on Android, now it's distorted. This makes me think its a separate issue from the one reported here. Can file a separate bug if desired.

I haven't been able to reproduce this. Could people that can provide info about their devices where the sound quality is not good, about:support, "Copy raw data to clipboard", and then either attach it here or send it to <padenot@mozilla.com>.

Hopefully I can start to understand why this differs from device to device and fix it. Thanks!

Flags: needinfo?(mwoehlke.floss)
Flags: needinfo?(josh.hejna)

Support info for my LG V30 attached. Hopefully it isn't corrupt; I had to e-mail it to myself (tip: maybe FF should add a "save to file" button to about:support?) and undo the line wrapping that got added.

Flags: needinfo?(mwoehlke.floss)

Thanks, this file seems to be valid. We should probably add a button indeed.

Sorry for the long turnaround. Hope this helps!

Flags: needinfo?(josh.hejna)

Nothing crazy. Would any of you be equipped to make an audio recording of the problem? Another phone or table or computer in a quiet environment should do the trick. I just need to understand the kind of problem we're seeing.

Unrelated, https://bugzilla.mozilla.org/show_bug.cgi?id=1664763 tracks improvements to about:support on mobile.

Flags: needinfo?(mwoehlke.floss)
Flags: needinfo?(josh.hejna)
Attached file ff_distort_bug.zip

Here are some recordings of voice distortion, as compared with Chrome. It doesn't pickup on the microphone as well as I'd like. I think the Voice3 clip shows it best.

Flags: needinfo?(josh.hejna)

It's very clear indeed in the recording you attached, thank you very much. I'm quite confused, because we're using the same code on all platforms, but I'll start digging.

I'm going to start by trying to switch to the floating point path even on android.

I found how to replicate on desktop what we hear on mobile. When using integers (tweaking the configure) and disabling SSE (by returning 0 early here: https://searchfox.org/mozilla-central/source/media/libsoundtouch/src/cpu_detect_x86.cpp#73), then I think I have artifacts similar to some of the clips attached in the zip file here.

Assignee: nobody → padenot
Status: NEW → ASSIGNED

Verified that I have (I think) the same output on mobile and desktop now. The difference is clear on https://www.youtube.com/watch?v=-FUQ6ZxTkM8, 2x playbackRate sounds much better with this patch (and on Desktop) that on current Fenix.

We can have a look later to fix this properly without side-stepping it (and I'll report upstream), but there were talks about writing a WSOLA algorithm in safe-rust instead of using SoundTouch.

Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/324ea565091e Disable TDStretch::calcCrossCorrAccumulate to sidestep an audio quality bug on Android. r=chunmin
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

Seemingly fixed upstreamed, I'll have a listen with the fix: https://gitlab.com/soundtouch/soundtouch/-/commit/a911a1e98689e763e1274f462c00e7c6fedd80f9.

In the meantime, can reporters verify this is fixed in Fenix Nigthly? It is for me, it now sounds more or less identical between desktop (regardless of the platform, it's the same code) and Android. It's likely that we switch to the proper fix above but it should not result in a sound change (however it might be faster, but it's not that important because it's not very CPU intensive, compared to everything else that happens when playing back a video).

Flags: needinfo?(mwoehlke.floss)
Flags: needinfo?(ltlehtyrj)
Flags: needinfo?(kberezina)
Flags: needinfo?(josh.hejna)

Can confirm that the audio is no longer distorted in https://github.com/webcompat/web-bugs/issues/58383 at 1.5 playback speed

Flags: needinfo?(kberezina)

The speech distortion I was experiencing on YouTube appears to be gone. Appreciate the fix!

Flags: needinfo?(josh.hejna)

Hi, I've just checked this matter on the latest Nightly Build 201006

✔️ Works properly on:
• Google Pixel 3a (Android 11)
• Huawei Mate 20 Lite (Android 10)
• Xiaomi Redmi Note 8T (Android 9)
• LG G7 FIT (Android 8)
• Huawei MediaPad M2 (Android 5.1.1)

❌ Still reproducible on:
• Samsung Galaxy S6 (Android 7)
• Sony Xperia Z5 (Android 7.0)
• OnePlus A3 (Android 6.0.1)

@Paul There are still reports about this on Fenix (like https://github.com/mozilla-mobile/fenix/issues/17993) and based on Andrei's above comment this issue is not fully fixed.
Should we open a new ticket?

Flags: needinfo?(padenot)

I've never been able to reproduce this, can it still be reproduced?

Flags: needinfo?(padenot) → needinfo?(andrei.joltan)

Hi, I've just checked this matter on the latest Nightly Build 210329

✔️ Works properly on:
• Google Pixel 3a (Android 11)
• Huawei Mate 20 Lite (Android 10)

❌ Still reproducible on:
• Samsung Galaxy S6 (Android 7)
• OnePlus A3 (Android 6.0.1)

Flags: needinfo?(andrei.joltan)

I have managed to reproduce something similar on the desktop platform (Win10), by taking a youtube video with a melodic-relaxing sound and enough bass to notice a difference: this video
Having compared the sound at 0.5x, 1.25x, 1.5x and 2x speeds between the latest Chrome and Nightly v74.0a1 (2020-01-06), a considerable difference in sound distortion can be observed. It appears that the bigger the speed is modified either way (+/-), the bigger the distortion is observed. Furthermore, no difference was observed between Nightly v107.0a1 and v74.0a1, both having a rather distorted bass when a speed modification is applied.

In conclusion, this issue still occurs on the desktop platform, on Windows 10, throughout 74-107 branches.

Having investigated further back, I seem to have found a version where the distortion is less/minimal, Nightly v65.0a1.

A bisection is attempted between v65 and v75 and the results are:
Tested mozilla-central build: 2019-12-15 (verdict: g)
Tested mozilla-central build: 2019-12-16 (verdict: b)
Mozregression is unable to bisect further.

I have to mention that the distortion is not very obvious. I've made this investigation with High-Quality headphones and max volume and while having affected and unaffected builds opened at the same time for reference/comparison.

With great care and effort, this is the regression range that I could provide.

This report was intended to address the desktop platform, but improvements have been made for some of the mobile platforms already, maybe a new report will be needed to address the desktop platform specifically. Please NI me if I can help further.

QA Whiteboard: [qa-regression-triage]
Flags: needinfo?(padenot)
OS: Windows 8.1 → Windows

I haven't found anything in the range that could be the culprit, unfortunately. This only happens on fairly old Android versions, I don't think this is too problematic.

Flags: needinfo?(padenot)

Thanks for trying to repro though !

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

Attachment

General

Creator:
Created:
Updated:
Size: