LCU WinForms sizing bug.

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

unvestigate
Posts: 8
Joined: Mon Jan 15, 2018 5:58 pm

LCU WinForms sizing bug.

Post by unvestigate » Mon Jan 15, 2018 6:04 pm

I am using LightningChartUltimate v.8.2.1.4001. Simply creating a new C# Winforms application, adding a LCU component to the generated Form1, setting its Dock property to Fill and running the app results in the component not resizing properly when resizing the window. Please see the video linked below for more information:

http://www.sourcedrive.net/lcu_sizing_bug.mp4

As you can see, the component seems to resize properly when making the window smaller, but not necessarily when making it larger. It seems to get "stuck" on a certain size. Usually you can make it resize properly by letting go of the mouse and resizing a second time. I don't remember seeing this with version 8.0, but I am not 100% sure this has started occurring recently. Any ideas?

unvestigate
Posts: 8
Joined: Mon Jan 15, 2018 5:58 pm

Re: LCU WinForms sizing bug.

Post by unvestigate » Tue Jan 16, 2018 7:40 am

Btw, the above bug occurs with an AMD graphics card. I can confirm that the bug is not present with LCU 8.0.2 on an nVidia graphics card. I cannot currently test using the newer version on an nVidia GPU, nor with the older version on an AMD card. I can test those configurations later today.

unvestigate
Posts: 8
Joined: Mon Jan 15, 2018 5:58 pm

Re: LCU WinForms sizing bug.

Post by unvestigate » Tue Jan 16, 2018 7:04 pm

Allright, I did some more digging. The bug only occurs with AMD GPUs and only with D3D11 hardware rendering. If I set the rendering to D3D11 software or D3D9 (hardware or software) rendering the chart is properly resized.

The bug occurs on both version 8.2.1 and 8.0.2 of LightningChart. I have not been able to reproduce the bug on any nVidia/Intel hardware.

Tested on Win10 64-bit, AMD Radeon RX580 and drivers 17.12.1 and 17.12.2.

For now, I can detect AMD cards (since you guys helpfully provide me with a SharpDX implementation :D) and fall back to D3D9 rendering, but this needs looking into.

ArctionKestutis
Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: LCU WinForms sizing bug.

Post by ArctionKestutis » Thu Jan 18, 2018 8:10 am

Hello,

Sorry for the delayed response - have been busy answering direct emails.
The problem you described is peculiar, we have not seen it before. From your video, it looks like LCU is resized properly. The problem what clipping area (drawing stencil) remains previous size. Somehow LCU get correct size, but WinForm window not. For what reason stencil size stacked is not clear at all. It could be graphic drivers only problem or due to interaction with LCU's RenderingEngine11 effects. You could test, whatever LCU has anything to blame for, by inserting other UserControl and try resizing window.
You may try to add Panel in window and only then add LCU there. This may help for Window to get correct clip size.

All the best.

unvestigate
Posts: 8
Joined: Mon Jan 15, 2018 5:58 pm

Re: LCU WinForms sizing bug.

Post by unvestigate » Thu Jan 18, 2018 8:45 am

Hi,

I noticed the problem in a much more complicated application where the LCU control is part of a floating window, made dockable through DockPanelSuite. I can try to test it inside a panel if you would like, but that will have to wait since I only have the LCU license on one particular machine. I don't particularly expect it to behave differently since, as you said, the control is properly resized but the rendering is not.

If you have any AMD graphics cards, it takes literally 2 minutes to test this on your end. Create a new C# winforms app, add a chart to the generated Form1, set the Dock property to fill, run the app and resize the window.

And if you don't have any AMD hardware around I strongly recommend getting some. Speaking as a game developer who struggle with different GPUs and drivers all day, this is a typical case of different vendors' hardware working slightly differently.

unvestigate
Posts: 8
Joined: Mon Jan 15, 2018 5:58 pm

Re: LCU WinForms sizing bug.

Post by unvestigate » Thu Jan 18, 2018 8:48 am

Oh, and I already made a workaround for me. I just enumerate the DXGI adapters through the SharpDX provided by LightningChart and fall back to D3D9 rendering if I detect one or more AMD cards but no nVidia or Intel cards, which is typical for an AMD-only desktop PC. This works fine. It is just the D3D11 hardware rendering, which LCU autoselects by default, which causes the bug to appear.

ArctionKestutis
Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: LCU WinForms sizing bug.

Post by ArctionKestutis » Fri Jan 19, 2018 11:56 am

Not able to reproduce with 'AMD Radeon HD 6450'.
Keep looking for other AMD card.

unvestigate
Posts: 8
Joined: Mon Jan 15, 2018 5:58 pm

Re: LCU WinForms sizing bug.

Post by unvestigate » Fri Jan 19, 2018 2:24 pm

If you would like I can build a test app for you guys (although it would just be me doing the steps already described and zipping it for you), just to make sure there is no different between what I am doing and what you are doing.

ArctionKestutis
Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: LCU WinForms sizing bug.

Post by ArctionKestutis » Fri Jan 19, 2018 3:34 pm

I believe that your instructions have been clear. However, if you would share your project, when we will be absolutely certain that we are testing the same thing. You can leave project in the forum or send to Arction's support account.

Have a good weekend.

unvestigate
Posts: 8
Joined: Mon Jan 15, 2018 5:58 pm

Re: LCU WinForms sizing bug.

Post by unvestigate » Mon Jan 22, 2018 8:01 pm

Hi again,

I am back with some more info. First of all I made a test application where you can easily switch between the renderer types.

Video here: http://www.sourcedrive.net/lcu_sizing_bug2.mp4

The project is available here: http://www.sourcedrive.net/ArctionResizeBug.zip

However, what is perhaps more interesting is that the application crashed several times with D3D11 rendering while I was trying to capture the above video. Looking at the error in the windows application log gives me the following callstack:

Application: ArctionResizeBug.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at SharpDX.Direct3D11.DeviceContext.MapSubresource(SharpDX.Direct3D11.Resource, Int32, SharpDX.Direct3D11.MapMode, SharpDX.Direct3D11.MapFlags, SharpDX.DataBox ByRef)
at SharpDX.Direct3D11.DeviceContext.MapSubresource(SharpDX.Direct3D11.Resource, Int32, SharpDX.Direct3D11.MapMode, SharpDX.Direct3D11.MapFlags)
at SharpDX.Direct3D11.DeviceContext.MapSubresource(SharpDX.Direct3D11.Buffer, SharpDX.Direct3D11.MapMode, SharpDX.Direct3D11.MapFlags, SharpDX.DataStream ByRef)
at Arction.RenderingEngine11.RenderingEngine11.AD(SharpDX.Direct3D11.DeviceContext, SharpDX.Direct3D11.Buffer, System.Collections.IList, Int32, Int32, System.Threading.SpinLock)
at A.S.BB(A.VD, Boolean)
at Arction.RenderingEngine11.RenderingEngine11.WC(A.VD ByRef, Boolean)
at Arction.RenderingEngine11.RenderingEngine11.DrawWithDrawData(Arction.RenderingEngine.DrawData)
at Arction.RenderingEngine.RenderingEngineBase.DrawWithDrawData(System.Object)
at Arction.WinForms.Charting.LightningChartUltimate.BCD()
at Arction.WinForms.Charting.LightningChartUltimate.OAD()
at Arction.WinForms.Charting.LightningChartUltimate.NSC()
at Arction.WinForms.Charting.LightningChartUltimate.HSC()
at Arction.WinForms.Charting.LightningChartUltimate.OnPaint(System.Windows.Forms.PaintEventArgs)
at System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs, Int16)
at System.Windows.Forms.Control.WmPaint(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ContainerControl.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.UserControl.WndProc(System.Windows.Forms.Message ByRef)
at Arction.WinForms.Charting.LightningChartUltimate.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)

Immediately after that error there is another one with the following info:

Faulting application name: ArctionResizeBug.exe, version: 1.0.0.0, time stamp: 0x5a663f07
Faulting module name: atidxx32.dll, version: 23.20.15007.1005, time stamp: 0x5a36c234
Exception code: 0xc0000005
Fault offset: 0x006185e9
Faulting process id: 0x6070
Faulting application start time: 0x01d393b96eff362a
Faulting application path: C:\Users\Bebbe\Documents\Visual Studio 2013\Projects\ArctionResizeBug\ArctionResizeBug\bin\Release\ArctionResizeBug.exe
Faulting module path: C:\WINDOWS\System32\DriverStore\FileRepository\c0322096.inf_amd64_7ff7d53c3793b9e4\atidxx32.dll
Report Id: 2e7eebf6-a675-4048-94ce-9eada71f628b
Faulting package full name:
Faulting package-relative application ID:

The file "atidxx32.dll" suggests that the driver somehow crashes. I can reproduce the crash fairly easily by simply resizing the window. If I don't resize the window the app stays stable. I can pan around the chart, and everything seems okay. So there is something going on with the resizing of the chart control that makes the AMD/ATI driver barf.

Hope this helps,

//Sebastian

ArctionKestutis
Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: LCU WinForms sizing bug.

Post by ArctionKestutis » Wed Jan 24, 2018 7:41 am

Hi,

Several customers reported AccessViolationException under certain circumstances, but have been not able to reproduce them. This exception is very broad class and not point to any specific direction. However, we fixed that we found may be the issue. Those few customers tested alpha release and confirmed that LightningChart is much more stable after the fixes. Therefore, I would recommend testing the latest public version 8.2.2.1, all those modification included there.

Hope this helps.
All the best.

ArctionKestutis
Posts: 383
Joined: Mon Mar 14, 2016 9:22 am

Re: LCU WinForms sizing bug.

Post by ArctionKestutis » Thu Jan 25, 2018 3:35 pm

On my 'AMD Radeon HD 6450' card, still no problem even with your project.

unvestigate
Posts: 8
Joined: Mon Jan 15, 2018 5:58 pm

Re: LCU WinForms sizing bug.

Post by unvestigate » Fri Jan 26, 2018 2:37 pm

Allright, thanks for the info. I'll update LCU to the newest version and try. Maybe it only occurs on newer hardware. The RX580 is a lot newer than the HD 6450.