2010-10-10, 12:37
There is now a more streamlined solution. Jump straight to page 4 for details.
-----------------------------------------------------
Hi Devs,
First of all, thanks to all of you for this wonderful piece of software. I just submitted a patch http://trac.xbmc.org/ticket/10469 which uses the "syncwindowsize" parameter from advancedsettings.xml to change the window size for sync error correction in smoothvideo (if the parameter is not present, window is set to 1 sec, preserving current behavior).
The background: for me, fluid video is #1 priority for movies and I do passthrough via S/PDIF, so my only option is to use drop/dupe audio. However, I encountered lots of unnecessary packet skips and duplications with some (actually many) movies (mkvs) in both Dharma Beta 2 on Windows 7 and also previously on Ubuntu minimal with XBMC 9.11. Most of them produce lots of stream wrapback warnings for the audio stream which might be an explanation. Simple mkv remuxing did not help, so the problem must be somewhere else. As usual, MPC-HC played these files well, but I prefer XBMC's internal player over everything else on my HTPC.
I took a closer look at the sources and found, that by default, sync is adjusted after 1 second. Clocks in my setup are relatively accurate (need >10 mins for A/V to go async) and my display supports all refresh rates (23.976, 24, 50, 60 Hz), so I tried to increase this to a higher value and found, that adjusting it to 30 seconds eliminates the problem completely on my setup, packets are skipped/duplicated now like I expect it.
I have only tested the patch on Windows, but it does not touch platform specific code, so it should be safe... I tested all sync modes (sync to audio, drop/dupe and resample) and did not encountered any ill side effects. Actually those modes also benefit from a larger window size, most notably sync to audio where video was very juddery.
Please have a look at it and if you find it useful, add it to the mainline.
-----------------------------------------------------
Hi Devs,
First of all, thanks to all of you for this wonderful piece of software. I just submitted a patch http://trac.xbmc.org/ticket/10469 which uses the "syncwindowsize" parameter from advancedsettings.xml to change the window size for sync error correction in smoothvideo (if the parameter is not present, window is set to 1 sec, preserving current behavior).
The background: for me, fluid video is #1 priority for movies and I do passthrough via S/PDIF, so my only option is to use drop/dupe audio. However, I encountered lots of unnecessary packet skips and duplications with some (actually many) movies (mkvs) in both Dharma Beta 2 on Windows 7 and also previously on Ubuntu minimal with XBMC 9.11. Most of them produce lots of stream wrapback warnings for the audio stream which might be an explanation. Simple mkv remuxing did not help, so the problem must be somewhere else. As usual, MPC-HC played these files well, but I prefer XBMC's internal player over everything else on my HTPC.
I took a closer look at the sources and found, that by default, sync is adjusted after 1 second. Clocks in my setup are relatively accurate (need >10 mins for A/V to go async) and my display supports all refresh rates (23.976, 24, 50, 60 Hz), so I tried to increase this to a higher value and found, that adjusting it to 30 seconds eliminates the problem completely on my setup, packets are skipped/duplicated now like I expect it.
I have only tested the patch on Windows, but it does not touch platform specific code, so it should be safe... I tested all sync modes (sync to audio, drop/dupe and resample) and did not encountered any ill side effects. Actually those modes also benefit from a larger window size, most notably sync to audio where video was very juddery.
Please have a look at it and if you find it useful, add it to the mainline.