Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A reliable way to identify display devices?

I have been working on a solution for identifying display devices (telivisions in my case) to keep the main layout which is especially designed to use multi-monitors.

Let's say I have 6 televisions connected. (usually 3 of them via HDMI ports and other 3 via DVI port (using DVI-to-HDMI adapter)) and their physical locations are 3x2 like this:

TV1 ... TV2 ... TV3

TV4 ... TV5 ... TV6

The Goal

I want to display some full-screen content on each specific television. Content1 must go to TV1, Content2 must go to TV2 etc... In other words: I need to push my content to the DisplayDevice (television) - not to any Location or Screen because they can change due to Windows behavior. (see below)

As you may know, Windows does not enumerate the display devices in the order you connect them (or in fact not based on any rule at all?). It uses a total different way to enumerate displays, for example:

\.\DISPLAY3 ... \.\DISPLAY6 ... \.\DISPLAY1

\.\DISPLAY4 ... \.\DISPLAY2 ... \.\DISPLAY5

What I do to get over this, I order the televisions in Display Settings manually when I'm finished connecting all of them to match with their real locations.

The Issue

But there 's a problem here: Some television models just pretend like they 've been unplugged when they're switched off (or set to stand-by mode) and that causes Windows to drop the display device from the system and re-enumerate the display devices all over again.

Because of this behaviour (of both some television models and the Windows itself) I can not count on Screen.DisplayName property or even Screen.Location because they are variables. They both change right after the re-enumeration process.

Solutions that I've tried so far

I 've tried to get the serial numbers of all display devices, thinking that I could find a way to correlate those numbers with the Screen.DisplayName. Well, I actually managed the get there by using SetupAPI's, EnumDisplayDevices but this all went to garbage after I've realized that most of the televisions does not have a valid SerialNumber. Even the Samsung TV does not have a SerialNumber (but a Samsung monitor certainly does - so I guess it's about the difference between a "monitor" and "televisoin")

After all..

I'm still looking a way to get over this issue. The other idea that comes to my mind is, maybe I should stop trying to push the content to the Display Device (because they are unidentifiable) Maybe I should try to push the content to the graphic card's ports, which means I must determine which ports of graphic cards correlates to which display device (Screen) but I am all talking without any knowledge about it - without even knowing if such a thing is possible or not.

I'm looking for your advices, thanks by now.

like image 889
Roni Tovi Avatar asked Sep 19 '15 22:09

Roni Tovi


1 Answers

When you are using DVI, there might be a hardware solution to your problem: EDID Managers. These devices emulate a valid EDID even when the monitor behind it is turned off.

like image 82
Heiner Avatar answered Oct 18 '22 18:10

Heiner