From: Carsten W. <ne...@gm...> - 2003-01-28 19:27:42
|
Hi everybody! I used to have sync problems in xine using my dxr3 card since I bought it. I told Michael about this problem, but he was unable to reproduce it with his machine. After some investigation we discovered, that the sync problems were caused by the (slightly) different clock rate of my sound card and the dxr3 card. In fact, my sound card's clock rate is greater than the dxr3's one. So video ran too slow, which accumulated over time, and after ten minutes there was a noticeable gap, and after 15 minutes or so 0-frames were inserted or the video got jerky when the dxr3 card finally dropped some frames. This happened again and again. Since I have to use my sound card for analog 5.1 channel output (dxr3's audio device is only capable of stereo sound), I started to implement a way to fix this. The attached patch addresses the clock rate problem by resampling the audio data before it is sent to the sound card. At least I couldn't here any difference concerning audio quality. It works very well for me and might be of some use for others, too. It should also work with software video decoding. I only tested it with xine's Alsa plugin, but at least OSS should work as well. The heuristics may not be perfect yet, but every DVD I tried plays better than before. After applying the patch (against cvs from about one week ago; couldn't cvs-up this evening), one has to enable the new sync method by setting audio.av_sync_method to 'resample'. Setting it to 'metronom feedback' (default) lets xine behave as it did before. Cheers, Carsten |