Closed Bug 494116 Opened 15 years ago Closed 15 years ago

Video/Audio goes out of sync under high CPU load on Windows

Categories

(Core :: Audio/Video, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: BijuMailList, Assigned: kinetik)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file)

Bug #466699 fixed many video/audio out of sync issues.

But I see few cases where is still happening
1. when there is other processor load.
2. after skipping video


Steps Case 1.
1. in firefox goto http://tinyvid.tv/show/d3h9ycgenax0
2. play video 
3. run an application which consume processor power too much
   eg:- Compiling C++ code, run VMWare etc.
4. come back to video in firefox

Result:
Video/Audio go out of sync



Steps Case 2.
1. in firefox goto http://tinyvid.tv/show/d3h9ycgenax0 
2. play video 
3. skip video backward and forward


Result:
Video/Audio go out of sync
I am sorry, I accidentally added everybody to cc
Severity: major → normal
OS: Mac OS X → Windows Vista
Case 2 is bug 493958. I suggest changing this to "Video/Audio goes out of sync under high CPU load on Windows" or something like that.
Summary: video/audio still out of sync at certain condition → Video/Audio goes out of sync under high CPU load on Windows
Retested after bug 493958 got fixed, still this issue is there.
Even when there is no load, this will happen when we watch a long video,
and its very annoying while seeing 
http://www.double.co.nz/video_test/interview.ogg
Here some small slippages will cumulative to show a big difference by 30 minutes.
So we may want to check the sync every minute and re-sync by skipping frames
or pausing audio when there is no sound.
Flags: wanted1.9.1?
Unfortunately the audio backend we are using does not support getting the audio playback time which is why the sync Is drifting. We'll need to investigate a bit to see how to support this on windows.
Flags: wanted1.9.1? → wanted1.9.1+
Assignee: nobody → kinetik
Attached patch patch v0Splinter Review
Trivial patch.  Use the system audio timers on Windows by requesting SA_POSITION_WRITE_HARDWARE.

This fix seems to fix at least some cases of bug 494120, too.  Once the clock got too far ahead of the video, we might never catch up, so we stop showing frames at all (I ran in to this case while testing in a VM with heavy load on the host and in the VM).
Attachment #380992 - Flags: superreview?
Attachment #380992 - Flags: review?(chris.double)
Attachment #380992 - Flags: superreview? → superreview?(roc)
Forgot to mention, but should go without saying: mochitests and reftests pass on Vista in a VM.
Attachment #380992 - Flags: review?(chris.double) → review+
Attachment #380992 - Flags: superreview?(roc) → superreview+
Comment on attachment 380992 [details] [diff] [review]
patch v0

This is a very simple change that improves A/V sync on Windows.
Attachment #380992 - Flags: approval1.9.1?
Keywords: checkin-needed
Whiteboard: [needs landing]
I think we still need approval before this can land on trunk
Keywords: checkin-needed
Whiteboard: [needs landing]
Blocks: 494120
Comment on attachment 380992 [details] [diff] [review]
patch v0

>+  sa_position_t positionType = SA_POSITION_WRITE_SOFTWARE;
>+#if defined(XP_WIN)
>+  positionType = SA_POSITION_WRITE_HARDWARE;
>+#endif

Nit: why not use an #else instead of double initializing?
Personal preference.
Comment on attachment 380992 [details] [diff] [review]
patch v0

a191=shaver
Attachment #380992 - Flags: approval1.9.1? → approval1.9.1+
Pushed http://hg.mozilla.org/mozilla-central/rev/2f8493c326dd
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs 191 landing]
Pushed http://hg.mozilla.org/releases/mozilla-1.9.1/rev/77bcd5216032
Keywords: fixed1.9.1
Whiteboard: [needs 191 landing]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: