Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Sat Apr 20, 2024 11:31 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: aspect_ratio not right?
PostPosted: Wed Oct 08, 2014 5:52 am 
Offline
Contributor

Joined: Wed Apr 07, 2010 8:04 am
Posts: 105
Location: Boston, MA
Hi folks,
Splitting hairs here, but I'm looking at the Aspect Ratio of my monitors and they seem to be backwards. My 19" has 16:10 ratio while my 17" is 5:4.

I checked other devices and they are all showing the same, it looks like the audit is mismatching aspect_ratios. Can anyone confirm?


Attachments:
Capture.PNG
Capture.PNG [ 6.77 KiB | Viewed 9416 times ]

_________________
Old OA Setup: 500 Windows 7 workstations & 200 Apple OSX with OA v1.5.2 on Windows Server 2003 and WAMP 2
New OA Setup: 100 Windows servers with OA 2.2 on Windows Server 2016 and WAMP 3
Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 11, 2014 7:25 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
After reviewing the code I want to say the aspect_ratio stuff is really not right. It is not parsing the EDID info correctly. The fact that it looks even close is just a coincidence. I'll take a stab at fixing it.


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 11, 2014 7:37 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
So try this:

Find the ratio calc code around line 1928:
[code]
ratio = ""
if (asc(mid(strarrRawEDID(tmpctr),38,1)) and 128) then ratio = "1:" else ratio = "0:"
if (asc(mid(strarrRawEDID(tmpctr),38,1)) and 64) then ratio = ratio & "1" else ratio = ratio & "0"

if ratio = "0:0" then ratio = "16:10"
if ratio = "0:1" then ratio = "4:3"
if ratio = "1:0" then ratio = "5:4"
if ratio = "1:1" then ratio = "16:9"[/code]

And change it to this:
[code] ratio = ""
for i = 0 to 7
b1 = asc(mid(strarrRawEDID(tmpctr),39+i*2,1))
b2 = asc(mid(strarrRawEDID(tmpctr),40+i*2,1))

if b1 = 1 and b2 = 1 then
Exit For
end if

if b1 = 0 then
Exit For
end if

if (b2 and 128) then ratio = "1:" else ratio = "0:"
if (b2 and 64) then ratio = ratio & "1" else ratio = ratio & "0"

if ratio = "0:0" then ratio = "16:10"
if ratio = "0:1" then ratio = "4:3"
if ratio = "1:0" then ratio = "5:4"
if ratio = "1:1" then ratio = "16:9"
next[/code]

Test! But it looks to work for me.
EDIT: Added another for loop escape clause on b1 = 0 which shouldn't happen. Also I'm not a coder and I'm just pulling info from the EDID spec and reading the source of edid-decode and twiddling the existing code a bit.
EDIT2: Stupid problem which messed up the for loop coverage. Fixed now.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 15, 2014 2:03 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
It would seem that the above algorithm is better suited for listing all the standard timings and ratios supported rather than picking the highest resolution and reporting that aspect ratio. I have several monitors of the same model where the standard timing resolution order causes the above code to pick the wrong aspect ratio.

[code]
Standard timings supported:
1280x1024@60Hz 5:4
1152x864@75Hz 4:3
ratio = 4:3
vs

Standard timings supported:
1152x864@75Hz 4:3
1280x1024@60Hz 5:4
ratio = 5:4
[/code]


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 15, 2014 2:56 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
[code] ratio = ""
x = 0
prev_x = 0
for i = 0 to 7
b1 = asc(mid(strarrRawEDID(tmpctr),39+i*2,1))
b2 = asc(mid(strarrRawEDID(tmpctr),40+i*2,1))

if b1 = 1 and b2 = 1 then
Exit For
end if

if b1 = 0 then
Exit For
end if

x = (b1 + 31) * 8
if x > prev_x then
if (b2 and 128) then ratio = "1:" else ratio = "0:"
if (b2 and 64) then ratio = ratio & "1" else ratio = ratio & "0"

if ratio = "0:0" then ratio = "16:10"
if ratio = "0:1" then ratio = "4:3"
if ratio = "1:0" then ratio = "5:4"
if ratio = "1:1" then ratio = "16:9"
prev_x = x
end if

next
if debugging > "1" then wscript.echo "monitor " & device_id & " " & model & " aspec_ratio " & ratio end if [/code]
And this is pretty bad as well. We probably need to calculate the x and y resolution to really pick the highest resolution's aspect ratio.
EDIT: Yup, this is not good enough. I have found this:
[code]Standard timings supported:
1152x864@75Hz
1280x960@60Hz
1280x1024@60Hz
1280x720@60Hz
1280x800@60Hz[/code]


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 15, 2014 9:40 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
It might be futile to use the standard timing to gather the aspect ratio. I have an Acer that reports the following in standard timings supported but is a 16x9 monitor according to the specs. My code below audits this as 16:10 not 16:9. I have other examples where this breaks down. Can't take the first timing, can't take the last and picking the highest resolution doesn't work either. So we're back to where we started with the audited aspect ratio being close to the display's native ratio just a coincidence.
[code] 02E9 G206HL standard timings supported
1152 x 864 @ 75Hz (4:3)
1280 x 720 @ 60Hz (16:9)
1280 x 800 @ 60Hz (16:10)[/code]

[code] if debugging > "1" then wscript.echo " " & device_id & " " & model & " standard timings supported" end if
ratio = ""
max_x = 0
max_y = 0
for i = 0 to 7
b1 = asc(mid(strarrRawEDID(tmpctr),39+i*2,1))
b2 = asc(mid(strarrRawEDID(tmpctr),40+i*2,1))

if b1 = 1 and b2 = 1 then
Exit For
end if

if b1 = 0 then
Exit For
end if

x = (b1 + 31) * 8

if (b2 and 128) then ratio_t = "1:" else ratio_t = "0:"
if (b2 and 64) then ratio_t = ratio_t & "1" else ratio_t = ratio_t & "0"

if ratio_t = "0:0" then
y = x * 10 / 16
ratio_t = "16:10"
end if
if ratio_t = "0:1" then
y = x * 3 / 4
ratio_t = "4:3"
end if
if ratio_t = "1:0" then
y = x * 4 / 5
ratio_t = "5:4"
end if
if ratio_t = "1:1" then
y = x * 9 / 16
ratio_t = "16:9"
end if
refresh = 60 + (b2 and &h3f)
if debugging > "1" then wscript.echo " " & x & " x " & y & " @ " & refresh & "Hz (" & ratio_t & ")" end if
if x > max_x then
max_x = x
max_y = y
ratio = ratio_t
elseif x = max_x and y > max_y then
max_y = y
ratio = ratio_t
end if

next
if debugging > "1" then wscript.echo " audited aspec_ratio " & ratio end if [/code]


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 18, 2014 2:08 am 
Offline
Contributor

Joined: Wed Apr 07, 2010 8:04 am
Posts: 105
Location: Boston, MA
Well, this is better than before, might not be picking the monitor's native resolution, but it's doing a better job at identifying the aspect ratio.

One caveat thou, when I ran it on my secondary machine, it picked up a monitor that is no longer in use. Any way to ignore "inactive" monitors?

_________________
Old OA Setup: 500 Windows 7 workstations & 200 Apple OSX with OA v1.5.2 on Windows Server 2003 and WAMP 2
New OA Setup: 100 Windows servers with OA 2.2 on Windows Server 2016 and WAMP 3


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 18, 2014 3:24 am 
Offline
Contributor

Joined: Wed Apr 07, 2010 8:04 am
Posts: 105
Location: Boston, MA
Ups... never mind. I was probably hungry and seeing double... that or something was still hanging on the registry

_________________
Old OA Setup: 500 Windows 7 workstations & 200 Apple OSX with OA v1.5.2 on Windows Server 2003 and WAMP 2
New OA Setup: 100 Windows servers with OA 2.2 on Windows Server 2016 and WAMP 3


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group