Jump to content

  • Log In with Google      Sign In   
  • Create Account

Problem about multi-monitors


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 KenTon   Members   -  Reputation: 106

Like
0Likes
Like

Posted 05 September 2012 - 01:24 AM

My computer connect 6 monitors,the layout is
1 2 3
4 5 6
If any one of the monitors is off, how do i know whick monitor is off,is there config in registry?
for instance, if 5 is off, only 1,2,3,4,6 are left, how can i know the former layout is the first row,1,2,3 the second row4,5,6?

Sponsor:

#2 Bacterius   Crossbones+   -  Reputation: 3879

Like
2Likes
Like

Posted 05 September 2012 - 05:04 AM

Depending on your definition of the word "off" (does it mean no power, or just the display turned off), there is no obvious way to detect whether a monitor is off. This is because the monitor is interfaced only through the graphics card, which doesn't really care either way - if there's something plugged in the VGA/DVI/HMDI cable, it'll pump frames and possibly audio through it, and if there isn't, it'll just discard them. But there is no standardized way for the graphics card to tell the operating system that the monitor is"off".

There are always hacks you can use to try and detect this - of course, as hacks, they are unreliable, substandard, and often not portable as they depend on specific hardware - for instance, monitors sometimes provide EDID information such as HDMI capabilities etc... to the operating system interactively. You could request this information from a specific monitor in your layout, and if it doesn't return anything, you can probably assume the monitor is off.

There's also GetDevicePowerState, from this stackoverflow thread, but be warned it doesn't work for all monitors.

Also, since you use 6 monitors, I would assume you use Eyefinity (since not many solutions exist for this many monitors), if so, perhaps the guys at AMD thought about this and worked out some sort of API to track which monitors are actually active, perhaps to rearrange the monitor layout (say monitors 1 and 4 go off, then you are left with a square configuration and the system automatically accounts for this and ignores the two leftmost monitors).

Of course, the reason there is no correct solution to your problem is because it is not generally useful to know if a monitor is on or not, so I suspect I have misinterpreted your question. If so, can you please state so and reformulate, as I do not really understand what you are looking for.

Edited by Bacterius, 05 September 2012 - 05:08 AM.

"The best comment is a deleted comment."
website · blog


#3 KenTon   Members   -  Reputation: 106

Like
0Likes
Like

Posted 05 September 2012 - 08:10 PM

Depending on your definition of the word "off" (does it mean no power, or just the display turned off), there is no obvious way to detect whether a monitor is off. This is because the monitor is interfaced only through the graphics card, which doesn't really care either way - if there's something plugged in the VGA/DVI/HMDI cable, it'll pump frames and possibly audio through it, and if there isn't, it'll just discard them. But there is no standardized way for the graphics card to tell the operating system that the monitor is"off".

There are always hacks you can use to try and detect this - of course, as hacks, they are unreliable, substandard, and often not portable as they depend on specific hardware - for instance, monitors sometimes provide EDID information such as HDMI capabilities etc... to the operating system interactively. You could request this information from a specific monitor in your layout, and if it doesn't return anything, you can probably assume the monitor is off.

There's also GetDevicePowerState, from this stackoverflow thread, but be warned it doesn't work for all monitors.

Also, since you use 6 monitors, I would assume you use Eyefinity (since not many solutions exist for this many monitors), if so, perhaps the guys at AMD thought about this and worked out some sort of API to track which monitors are actually active, perhaps to rearrange the monitor layout (say monitors 1 and 4 go off, then you are left with a square configuration and the system automatically accounts for this and ignores the two leftmost monitors).

Of course, the reason there is no correct solution to your problem is because it is not generally useful to know if a monitor is on or not, so I suspect I have misinterpreted your question. If so, can you please state so and reformulate, as I do not really understand what you are looking for.

Thanks for your reply.Maybe I did not present clearly, I mean, the computer may connect 8 monitors, 6 monitors, 12 monitors or other situation.If now the computer connects 6 monitors.Then I use EnumDisplayMonitors api, got the layout of the 6 monitors comparing the rcMonitor of MONITORINFOEX.the layout is
1 2 3
4 5 6
Then due some reason,one monitor of them break down or pow off anyway,I use EnumDisplayMonitors api can only get 5 monitors left,And know the first row has three monitors, the second row has two monitors,but i do not know which monitor of the next row break down, it may be 4, 5, or 6, I only know 2 monitors left the second row.
Is there record about the layout monitors info in registry?So i can know which monitor break down.
Is there GUID identity of monitor in registry?If the containerID is the GUID?
I test that if the layout is like above, i power off one monitor of them ,and then power on the monitor, the layout keep the same.So there should be some record about the layout whick monitor located which position.
thanks very much!

Edited by KenTon, 05 September 2012 - 08:18 PM.


#4 Bacterius   Crossbones+   -  Reputation: 3879

Like
0Likes
Like

Posted 05 September 2012 - 08:29 PM

Ah, I see, that seems much more tractable. Well, rcMonitor contains (as far as I can understand from the API - I cannot test having only one monitor) the monitor rectangle's coordinates with respect to the primary monitor, so you should be able to deduce which monitor went off by analyzing this rectangle's coordinates. For instance, in this case, if monitor 4 went off, you would be able to work it out because monitor 5 and 6 did not change.

One thing I do not understand is how Windows would rearrange the layout if, say, monitor 4 goes off. How does the other monitor's display change, does the display and 5 and 6 get stretched to account for the missing monitor, or do 1, 2, 3 get compressed? Or does it just leave a hole in the layout? If possible at all, can you take some clear photographs of your setup, with 6 monitors on, and then turning one off? I'm afraid I can't do it myself since I don't have multiple monitors, otherwise I would play with the API myself to try and help you Posted Image

Though the problem with this API is that if the primary monitor goes off, another monitor (we don't know which one) becomes the primary monitor, which jumbles everything up. If you can guarantee that at least one specific monitor will always remain on, it will be much easier, since rcMonitor is given relative to the primary monitor.

"The best comment is a deleted comment."
website · blog


#5 KenTon   Members   -  Reputation: 106

Like
0Likes
Like

Posted 06 September 2012 - 01:29 AM

Once unplug the HMDI of one monitor,the layout will become that all the left monitors locate in the same row
from
1 2 3
4 5 6
to
1 2 3 5 6
If one monitor only power off, it does not influence the pc layout. for instance, If just power off monitor 4,not unplug the HMDI,
the result is
1 2 3
X 5 6
there is one record in registry
Path: HKLM\SYSTEM \CurrentControlSet\Hardware Profiles\UnitedVideo\CONTROL\VIDEO
there are records about resolution and position of every plugged or unpluged monitors.
It seems the only indentity is binary data in DefaultSettings.DriverExtra. But i do not know how to analyze the data.
Now I have a idea.Make a xml file about the position and indentity when all monitors work well.
If one monitor power off or unplugged, there are distinctions to check between them,maybe the power off situation is much more difficult.I compare the work well monitors info with the recorded monitors info in xml file, then i can know whick monior break down. can this be workable?

I want use function SetupDiGetDeviceRegistryPropertyW to get the power status, resolution, relativeX, relativeY, but i do not know how to set the params in this function except power state.

Edited by KenTon, 06 September 2012 - 03:36 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS