Closed Bug 1300650 Opened 8 years ago Closed 8 years ago

MediaRecorder video and audio are very out of sync on win10

Categories

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

50 Branch
x86
Windows 10
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox49 --- unaffected
firefox50 + unaffected
firefox51 + unaffected

People

(Reporter: alice0775, Assigned: padenot)

References

Details

(Keywords: regression)

+++ This bug was initially created as a clone of Bug #1300169 +++

Build Identifier: 
https://hg.mozilla.org/releases/mozilla-aurora/rev/2231ab09a51c3b21dae6fa1627c1a64cfd43b3b0
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0 ID:20160905004005

This problem did not exist on FF49.0b8.

Steps to reproduce:
1. Open https://www.webrtc-experiment.com/msr/video-recorder.html
2. Set the Time interval to 50000 and clicked "Start".

Actual results:

The audio lags behind the video by about 1 second all evidence of how far off it is. 
Recorded video : https://youtu.be/fmlvjIB1TVk


Expected results:
The audio and video should be in sync.
Reference video(for calibration) : https://www.youtube.com/watch?v=rzF6bNSXZac



I did not succeed finding a regression range on Nightly channel...

I was able to find a fixed range only in the beta channel.
https://hg.mozilla.org/releases/mozilla-beta/pushloghtml?fromchange=96190ab8489d65b5d5e1cb93ee704dcdfa974679&tochange=6d0c7b6a6ae1b02a00b670a4686bb1c0689f8a6f

And, unfortunately, it does not fixed on Aurora and Nightly channel.
Summary: MediaRecorder video and audio are very out of sync → MediaRecorder video and audio are very out of sync on win10
Priority: P1 → --
Rank: 15
Priority: -- → P1
There is also one unconfirmed bug (Bug 1298750) for Win 10 with similar description.
jesup, the range includes a commit by you, maybe you have an idea of what is going on ?
Flags: needinfo?(rjesup)
Tracking 51+ for this audio sync regression.
This was cloned from a bug I filed about the exact same thing on Mac OS X. So I think it's a cross platform bug, not specific to Win 10 or Mac OS X. 

https://bugzilla.mozilla.org/show_bug.cgi?id=1300169
(In reply to Alex Chronopoulos [:achronop] from comment #1)
> There is also one unconfirmed bug (Bug 1298750) for Win 10 with similar
> description.

Audio disappearing sounds more like this bug which was resolved: https://bugzilla.mozilla.org/show_bug.cgi?id=1294753
The fixed range of comment#0 seems to be wrong(may be due to a bug 1298750).


I used https://www.webrtc-experiment.com/RecordRTC/ for finding regression range. Because this has little long grace period of up to audio disappears(Bug 1298750).
And I found regression window for the a/v sync problem.

Regression window:

https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=fe953aeb1d93b63e60f5397c406f0bc05752af4a&tochange=d5b56d7097ba3ba8b77f88b7f57c6afba7e10c78

Regressed by: 5a937f17f336	Paul Adenot β€” Bug 1269692 - Update cubeb to revision 17e3048d0afa1152776fb1867cdb61c49fae69e4.

Fixed range  on 49 beta channel:
https://hg.mozilla.org/releases/mozilla-beta/pushloghtml?fromchange=063d859a92a5497f4b429d35f1adbc4a8b75d62a&tochange=33cd8f4c261f3b546dc6cf231c8495e523e8e3ba

Filed by: Bug 1297798 - Pref off cubeb full_duplex audio on windows for Fx49. rs=jesup, a=lizzard

However, the pref(media.navigator.audio.full_duplex=false) does not fix the a/v sync problem on Nightly51.0a1.
Blocks: 1269692
Depends on: 1297798
Flags: needinfo?(rjesup) → needinfo?(padenot)
Regression window on Nightly51.01 with setting media.navigator.audio.full_duplex=false :
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=e0a401691ee7b6c0979d228bc55f6c8db291663d&tochange=492d8382a49c86b16f758edb67b46d061adac5fc

Regressed by: 492d8382a49c	Terrence Cole β€” Bug 1291928 - Expose JSSavedStack's stack before returning; r=bz
Blocks: 1291928
To be clear:

#1 Regressed by 5a937f17f336 Paul Adenot β€” Bug 1269692 - Update cubeb to revision 17e3048d0afa1152776fb1867cdb61c49fae69e4.

#2 And Fixed only in beta channel by 0084d48b8214 Randell Jesup β€” Bug 1297798 - Pref off cubeb full_duplex audio on windows for Fx49. rs=jesup, a=lizzard

#3 On Nightly 51.01 even if setting media.navigator.audio.full_duplex=false
Further regressed by: 492d8382a49 Terrence Cole β€” Bug 1291928 - Expose JSSavedStack's stack before returning; r=bz
Flags: needinfo?(terrence)
Flags: needinfo?(bzbarsky)
I would be incredibly surprised if bug 1291928 actually affected behavior here.  It can cause a bit more tracing/GC to happen, but shouldn't cause permanent audio/video sync issues....
Flags: needinfo?(bzbarsky)
Regarding the #3 regression, I filed a separate bug 1300871
No longer blocks: 1291928
Flags: needinfo?(terrence)
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(padenot)
Resolution: --- → DUPLICATE
I think this is not a duplication.
Because, this is the cubeb full_duplex audio regression by Bug 1269692.
Affected on Aurora50 and Nightly51.

@:jesup
And I think, at least, the cubeb full_duplex audio should be disabled on windows for Aurora 50.

And also after landing the fix of bug 1300871, the cubeb full_duplex audio should be fixed on Nightly51+. If cannnot, the cubeb full_duplex audio should also be disabled on windows for Nightly51.
Status: RESOLVED → REOPENED
Flags: needinfo?(rjesup)
Resolution: DUPLICATE → ---
Padenot - do you see this with full_duplex, in aurora or nightly?
Flags: needinfo?(rjesup) → needinfo?(padenot)
We agree this bug is not a dup of ctai's bug (ref: Comment 11), but it may well be a dup of bug 1295193, which Paul has a fix for. He needs to verify the fix before committing it, and he is at TPAC this week.  NOTE: We believe this is caused by having input and output devices running at difference sampling rates.

We definitely don't want to disable full duplex in Nightly or Dev Edition.  We will disable it in Beta if we need to, but we'd prefer to fix bug 1295193 and uplift the fix (the fix is simple) and get the feature to users sooner.  Windows full duplex has been baking in Nightly and Aurora since Fx49.  We turned it off in Fx49 prior to shipping; we'd like to avoid doing so in Fx 50.

Paul is back in the office next week, we should be able to confirm if this is a dup of bug 1295193 or not.  In the meantime, I'm assigning this to Paul to follow up.  (And he's needinfo'd already; so this is in his queue for next week.)
Assignee: nobody → padenot
Tracked for 50 since this is a new regression.
Depends on: 1306570
Flags: needinfo?(padenot)
Probably fixed by 1306570. Please try again on a nightly that has https://hg.mozilla.org/mozilla-central/rev/c06670c5446b.
(In reply to Paul Adenot (:padenot) from comment #16)
> Probably fixed by 1306570. Please try again on a nightly that has
> https://hg.mozilla.org/mozilla-central/rev/c06670c5446b.


Latest nightly52.0a1[1] is worse than before.

[1] https://hg.mozilla.org/mozilla-central/rev/42c95d88aaaa7c2eca1d278399421d437441ac4d
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 ID:20161004030204


Regression window:
A/V out of sync(audio speed is approx 0.9x of video):
https://hg.mozilla.org/integration/mozilla-inbound/rev/9eb7e1d20e40eea17611cd254c5e0aca17e16831
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 ID:20161003040403

Worsen A/V out of sync(audio speed is approx 0.6x of video):
https://hg.mozilla.org/integration/mozilla-inbound/rev/1858c9bbbc83b8c00b030e8111284f8074a400bf
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 ID:20161003044455

Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=9eb7e1d20e40eea17611cd254c5e0aca17e16831&tochange=1858c9bbbc83b8c00b030e8111284f8074a400bf

Suspect: Bug 1306570 or Bug 1302817
Alice, do you use a headset or computer with a stereo microphone by any chance ? I just fixed a bug related to stereo microphone.
Flags: needinfo?(alice0775)
(In reply to Paul Adenot (:padenot) from comment #18)
> Alice, do you use a headset or computer with a stereo microphone by any
> chance ? I just fixed a bug related to stereo microphone.


I use Logitech Fusion(V-UAR33) with headphone+microphone. I think it is monaural mic.

Camera to share:     "Logicool Qcam Fusion"
Microphone to share: "FrontMic (Realtek High Definition Audio)"
Flags: needinfo?(alice0775)
Aha, The problem was fixed after changing the Microphone to share.

Camera to share:     "Logicool Qcam Fusion"
Microphone to share: "Microphone (Logicool Microphone (Fusion))"


Sorry for disturbing you.
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → WORKSFORME
Alice, can you confirm that you have two audio devices, one that is a microphone in your webcam, that is mono (1 channel), and one built-in your computer that is stereo (2 channels) ?

I made you a video that shows how to know how many channels each device have: https://paul.cx/public/default-audio-device.mp4

In this video I also have two devices, and by going to the properties menu and advanced tab, you can see the the number of channels: in this case, my USB headset microphone has two channels.
Flags: needinfo?(alice0775)
Each device say as follows:

Microphone(Logicool Microphone (Fusion)):
   1 channel, 16bit, 16000 Hz

FromtMic(Realtek High Definition Audio)
   2 channel, 16bit, 44100 Hz



OTH,
On latest Aurora51.0a2[2] with the combination of Camera & Microphone of Comment#20. 
Video is 2x faster of actual time. :(

[2]
https://hg.mozilla.org/releases/mozilla-aurora/rev/ebe183f4b76104ef999c08213d30c6972f52cb96
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0 ID:20161004004006
Flags: needinfo?(alice0775)
Right, thanks, it all makes sense. Looks like we'll have all the patches needed in tomorrow's Nightly, and we'll uplift as needed. Thanks for all the info and followup.
Updating the status flags to match the status of the bug.
(In reply to Paul Adenot (:padenot) from comment #23)
> Right, thanks, it all makes sense. Looks like we'll have all the patches
> needed in tomorrow's Nightly, and we'll uplift as needed. Thanks for all the
> info and followup.

Update?
Flags: needinfo?(padenot)
just want to make it clear what happened that fixed this
Bug 1307724
Flags: needinfo?(padenot)
You need to log in before you can comment on or make changes to this bug.