Hello Guest

[FIXED] getAvailableDisplayModes() hangs for a long time

  • 7 Replies
  • 13318 Views
[FIXED] getAvailableDisplayModes() hangs for a long time
« on: December 03, 2013, 01:05:06 »
Hello, everyone!

Before I get to the issue I would like to say that this is my first time posting here, and that the question required to register was quite clever :P. That is all.

Now, the issue... The Display.getAvailableDisplayModes() hangs for several seconds. I measured the time it takes for it to return (multiple times) and the average time I got was about 8.2 seconds! :o
But I found the reason why it does that! Multiple monitors plugged in! Unplugging my second display reduced the time to aprox. 0.45 seconds, so that's a temporary fix until this gets fixed (if it can be fixed).
The difference between the number of display modes possibly has something to do with it. 284 with both displays on, 62 without the other display.

-I have a BenQ monitor and a Samsung TV
-AMD Radeon HD 6870 2xCrossfire
-Display drivers are up to date (13.11 beta v9.2, I believe)
-AMD Phenom II X6 1055T
-Windows 7 64-bit

I would also like to mention that one (older, 12.xx) driver version reduced the return time to about 4 seconds, IIRC...
Crossfire didn't have any effect on the length of time the method takes and neither did the OS display settings (show desktop, what is primary display, mirror or expand).

EDIT: Changed subject to show that the issue has been resolved by Spasi.
« Last Edit: December 03, 2013, 16:32:54 by EnergyRay »

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: [BUG] getAvailableDisplayModes() hangs for a long time
« Reply #1 on: December 03, 2013, 11:25:51 »
Hey EnergyRay,

Could you provide some additional info?

- Are the two displays connected on the same GPU?
- Does it happen if you only have the Samsung TV connected?
- Do you use AMD's Eyefinity groups?

Re: [BUG] getAvailableDisplayModes() hangs for a long time
« Reply #2 on: December 03, 2013, 14:36:41 »
Hello, spasi!

Firstly, yes both were connected to the same GPU.
Secondly, no, I do not use Eyefinity.

I tested connecting to the other GPU (which doesn't allow me to mirror the display contents as you might guess/know) and measured the time and the results:
-BenQ as primary: 1 second and 62 display modes
-Samsung as primary: 8.5 seconds and 322 display modes (A whole bunch more display modes than before)

Then I unplugged the BenQ and got 6.5 seconds and 322 display modes (didn't matter which gpu it was plugged in).

I also went back and tested the difference between mirroring and expanding the desktops and here's the results:
-Mirror: 8.8 seconds and 284 display modes (this is what I have normally as it's the default)
-Expand; BenQ as primary: 1.7 seconds and 62 display modes
-Expand; Samsung as primary: 14 seconds and 322 display modes (a new record time!)

I also noted that there was a +/- 0.5 second difference in each getAvailableDisplayModes() call no matter the setup (and occasionally, but rarely, takes up to 4 seconds longer with the TV plugged)
So it seems that the TV is the cause of the problem.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: [BUG] getAvailableDisplayModes() hangs for a long time
« Reply #3 on: December 03, 2013, 15:52:54 »
Thank you EnergyRay, I was able to reproduce this and found a fix. It actually makes a massive difference even for normal monitors:

Before the fix
Samsung TV as primary - 6692ms
Dell monitor as primary - 1511ms

After the fix
Samsung TV as primary - 29ms
Dell monitor as primary - 8ms

Re: [BUG] getAvailableDisplayModes() hangs for a long time
« Reply #4 on: December 03, 2013, 16:31:04 »
Hurrah!

Thank you for fixing that! I previously had to add a small launch option to not get all of the display modes and use the default desktop one. No one wants to wait for 10 seconds for an application to start up.
One small question: will the current release version be patched with this change?

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: [BUG] getAvailableDisplayModes() hangs for a long time
« Reply #5 on: December 03, 2013, 16:35:33 »
One small question: will the current release version be patched with this change?

I hope so. Will let you know asap.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: [FIXED] getAvailableDisplayModes() hangs for a long time
« Reply #6 on: December 04, 2013, 11:08:11 »
There will be a 2.9.2 release soon.

*

Offline Matzon

  • *****
  • 2242
Re: [FIXED] getAvailableDisplayModes() hangs for a long time
« Reply #7 on: December 04, 2013, 21:45:27 »
I'll do a 2.9.2 asap, was planned for today, but had to reschedule.