Jump to content
Tuts 4 You

Flickering and delay problems...


LCF-AT

Recommended Posts

Hi guys,

I have again found a problem and dont know whats the reason for this.I have a PC with a onBoard grafic 1 GB so I told this before on other topic.The problem I have is that I always have any kind of flickering / delay on the screen if I move any window or resize it also with any notepad file it happens.Its more worst if I do it in my Sandbox or also in VM too.Next problem is watching videos so there I always see any not vissible line moving from bottom to top (looks like a scissors cut) especially if there is much moving action in the video.I am really not sure why it is so and whether the onBoard grafic is the problem or not or whether any setting in the BIOS is guilty etc.Maybe you know more about that problems.

greetz

Link to comment

Can it be the driver of the video card which causes the problem? Is it the system default or the one provided by the manufacturer of the video card? And what's the version number of the driver of the video card?

Link to comment

I have installed this...

Intel(R) G41 Express Chipset
Intel(R) GMA 4500
Intel Video BIOS
Chiptyp	Intel(R) 4 Series Express Chipset Family
DAC Typ	Intern
igxprd32 (6.14.10.5420)
Speichergröße	1024 MB
		
Intel Corporation
http://www.intel.com/products/browse/chipsets.htm
http://support.intel.com/support/graphics

...normaly it should not be the problem so I think.Maybe its really just to bad or so.The best is if I just disable the XP option "show window content during moving" so then I dont have that flickering / delay problems if I move any windows etc.

greetz

Link to comment

@LCF-AT, many things u should consider:

First, as kurapica said, a decent GPU is really important not just for media, u'll also feel the difference with apps that do heavy calculations as well.

What's ur CPU ? this is another thing that u should take into consideration... these days, an i3 or i5 processor will do (for the purposes u mentioned).

I noticed another thing:

Quote

if I just disable the XP

I really felt a big difference when I moved into Win7... why don't u give it a try ? (with disabling visual effects to get a better experience)

Or even better, Win8.1 (but not good for RE), VirtualBox is handy in this case ;)

Edited by Alzri2
Link to comment

Hi again,

ok listen,so today I installed my other GPU nvidia GeForce 8600 GT (PCI e x16).I have 2 GPUs of them so in the other topic I made and talked about it I insatlled the other GPU which also was broken.Now I tried this one with my newer screen and DVI (the other GPU had only VGA).Ok now I have this installed and it works so far but the problems are not gone and I also dont see any better results than before with onBoard GPU.The flickering is still there if I move any wiindows or also in the video or scrolling in browser (middle mouse arrow scroll).The next problem I see is this....I have a 3D game which I testet with option directX (not Open GL) and the grafic is good so far but all hangs if I move forward / backward etc its like liquid then stop & jumping and not liquid the whole time.This sucks.No idea what this is.Normaly I should get any better results but I dont see any and dont know the reason for this.Lets say I buy any modern GPU so whats then if I have still same trouble as now.I also have a nvidia control panel where I can enable / disable options like antialias...something etc.No idea whether to change there anything or not.

PS: I got Intel Pentium D 3 GHz / XP / 3 GB Ram

