[MPlayer-users] vsync not working

D Richard Felker III dalias at aerifal.cx
Tue Nov 4 23:29:31 CET 2003


On Tue, Nov 04, 2003 at 06:51:11PM +0300, Vladimir Mosgalin wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> On Mon, 3 Nov 2003, D Richard Felker III wrote:
> 
> DRFI>> DRFI>Yes, video overlay only works on the _first_ head. It's a
> DRFI>> DRFI>limitation of the hardware. The other head will use the video
> DRFI>> DRFI>blitter for xv, which _will_ tear, and there's nothing you can do
> DRFI>> DRFI>about it. So switch the primary head to the one you'll be watching
> DRFI>> 
> DRFI>> Can you please explain, what exactly 'video blitter' means? It still
> DRFI>> does yuv conversion and scaling in hardware?
> DRFI>
> DRFI>nvidia driver provides 2 xv devices: one overlay, and one which
> DRFI>just does scaling and yuv->rgb conversion directly into the
> DRFI>framebuffer.  The latter sucks because it will necessarily tear.
> 
> How this works in hardware? Nvidia cards have two scalers? How come the
> first one can scale only one image, and the second can process multiple
> images?

The overlay is actually a special part of the refresh unit that takes
care of flipping to the next buffer and tracing out the data in
overlay memory as the screen is refreshed. This involves scaling the
video, and colorspace converting it, at each video refresh, even if
nothing has changed. It also guarantees that torn frames will never be
shown. There is only one such unit.

On the other hand, the second xv port uses the normal accelerator
functions of the video processor to scale and convert the image and
write it into a part of the main framebuffer. This is a one-time
operation that happens when the frame is ready for display, so more
than one client can use it. You only run into a problem if the
accelerator is too slow to scale all the video being played by
different apps within the same frame, but this is not very likely to
happen... :)

> Also, my friend has riva tnt2, he uses windows. When he chooses in his
> player 'offscreen yuv' (that's how that video blitter is called in
> windows), the quality significantly increases - image becomes much less
> blurry.
> The default overlay can be compared with fast bilinear scaler, later -
> with quality bilinear or bicubic, but the difference between them is
> more than between bilinear and bicubic ones, it's highly noticable. In
> addition to better quality, he also gets ability to play multiple videos
> and take screenshots.

Yes, this is probably because it uses the nice texture blitter, same
as used for 3d. And the fact that it blits into the main framebuffer
lets you take screenshots. It's possible to avoid tearing with the
blitter, but only if you sync to vertical retrace and avoid initiating
the blit command except during vertical blanking...or you could go all
the way and use page flipping, but that would only be possible on
console/fullscreen, not in windowed modes.

Anyway, X architecture makes it very difficult for apps to sync to
retrace, so overlay is usually a much better choice.

Rich



More information about the MPlayer-users mailing list