Audio Video lose sync when seeking or resuming
#1
I finally got around to updating to 10.1 on HTPC yesterday and I'm having some trouble with the video playback. For a large number of my files if I try seeking forward or back the audio and video lose sync. Also if I watch an episode and mid way through stop it and then pick resume instead of start over, it is out of sync as well.

I've tried with with VDPAU on and off, the CPU usage in both cases is ~10%. There is plenty of free RAM as well. I don't think it is the video files, they played fine in 9.11 and they work on a different computer in Windows.

I did notice something odd, in the video playback section the "A/V Sync Method" option is disabled for some reason. Any idea why that would be?

My audio is being outputted as analog.

The computer has:
Core 2 Duo E8400 (3GHz)
1GB RAM
GeForce 9400 GT
Intel HD Audio

I'm running Gentoo, pretty much all the libraries are up to date. I'm using version 270.41.06 of the nvidia drivers.

Here is my xbmc.log file: http://dl.dropbox.com/u/13449511/xbmc1.log

The file I tested starts playing around line 590. I see there are a bunch of avcodec_decode_video warnings and I tried searching around but didn't find anything definitive.

If I start a video file and just let it play, the audio and video stays in sync.

Any thoughts?
Reply
#2
So after doing some more testing tonight, it looks like only files using the ff_mpeg4 decoder have this problem. I tried playing some h264 videos and they don't go out of sync after seeking. The h264 videos are using the h264 vdpau decoder. I don't remember the exact name, but I found both by pressing the 'o' key while the video is playing.

So the problem seems to be in the mpeg4 decoder but I really don't know where to go from here.

[edit]I tried 10.1 on another computer with Gentoo and mpeg4 playback is similarly effected. Though it seems once the audio is off, its off my a consistent amount, on the 2nd computer I tried after a seek the audio needs to be delayed by around 0.325s to be back in sync. I tried 2 different files and the correction amount was the same after seeking.[/edit]
Reply
#3
I have the same out of sync problem using vaapi on h264 videos. Seeking usually works without out of sync, but Pause/resume almost always lead to audio lagging behind. Will try to post a debug log when I'm home.
Reply
#4
So I tried playing a DVD and it works fine as well, it was using libmpeg2. So the problem seems limited to the ff_mpeg4 decoder. Is that provided by ffmpeg? Is there a way to have XBMC use an alternate decoder for MPEG4?

Both computers with the issue are using ffmpeg version 0.7 rc1 if that matters.
Reply
#5
So I think I fixed it. I upgraded ffmpeg from 7.0 rc1 to 0.7.2 and mpeg4 playback appears to be working correctly. As is h264 w/vdpau and mpeg2. I'll need to do more tests to be sure though.
Reply
#6
oracleguy Wrote:So I think I fixed it. I upgraded ffmpeg from 7.0 rc1 to 0.7.2 and mpeg4 playback appears to be working correctly. As is h264 w/vdpau and mpeg2. I'll need to do more tests to be sure though.

so you are using external libraries?
Reply
#7
debug log: http://paste.ubuntu.com/661233/

If I play a mkv with vaapi and auto adjust refresh rate everything works fine - until I pause and resume the video.
After resume the video starts "jumping back and forth/get really jerky" but no frames are dropped. Without auto frame rate the video resumes fine.
Also audio is always out of sync after pause, with and without auto refresh rate.

This does not happen when I disable vaapi and run on ffmpeg software decoder.

for the record: dirty region is enabled, but disabling it does not solve the issue.
Reply

Logout Mark Read Team Forum Stats Members Help
Audio Video lose sync when seeking or resuming0