EDIT: Ok Open GL does also do same as in DirectX mode. :( This does not hanging / jumping with my onBoard GPU.Great!!!I see no better effect anywhere.

greetz

Edited by LCF-AT
Link to comment

Hi again,

ok so today I updated my XP OS with a final update package (800 MB large) in the hope that the flicker problems will gone but I had no success.Now I made a short video for you where you can see that problem I mean about the windows moving etc.Just watch the video and then try it on your OS so maybe you also do use XP where you can check this out too and send me feedback if you got same issues or not.Would be nice of course and maybe you also have a idea what the problem could be for this kind of problem.

Thanks

Flicker Problem.rar

Link to comment

Have you tried a different program, eg: WordPad instead of Notepad?

Some programs are poor for form updates when repainting due to resize etc. especially when displaying / wrapping text and is a common problem

Double Buffering is normally a solution if you are programming something that has this problem

Using programs you haven't written then i suggest you try a different program that is coded a little better with things like this in mind

Link to comment

It seems to be a software issue... at least for the moment let's assume that.

 

You may check whether smth is consuming ur CPU:

Figure(B): http://www.techrepublic.com/article/how-to-use-task-managers-processes-tab-to-troubleshoot-issues-in-windows-10/

https://askleo.com/how_do_i_find_out_what_program_is_using_all_my_cpu/

 

Another check:

Using the lovely tool Autoruns: https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx

Try to eliminate the apps/services u suspect (after searching about them). Anything u don't need, eliminate it !

* Don't delete the value... just untick it. Also, make a copy before starting eliminating (File ==> Save).

** Before u start using it, have a look at this tutorial: https://www.youtube.com/watch?v=DtveEWcha0k

 

Link to comment

Hi again,

yes it seems XP / software itself is the problem for that.

I know autoruns and checked it yesterday again but didn't found any bad stuff inside.Also deinstalled many apps I don't need anymore and did free a lot of space but also this didn't help.I think I have to use a other and newer OS.

greetz

Link to comment

Hey mate, I don't think we should blame XP itself. I'm using normally XP (x64) as host and I'm not getting such kind of problems at all.

Look, I wonder if:

Was this problem existing always? Or this behaviour started after a certain date? Do you have any antivirus running? Is it an old installation? Or it was installed from scratch? Have you got all of the manufacturer's drivers for the hardware installed? What about analyzing all processes running? Any suspicious one? Did you analyze your machine for hidden rootkits?

Cheers!

Nacho_dj

Link to comment

Hi Nacho,

so I use XP 32 bit.About your questions.I dont remember anymore whether I got the problems before too or not.My XP installation is already some years old.A friend made a custom XP install package + SP3 pack etc for me what I did burn on CD and installed it.I also have original XP without SP thing etc.Not sure about all the driver but for graphic Chipset driver from Intel I used the original CD I got with the PC.I also dont find any suspicious running on my system and all looks good.Also dont have any rootkits etc so nothing found.System seems to be clean.

So I also asked kao about this flicker problem and kao gets the same issue on VM XP.So then I thought its really a XP issue.If you got XP 32 in your VM then check this out if possible like you can see in the video I did post.

So I think the grafic chip or my GPU cards shouldn't be the problem so on both I get same results with that flicker stuff.I also have this flicker problem in my Win 7 32 bit VM and there is much more as on my normal using XP OS.No idea what the problem reason is for that.

EDIT: No AV soft only AntiMalware app and Sandbox for Internet.

EDIT2: One more thing.So if I do this what you can see in my video above on XP then the CPU usage take 50 % only for Notepad.exe.If I do same on Win 7 VM then it takes 95 % CPU also only the Notepad.exe.Thats a lot.

greetz

Edited by LCF-AT
Link to comment

Well, reproducing your tests, I get almost similar effects, but not so deep as yours, on my XP running on VM. The CPU can be consuming even more than 90%.

On my XP x64 as host OS those efects are irrelevant, not flicker effects, it seems x64 architecture improves these poor performances. The CPU can be consuming till 15%.

So, maybe an XP own effect? It seems...

Cheers mate!

Nacho_dj

Link to comment
Teddy Rogers

I just had a look at your flicker video. The flickering on resize is a known issue and I have experienced it in my own code. You can fix it by setting the extended window style of Notepad window to use WS_EX_COMPOSITED...

SetWindowLongPtr_(hWnd, #GWL_EXSTYLE, GetWindowLongPtr_(hWnd, #GWL_EXSTYLE) | #WS_EX_COMPOSITED)

Ted.

  • Like 1
Link to comment

Hi again,

aha so its really a XP 32 issue now. :)

Hi Ted,

how to do this in notepad itself without to patch?I dont wanna have this flicker stuff on my XP for all apps so I cant patch all apps now. :) I also tried now to change any of my apps to use WS_EX_COMPOSITED style but then all is empty and moving is much more slower than before.I also have this flicker problem in my Listviews too but if I set anything to WS_EX_COMPOSITED then all is blank.So how to do it right now?

EDIT: I did some tests now and got this.If I enable WS_CLIPCHILDREN for main window style then the flickering in Listview is less only the Listview header line at the top does still flicker.If I now also enable WS_EX_COMPOSITED for main window then the flickering is all gone BUT moving the main window now does lag / delay and is no more liquid.Also CPU usage goes up to 50 % for this app and with a filled LV box it goes up to 100 % CPU usage.

greetz

Edited by LCF-AT
Link to comment
Teddy Rogers

Unless you code a program to monitor for Notepad launching the only other way would be to permanently patch Notepad to use WS_EX_COMPOSITED, if you didn't want to do it manually each time.

Regarding flickering of your own ListView, it is probably because you have something drawing over an item in the window, particularly evident as you are resorting to excluding areas of the child window when drawing. I would first have a look at how you have your ListView items arranged and if still having problems try double buffering with LVS_EX_DOUBLEBUFFER.

Regarding the increased CPU usage, I wouldn't stress too much about that. I would think this is primarily due to WinXP and GDI particularly now as you are double buffering your window when drawing...

Ted.

Link to comment

Hi again,

so WS_EX_COMPOSITED does increase the CPU usage very much also moving getting a lot slower so using this flag for me is no good choice.Maybe again a XP issue.About flickering in Listview.So I see I use invalidateRect API at WM_SIZE message what makes the flickering also for WM_VSCROLL I use = flicker but if I dont use this API then I get some painting problems in LV and controls what looks very bad and lines in LV gets overlapped at last row.

One more question about my GPU card.So I see that it makes trouble after running the system for some hours so then the systen does freeze and I only can move the mouse but system hangs.Then I only can reset the system by button press on tower.I also had similar trouble with the other GPU card too.Thats strange.The system never does hang if I used my onBoard GPU.I also see that this newer GPU has any cable on the card with 3 pins but dont know for what it is.I only found any 3 pin connector on mainboard for system fan.Now I did connect it there but not sure whether its right or needed etc.Maybe anyone knows it.

