Posts: 505
Joined: Nov 2006
Reputation:
0
2010-09-22, 23:51
Just curious if any developers might know roughly what might be causing the slight speed up of video (but not audio) after you unpause. If anyone has any rough ideas where to start looking for this I might devote some time to actually fixing it.
Thanks,
Harry
Posts: 3,571
Joined: Sep 2009
Reputation:
110
This would be great- the unpause of xbmc is really inelegant at the moment. It would be lovely if it was all neat and instant and synced...
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a
*full debug log*.
Posts: 442
Joined: Feb 2008
Reputation:
34
gnif
Team-XBMC Developer
Posts: 442
inelegant? my goodness, you have no idea...
The speedup is due to av sync, when you pause, audio currently in your sound-cards buffer has to be dropped to stop the output, when you resume playback, the audio is slightly out, so video has to run fast to catch up to the audio. This is not an easy thing to correct... but I am attempting to in the new AudioEngine branch
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Posts: 442
Joined: Feb 2008
Reputation:
34
gnif
Team-XBMC Developer
Posts: 442
for normal audio the delay will be something like this, with a avg delay of 20ms.
48000 / 1000 = 48 frames per ms
48 * 20ms = 960 frames that will get dropped
960 * 2 = 1920 samples (2 channels)
1920 * 2 = 3840 bytes (16bit, 2 bytes per sample)
now lets do the math for AC3...
A single AC3 block has 256 samples in it... no more, no less
256 / 48000 = 5.3ms of audio per ac3 block
256 * 2 = 512 samples (2 channels)
512 * 2 = 1024 bytes (16bit, 2 bytes per sample)
1024 / 5.3ms = 193.2ms
so 20ms of audio lag, is the same as almost 200ms of compressed data.... so video has to catch up to the audio by ~200ms.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Posts: 5,184
Joined: Jan 2009
Reputation:
131
Is this the same reason why video is played very fast for a second or two right after changing the audio stream while watching a video?
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 3,805
Joined: Mar 2004
Reputation:
3
elupus
Team-XBMC Developer
Posts: 3,805
changing audio stream is different actually.. It's due to it being changed at demux level, and that means the first audio sample is 4 to 8 seconds ahead of the video when it start to show up.
I'm pondering if we should attempt to do an accurate seek to the current video position when we change audio channels.
Posts: 2,752
Joined: Dec 2008
Reputation:
23
bobo1on1
cheapass Team-XBMC Developer
Posts: 2,752
There's also a fix in r35340, which came in just too late for RC1.
That one affects linux and osx if you pause for more than 9 seconds, windows if you pause for more than 2,5 hours.
Posts: 1,190
Joined: Oct 2010
Reputation:
8
I'm running Ubuntu 10.4 and XBMC RC1 (hardware listed in signature).
I had this issue in Beta 4 and it is completely gone now in RC1. Now I have no idea what is going on. Why is mine working when its broken for others? I can't say I'm complaining though.
How to use Git
| AMD Athlon II X3 Triple Core Processor 2.9 GHz |GIGABYTE GA-MA785GM-US2H Mobo 2GB DDR2 Ram | MSI N430GT |
| Logitec Harmony Smart Control Remote| 52" Sharp Aquos LED TV | Denon AVR-X1000 |
| Freenas Server with 18TB ASRock Intel Avoton C2750 |