Posts: 2,752
Joined: Dec 2008
Reputation:
23
bobo1on1
cheapass Team-XBMC Developer
Posts: 2,752
It returns how much audio is buffered in the soundcard, so you can calculate when an audio packet will play, otherwise you can't keep correct a/v sync if the soundcard buffers a lot.
It should not be close to 0 after unpause, because that would mean a bunch of audio is dropped.
Posts: 2,752
Joined: Dec 2008
Reputation:
23
bobo1on1
cheapass Team-XBMC Developer
Posts: 2,752
It depends on the soundcard as far as I know, some cards can pause playback, others can't, then on resume we send some zero bytes to prefill the buffers.
Posts: 325
Joined: Sep 2010
Reputation:
17
2010-12-16, 21:00
(This post was last modified: 2010-12-17, 19:44 by TheSwissKnife.)
I have a reasonable working solution for this now (ie keeping audio/video sync after speed change event without using audio clock discontinuity, having a stable and more accurate a/v sync info value, and using interpolated clock)...but I would like to improve it further.
I seem to get issues with seeks (which I also get with trunk untouched but the clock discontinuity code resolves)...so now I need to find where /why the seek is often completely wrong (ie video and audio don't match by a large margin). I also get the buffering... message intermittently after seek and don't yet know what is the root cause of that either.
I would also like to improve the sync to partial audio packets for AC3 (32ms) - the question there is, is it possible to insert shorter than frame duration fillers (silences) to reposition the audio to closer than +/-16ms?
Finally (for now) I need to ascertain what causes these nasty ALSA broken pipe errors that return from GetDelay() and GetSpace() (related to buffer levels after seeks).
As always, any pointers much appreciated.
EDIT: and I also intermittently see the WaitMSec call in video ref clock ::Wait take much longer (eg extra 50ms) than the number of milliseconds passed to it (ie when the vblank is also missed). What can cause this to occur? Would it be better to just use a 1 ms sleep loop?
Posts: 2,752
Joined: Dec 2008
Reputation:
23
bobo1on1
cheapass Team-XBMC Developer
Posts: 2,752
Check if you have anything in dmesg when that happens.
Posts: 2,752
Joined: Dec 2008
Reputation:
23
bobo1on1
cheapass Team-XBMC Developer
Posts: 2,752
Debug logging is always enabled for a debug build.
Posts: 325
Joined: Sep 2010
Reputation:
17
Well it does seem to be simply the result of the extra logging - at unpredictable intervals the system becomes unresponsive due to paging. Now I will get back to my discontinuity tweaks - seems like ages now since xmas so I need to remember exactly where I was...
I know I had adjusted the code so that after any speed change event I first get the current video frame to be well positioned (with respect to vblank) then I set the dvd clock to a preferred start point (half a frame off current video pts) then I had the audio doing drop/dupe/silence for the first few packets to bring it in sync with dvd clock, and only after that do I let the clock discontinuity code kick in if it is still required (which it typically isn't). This I thinks works well to ensure that video does not stutter. And I have added counters for audio drop and dupe, and clock discontinuity count, and video drop and dupe inside renderer...I think subtitle startup was causing issues, and ff/rw still very erratic...will report back soon
Posts: 325
Joined: Sep 2010
Reputation:
17
I have started with the subtitle issue. What I see so far is the first subtitle to be rendered takes around 100ms in the code CGUIWindowFullScreen::RenderTTFSubtitles, specifically in the call to RenderOutline(). This creates a stutter as this ties up the application (render) thread.
Would it be possible to generate a fake and preferably invisible subtitle at start of play to get whatever is required instantiated? Maybe a whole blank video frame with a black subtitle should be rendered before playback?
Posts: 1
Joined: Jan 2011
Reputation:
0
Hey. I'm having identical problem when i'm watching movies with polish subtitles. In Xbmc 9.11 there were no problems with that.
Regards,
Will_away