Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: Notes about tearing

This topic is old and might contain outdated or incorrect information.

We have talked about tearing issues, window mode, hardware full screen etc.

Currently I have a low end GPU but a fast CPU. For me though as a developer, sometimes it is good to have low end. It will show problems more easily.

Tearing drives me crazy and can completely ruin a display when you are being a professional. Your monitor refreshes normally at 60 frames per second. Tearing occurs when you are displaying some graphic and part of that graphic is drawn in one refresh cycle and part of the graphic is drawn in another refresh cycle. The drawing is out of sync with the monitor refresh. Many do not see it though. It depends on your hardware and what you are doing. If you are just playing video, you will not see it as much. Video typically has constant movement in a variety of directions and your eyes don't pick it up as well.

Horizontal scrolling shows it the best. It varies though and there are a few things that can cause tearing.

1) too much load for your GPU card. If you push too hard then very hard to get a smooth display. Something has to give.

2) can vary from one OS version to another or in the case of windows, also what version of DirectX you might be using.

3) when you create a Direct3D9 graphics device, you select an adapter number. Most select the default adapter which is always adapter 0. If you are going hardware full screen mode though, you must select the actual adapter number of the display. In window mode, you can select the adapter number of any of your monitors.

I can test both in VDJ and outside of VDJ with my own tools. So since tearing was driving me nuts when using window mode, I decided to look into it a lot. It is very hard to find definitive answers and you can look anywhere and not fine much except a few facts and a lot of BS. Also it can vary from one machine to another. Windows mode has historically been problematic though. Hardware full screen can be much better but it can be a pain in the ass for end users and for product support etc.

Ok so I have 2 monitors here, one is 1920x1080 and the other is 1600x900. I don't need all the bells and whistles like you guys do. The 1920x1080 display is used as my desktop and is the primary monitor (adapter 0). The 1600x900 monitor is adapter 1. Now I said that most developers will choose the default adapter (adapter 0) and is a good choice when using windows mode. If you don't choose adapter zero then you can get a worse performance hit when user moves the window around from one monitor to another. But I am testing for tearing issues. If you choose adapter 0 and your video is on adapter 1, then the video tries to sync with adapter 0 which is bogus and causes tearing on my system here. So using my tools, I select adapter 1 in window mode, and tearing issues are mostly gone. I can still get some tearing when the video window is not maximized. When maximized it is very good and with no tearing. One problem is, any adapter other then 0, can cause quite a performance hit when user moves the video to a different monitor and tearing will occur on that different monitor anyway. I tried a number of things from using other methods to check for vertical sync to recreating the device as user moved window around. A little strange though when everything stops briefly while the device is changed out.

In Windows 7, what determines your adapter 0 monitor? The primary monitor. This is chosen when you are in the screen resolution dialog and have a monitor selected and click "Make this my main display". In Win 7 it is also where all you app icons live and your task bar is by default. I would like to see something in Windows like, ok I want this monitor to be my desktop monitor and I want this other monitor to be my adapter 0 monitor. I looked around some and there seems to be some tools for doing this but not a clean windows setting which it should be. Dealing with the adapter number goes a long way in clearing up tearing for me here with my setup. VDJ can produce such a load for my GPU that I can still get tearing unless I minimize the VDJ UI and don't have some of the transitions like glass on. Glass can take my FPS from 60 to as low as 20.

I think Windows 10 has a way of making your desktop monitor different then you adapter 0 monitor. You want your video monitor to be adapter 0 for the most part and your desktop monitor to be using some other adapter number but you don't have a direct way to do that under Win 7. Maybe some poking around in registry might work.

When you click identify to show you some monitor numbers, they don't mean anything that has to do with your adapter 0 monitor. That is chosen when you select a particular monitor as your primary display. Or by some other tool or other means which probably is not very clean but don't know.

I can't say this is definitive because it varies too much with windows versions and directx versions and your GPU but I have not read anywhere that mentions the above and sure works for me. Just some clues on how you might be able to improve things if you are having a problem with tearing.

I have some things you can use to test for tearing that I will put up later.
 

Posted Wed 07 Sep 16 @ 8:58 pm
Having aero on in Win7 stops the tearing as well but a bit of a performance hit. That is probably my low end GPU though.
 

Posted Wed 07 Sep 16 @ 11:52 pm
What is tearing?
 

Posted Thu 08 Sep 16 @ 4:55 am
Since your monitor is refreshing itself normally about 60 times per second, it can cause artifacts if you draw when the monitor is refreshing. So you draw an image say and part of it got drawn in one refresh cycle and the other part gets drawn in a different cycle. It can look pretty messy. So you try and wait when the monitor is not refreshing itself to draw your image. It does not always work well but I think it is getting better with newer hardware. Normally it is not as clean as the following image and normally sort of blurred and ragged where the tearing is occurring. It can be sharp though. In this image you can see the bottom part is shifted to the left. If the image is not moving then you won't see tearing at all. Videos tend to wash it out as well.



Download and run this in TellyVisuals. It just scrolls a full height image from right to left. Make it full screen since the tearing can appear anywhere from the top of the monitor to the bottom. You will notice it quickly if tearing is occurring... If it stutters then that is a different thing. When everything is good it should be slick smooth with no tearing or stutter. Stutter is when it jumps a bit due to missed timing. I run it at 60 FPS in VDJ to match my vertical sync rate.

http://www.tellyvisuals.com/ScrollTest.lay
 

Posted Thu 08 Sep 16 @ 6:16 am


(Old topics and forums are automatically closed)