greetz

Link to comment
Teddy Rogers

I can only guess at how and when you are handling window messages and I do not understand why you would be using InvalidateRect at all unless you were directly painting contents to a window. You shouldn't be needing to use that function to update window contents. You may have window contents and items overlapping each other or you are updating the window at the wrong time(s). Are you using a windows callback function to update your window after you receive WM_SIZE from uMsg? I update and resize window contents after receiving WM_SIZE. It seems like you may be updating contents too early or multiple times after window size change - as if you were updating on WM_SIZING to cause the flicker.

Regarding your GPU, maybe check that your power supply is correctly sized and rated for your graphics card and system usage. I had similar unexplained problems some years back that were cleared up after I purchased a new power supply.

On a side note I would definitely think about using a more modern OS. If you really need to use XP do it from a virtual machine. There have been many improvements and optimisations to GDI in recent Windows releases...

Ted.

Link to comment
Teddy Rogers

I just tried your example ListView code and do not see any flicker in Windows 10. To fix the WM_VSCROLL flicker under XP use the following code...

SetWindowLongPtr_(hWnd, #GWL_STYLE, GetWindowLongPtr_(hWnd, #GWL_STYLE) | #WS_CLIPCHILDREN)

Ted.

Link to comment
  • 1 month later...

Hi again,

today I have again a small question about controls and how to handle them on WM_SIZE message to redraw all controls correctly and nice without any overlapping etc.So I have test already a lot but dont get any 100 % good working method.

1.) Using one InvalidateRect API at end of WM_SIZE for all = Flickering in Listview

2.) Using WS_CLIPCHILDREN for all controls = Overlapping of controls specially in a Groupbox

3.) Using WS_CLIPCHILDREN for all conrtols + using InvalidateRect API call for each control = better but not perfect and still can pixel / overlap and Groupbox will not redraw and gets showing very bad.Also its bad to use for each control a API call to InvalidateRect.

So can anyone tell me how to do it right to let redraw all the controls 1A on WM_SIZE message?Lets say you have 20 diffrent controls in Dialog window which are will moved if you resize the dialog.

4.) After another search on Net I found a code what only does use....

WM_SIZE
........
invoke RedrawWindow,hWnd,0,0,RDW_INVALIDATE or RDW_ALLCHILDREN
invoke UpdateWindow,hWnd
xor eax,eax
ret

...at the end of WM_SIZE without any InvalidateRect APIs etc.So this gives good results for all controls to redraw them but only controls in a Groupbox and Groupbox itself are still shown bad + using WS_CLIPCHILDREN on main dialog.Maybe you have a idea how to handle this.

PS: Just tested on Win 7 and not XP so I am not sure whether it gets again any trouble on XP or not.

greetz

Link to comment
Teddy Rogers

I always have a callback function to process WM_SIZE. When received via uMsg;

1) Calculate new window dimension
2) Resize contents from top to bottom based upon new window dimension

I think I mentioned something similar before, you shouldn't need to use WS_CLIPCHILDREN, or InvalidateRect, RedrawWindow, UpdateWindow API's since they are predominantly for painting and drawing contents in a window which, you are not doing...

Ted.

Link to comment

Hi Ted,

so I just use WM_SIZE on main routine only and then I set new positions with movewindow API each single control / LVs etc.

Maybe you could post any example of + source code to check out how you do it so then I could test it.Just a dialog with some diffrent controls inside would be enough.Just would like to see how it has to be correctly.Would be nice if you could create a example for me.

Thank you

 

Link to comment

Hi Ted,

first thank you for the example project of yours.

So I did check your source code about WM_SIZE / callback and traced the entire routine in Olly.Maybe you didnt know it so you do use PureBasic and ready codes basic API functions like ResizeGadget.If you trace this up then you will see it calls also InvalidateRect API for each control handle with pRect = 0 and Erase = FALSE paramter. :) RedrawWindow API comes as next API but not called in your case but its also there.Now I did move your file to test the resizing and I can also see flickering on moving of the RichEdit controls / windows.No idea whether you can see this too so I see it on Win 7.After this I checked the internet about this PBasic API you do use "ResizeGadget" and I also find problems about this API with flickering like here...

http://forums.purebasic.com/english/viewtopic.php?p=257386

...all in all there is no real solution to find how to handle it right and I also all hints I found on internet I have test so far. :(

So the best results I get after many testing I get with WS_CLIPCHILDREN for many controls (LV / Tabs etc) (does slow on moving windows) + RedrawWindow & UpdateWindow at the end of WM_SIZE.All is getting a little slow but it prevents flickering so far.Disadvantage = I cant use Groupboxes anymore so they will shown bad / overlapping / smudge specially if you have some other controls shown in a Groupbox.No idea why it has no effect for this control.

greetz

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...