ddccontrol / ddccontrol-db

DDC Control Monitor Database
GNU General Public License v2.0
116 stars 101 forks source link

LG 27UD58 (with reverse-engineered codes) #80

Open xtknight opened 5 years ago

xtknight commented 5 years ago

Hope this helps someone. These are some codes I reverse engineered for the LG 27UD58. I suspect they may match codes of other LG monitors as well. For some reason, I couldn't get i2c/DDC working through the HDMI ports so I only got VCP codes pertinent to the DisplayPort connection (the HDMI has some extra features like black level and deep color in the OSD). :(

LG 27UD58 (GSM5B09) VCP codes

0x15        PICTURE MODE (11=custom, 1=reader, 32=photo, 48=cinema, 9=dark room 1, 10=dark room2, 6=color weakness, 28=fps game 1, 29=fps game 2, 13=rts game, 14=custom (game))
0x87        SHARPNESS (0-100)
0xf5        RATIO (1=wide, 2=original)
0xf6        SMART ENERGY SAVING (0=off, 1=low, 2=high)
0xf7        RESPONSE TIME (0=off, 1=high, 2=middle, 3=low)
0xf8        FREESYNC (0=off, 2=basic, 3=extended)
0xf9        BLACK STABILIZER (0-100)
0xfe        GAMMA (1=gamma0, 2=gamma1, 3=gamma2, 4=off)

NOTE:
    - picture mode preset may not change all settings the same way as OSD does: sometimes have to change brightness/contrast, or other things, too
    - game modes may disable DSP to reduce input lag, so certain features like super resolution or DFC are not available in game modes
    - generic VCP codes like brightness, contrast, red, green, blue gain, audio volume seem to be working
    - haven't checked if input source works

Not detected in VCP codes...

????        SUPER RESOLUTION
????        DFC
????        COLOR TEMP
????        SIX-COLOR RedHue/RedSaturation/etc
????        POWER LED (not 0xfd as reported)
????        AUTOMATIC STANDBY

Other (don't recommend changing these... may malfunction)

0x92        LANGUAGE (0/65535=English, 11776/402=German, ... ????)

DISPLAY-PORT 1.2 disabled: (don't recommend changing these... may malfunction)

Control 0xac: +/1164/1 C [???]
Control 0xae: +/3002/0 C [???]

DISPLAY-PORT 1.2 enabled: (don't recommend changing these... may malfunction)

Control 0xac: +/2228/2 C [???]
Control 0xae: +/5999/0 C [???]

Here's the log (minus the warning)...

$ LANG= LC_ALL= sudo ddccontrol -p -c -d
ddccontrol version 0.4.3
Copyright 2004-2005 Oleg I. Vdovikin (oleg@cs.msu.su)
Copyright 2004-2006 Nicolas Boichat (nicolas@boichat.ch)
This program comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of this program under the terms of the GNU General Public License.

Probing for available monitors....I/O warning : failed to load external entity "/usr/share/ddccontrol-db/monitor/GSM5B09.xml"
Document not parsed successfully.
..I/O warning : failed to load external entity "/usr/share/ddccontrol-db/monitor/GSM598E.xml"
Document not parsed successfully.
...
Detected monitors :
 - Device: dev:/dev/i2c-4
   DDC/CI supported: Yes
   Monitor Name: LG Standard LCD
   Input type: Digital
  (Automatically selected)
 - Device: dev:/dev/i2c-2
   DDC/CI supported: Yes
   Monitor Name: LG Standard LCD
   Input type: Digital
Reading EDID and initializing DDC/CI at bus dev:/dev/i2c-4...
I/O warning : failed to load external entity "/usr/share/ddccontrol-db/monitor/GSM5B09.xml"
Document not parsed successfully.

EDID readings:
    Plug and Play ID: GSM5B09 [LG Standard LCD]
    Input type: Digital

Capabilities:
Raw output: (prot(monitor)type(lcd)27UD58cmds(01 02 03 0C E3 F3)vcp(02 04 05 08 10 12 14(05 08 0B ) 16 18 1A 52 60( 11 12 0F 10) AC AE B2 B6 C0 C6 C8 C9 D6(01 04) DF 62 8D F4 F5(01 02) F6(00 01 02) 4D 4E 4F 15(01 06 11 13 14 28 29 32 48) F7(00 01 02 03) F8(00 01) F9 E4 E5 E6 E7 E8 E9 EA EB EF FD(00 01) FE(00 01 02) FF)mccs_ver(2.1)mswhql(1))
Parsed output: 
    VCP: 02 04 05 08 10 12 14 15 16 18 1a 4d 4e 4f 52 60 62 8d ac ae b2 b6 c0 c6 c8 c9 d6 df e4 e5 e6 e7 e8 e9 ea eb ef f4 f5 f6 f7 f8 f9 fd fe ff 
    Type: LCD

Controls (valid/current/max) [Description - Value name]:
Control 0x00: +/0/65535   [???]
Control 0x01: +/0/65535   [???]
Control 0x02: +/1/2 C [Secondary Degauss - Secondary Degauss]
Control 0x03: +/0/65535   [???]
Control 0x04: +/0/255 C [Restore Factory Defaults]
Control 0x05: +/0/1 C [Restore Brightness and Contrast]
Control 0x06: +/0/255   [???]
Control 0x07: +/0/65535   [???]
Control 0x08: +/0/255 C [Restore Factory Default Color]
Control 0x09: +/0/65535   [???]
Control 0x0a: +/0/65535   [???]
Control 0x0b: +/0/24028   [???]
Control 0x0c: +/35/100   [???]
Control 0x0d: +/0/65535   [???]
Control 0x0e: +/50/100   [???]
Control 0x0f: +/0/65535   [???]
Control 0x10: +/55/100 C [Brightness]
Control 0x11: +/0/65535   [???]
Control 0x12: +/55/100 C [Contrast]
Control 0x13: +/0/65535   [???]
Control 0x14: +/5/11 C [???]
Control 0x15: +/11/255 C [???]
Control 0x16: +/50/100 C [Red maximum level]
Control 0x17: +/0/65535   [???]
Control 0x18: +/50/100 C [Green maximum level]
Control 0x19: +/0/65535   [???]
Control 0x1a: +/50/100 C [Blue maximum level]
Control 0x1b: +/0/65535   [???]
Control 0x1c: +/0/65535   [???]
Control 0x1d: +/0/65535   [???]
Control 0x1e: +/0/2   [???]
Control 0x1f: +/0/65535   [???]
Control 0x20: +/0/100   [???]
Control 0x21: +/0/65535   [???]
Control 0x22: +/0/65535   [???]
Control 0x23: +/0/65535   [???]
Control 0x24: +/0/65535   [???]
Control 0x25: +/0/65535   [???]
Control 0x26: +/0/65535   [???]
Control 0x27: +/0/65535   [???]
Control 0x28: +/0/65535   [???]
Control 0x29: +/0/65535   [???]
Control 0x2a: +/0/65535   [???]
Control 0x2b: +/0/65535   [???]
Control 0x2c: +/0/65535   [???]
Control 0x2d: +/0/65535   [???]
Control 0x2e: +/0/65535   [???]
Control 0x2f: +/0/65535   [???]
Control 0x30: +/0/100   [???]
Control 0x31: +/0/65535   [???]
Control 0x32: +/0/65535   [???]
Control 0x33: +/0/65535   [???]
Control 0x34: +/0/65535   [???]
Control 0x35: +/0/65535   [???]
Control 0x36: +/0/65535   [???]
Control 0x37: +/0/65535   [???]
Control 0x38: +/0/65535   [???]
Control 0x39: +/0/65535   [???]
Control 0x3a: +/0/65535   [???]
Control 0x3b: +/0/65535   [???]
Control 0x3c: +/0/65535   [???]
Control 0x3d: +/0/65535   [???]
Control 0x3e: +/50/100   [???]
Control 0x3f: +/0/65535   [???]
Control 0x40: +/0/65535   [???]
Control 0x41: +/0/65535   [???]
Control 0x42: +/0/65535   [???]
Control 0x43: +/0/65535   [???]
Control 0x44: +/0/65535   [???]
Control 0x45: +/0/65535   [???]
Control 0x46: +/0/65535   [???]
Control 0x47: +/0/65535   [???]
Control 0x48: +/0/65535   [???]
Control 0x49: +/0/65535   [???]
Control 0x4a: +/0/65535   [???]
Control 0x4b: +/0/65535   [???]
Control 0x4c: +/0/65535   [???]
Control 0x4d: +/32307/65535 C [???]
Control 0x4e: +/16384/65535 C [???]
Control 0x4f: +/0/65535 C [???]
Control 0x50: +/0/65535   [???]
Control 0x51: +/0/65535   [???]
Control 0x52: +/0/255 C [???]
Control 0x53: +/0/65535   [???]
Control 0x54: +/0/65535   [???]
Control 0x55: +/0/65535   [???]
Control 0x56: +/0/65535   [???]
Control 0x57: +/0/65535   [???]
Control 0x58: +/0/65535   [???]
Control 0x59: +/0/65535   [???]
Control 0x5a: +/0/65535   [???]
Control 0x5b: +/0/65535   [???]
Control 0x5c: +/0/65535   [???]
Control 0x5d: +/0/65535   [???]
Control 0x5e: +/0/65535   [???]
Control 0x5f: +/0/65535   [???]
Control 0x60: +/15/18 C [Input Source Select]
Control 0x61: +/0/65535   [???]
Control 0x62: +/76/100 C [Audio Speaker Volume Adjust]
Control 0x63: +/0/65535   [???]
Control 0x64: +/0/65535   [???]
Control 0x65: +/0/65535   [???]
Control 0x66: +/0/65535   [???]
Control 0x67: +/0/65535   [???]
Control 0x68: +/0/65535   [???]
Control 0x69: +/0/65535   [???]
Control 0x6a: +/0/65535   [???]
Control 0x6b: +/0/65535   [???]
Control 0x6c: +/50/100   [???]
Control 0x6d: +/0/65535   [???]
Control 0x6e: +/50/100   [???]
Control 0x6f: +/0/65535   [???]
Control 0x70: +/50/100   [???]
Control 0x71: +/0/65535   [???]
Control 0x72: +/0/65535   [???]
Control 0x73: +/0/65535   [???]
Control 0x74: +/0/65535   [???]
Control 0x75: +/0/65535   [???]
Control 0x76: +/0/65535   [???]
Control 0x77: +/0/65535   [???]
Control 0x78: +/0/65535   [???]
Control 0x79: +/0/65535   [???]
Control 0x7a: +/0/65535   [???]
Control 0x7b: +/0/65535   [???]
Control 0x7c: +/0/65535   [???]
Control 0x7d: +/0/65535   [???]
Control 0x7e: +/0/65535   [???]
Control 0x7f: +/0/65535   [???]
Control 0x80: +/0/65535   [???]
Control 0x81: +/0/65535   [???]
Control 0x82: +/0/65535   [???]
Control 0x83: +/0/65535   [???]
Control 0x84: +/0/65535   [???]
Control 0x85: +/0/65535   [???]
Control 0x86: +/0/65535   [???]
Control 0x87: +/50/100   [???]
Control 0x88: +/0/65535   [???]
Control 0x89: +/0/65535   [???]
Control 0x8a: +/0/65535   [???]
Control 0x8b: +/0/65535   [???]
Control 0x8c: +/0/65535   [???]
Control 0x8d: +/2/100 C [???]
Control 0x8e: +/0/65535   [???]
Control 0x8f: +/0/65535   [???]
Control 0x90: +/0/65535   [???]
Control 0x91: +/0/65535   [???]
Control 0x92: +/0/65535   [???]
Control 0x93: +/0/65535   [???]
Control 0x94: +/0/65535   [???]
Control 0x95: +/0/65535   [???]
Control 0x96: +/0/65535   [???]
Control 0x97: +/0/65535   [???]
Control 0x98: +/0/65535   [???]
Control 0x99: +/0/65535   [???]
Control 0x9a: +/0/65535   [???]
Control 0x9b: +/0/65535   [???]
Control 0x9c: +/0/65535   [???]
Control 0x9d: +/0/65535   [???]
Control 0x9e: +/0/65535   [???]
Control 0x9f: +/0/65535   [???]
Control 0xa0: +/0/65535   [???]
Control 0xa1: +/0/65535   [???]
Control 0xa2: +/0/65535   [???]
Control 0xa3: +/0/65535   [???]
Control 0xa4: +/0/65535   [???]
Control 0xa5: +/0/65535   [???]
Control 0xa6: +/0/65535   [???]
Control 0xa7: +/0/65535   [???]
Control 0xa8: +/0/65535   [???]
Control 0xa9: +/0/65535   [???]
Control 0xaa: +/0/65535   [???]
Control 0xab: +/0/65535   [???]
Control 0xac: +/2228/2 C [???]
Control 0xad: +/0/65535   [???]
Control 0xae: +/5999/0 C [???]
Control 0xaf: +/0/65535   [???]
Control 0xb0: +/0/65535   [???]
Control 0xb1: +/0/65535   [???]
Control 0xb2: +/0/65535 C [???]
Control 0xb3: +/0/65535   [???]
Control 0xb4: +/0/65535   [???]
Control 0xb5: +/0/65535   [???]
Control 0xb6: +/3/5 C [???]
Control 0xb7: +/0/65535   [???]
Control 0xb8: +/0/65535   [???]
Control 0xb9: +/0/65535   [???]
Control 0xba: +/0/65535   [???]
Control 0xbb: +/0/65535   [???]
Control 0xbc: +/0/65535   [???]
Control 0xbd: +/0/65535   [???]
Control 0xbe: +/0/65535   [???]
Control 0xbf: +/0/65535   [???]
Control 0xc0: +/2980/65535 C [???]
Control 0xc1: +/0/65535   [???]
Control 0xc2: +/0/65535   [???]
Control 0xc3: +/0/65535   [???]
Control 0xc4: +/0/65535   [???]
Control 0xc5: +/0/65535   [???]
Control 0xc6: +/104/65535 C [???]
Control 0xc7: +/0/65535   [???]
Control 0xc8: +/5/255 C [???]
Control 0xc9: +/773/65535 C [???]
Control 0xca: +/2/2   [???]
Control 0xcb: +/0/65535   [???]
Control 0xcc: +/0/255   [???]
Control 0xcd: +/0/65535   [???]
Control 0xce: +/0/65535   [???]
Control 0xcf: +/0/65535   [???]
Control 0xd0: +/0/65535   [???]
Control 0xd1: +/0/65535   [???]
Control 0xd2: +/0/65535   [???]
Control 0xd3: +/0/65535   [???]
Control 0xd4: +/0/65535   [???]
Control 0xd5: +/0/65535   [???]
Control 0xd6: +/1/5 C [DPMS Control - On]
Control 0xd7: +/0/65535   [???]
Control 0xd8: +/0/65535   [???]
Control 0xd9: +/0/65535   [???]
Control 0xda: +/0/65535   [???]
Control 0xdb: +/0/65535   [???]
Control 0xdc: +/0/65535   [???]
Control 0xdd: +/0/65535   [???]
Control 0xde: +/0/65535   [???]
Control 0xdf: +/513/255 C [???]
Control 0xe0: +/0/65535   [???]
Control 0xe1: +/0/65535   [???]
Control 0xe2: +/0/65535   [???]
Control 0xe3: +/0/65535   [???]
 Control 0xe4: +/0/255 C [???]
Control 0xe5: +/0/179 C [???]
Control 0xe6: +/0/65535 C [???]
Control 0xe7: +/0/65535 C [???]
Control 0xe8: +/0/255 C [???]
Control 0xe9: +/2/255 C [???]
Control 0xea: +/0/255 C [???]
Control 0xeb: +/0/1 C [???]
Control 0xec: +/0/65535   [???]
Control 0xed: +/0/65535   [???]
Control 0xee: +/0/65535   [???]
Control 0xef: +/4/65535 C [???]
Control 0xf0: +/0/65535   [???]
Control 0xf1: +/0/65535   [???]
Control 0xf2: +/0/65535   [???]
Control 0xf3: +/0/65535   [???]
Control 0xf4: +/6/65535 C [???]
Control 0xf5: +/2/255 C [???]
Control 0xf6: +/0/255 C [???]
Control 0xf7: +/2/255 C [???]
Control 0xf8: +/0/255 C [???]
Control 0xf9: +/0/255 C [???]
Control 0xfa: +/0/65535   [???]
Control 0xfb: +/0/65535   [???]
Control 0xfc: +/0/65535   [???]
Control 0xfd: +/0/65535 C [Power LED - Off]
Control 0xfe: +/2/255 C [???]
Control 0xff: +/0/65535 C [???]
kravemir commented 5 years ago

Hi, seems like lots of yours effort went to investigation. Would you like to prepare PR with monitor, and test it? I'll gladly review and cooperate towards getting merged a nice support for new monitor.

xtknight commented 5 years ago

Hi...I'm not really sure which of these settings match with the preset options in options.xml. The options are quite unique to this monitor. I can't find any options that match well except for Sharpness. Does this mean we have to modify options.xml too?

kravemir commented 5 years ago

I'm not really sure which of these settings match with the preset options in options.xml

Yes, they to match ones in options.xml, which is built from /db/options.xml.in.

The options are quite unique to this monitor. I can't find any options that match well except for Sharpness. Does this mean we have to modify options.xml too?

Range 0xe0 to 0xff is custom, not covered by any standard, so it makes sense, that they are unique. However, you may reuse existing control from options.xml, and just use it with different addresses and values, also you may add new value options to it, but only relevant ones would be shown for each monitor.

So, please, update also options.xml.in. Add, or reuse, options,.. I'll double check it when I'll do PR review.

awdpro commented 4 years ago

I have a LG 27UL500 I'm also trying to right a simple batch file to switch inputs as it is too time consuming to do via the monitor. I used clickmonitoddc & control my monitor to try to create but have not been successful in changing the input. 60 is supposed to be the change input VCP code. With my inputs being 17, 18 & 15. Below are three .bat files I created but none of them seem to work. These are all the same code however I used different variations of the monitor name trying to get this to work. Any idea what I'm doing wrong here?

ControlMyMonitor.exe /SetValue "\.\DISPLAY3\Monitor0" 60 17

ControlMyMonitor.exe /SetValue "LG HDR 4K" 60 17

ControlMyMonitor.exe /SetValue "MONITOR\GSM7707{4d36e96e-e325-11ce-bfc1-08002be10318}\0004" 60 17

zzhiyi commented 4 years ago

ControlMyMonitor.exe /SetValue ".\DISPLAY3\Monitor0" 60 17

I think you missed a \ in ".\DISPLAY3\Monitor0", which should have two \ before .

yeahman45 commented 4 years ago

I have a LG 27UL500 I'm also trying to right a simple batch file to switch inputs as it is too time consuming to do via the monitor. I used clickmonitoddc & control my monitor to try to create but have not been successful in changing the input. 60 is supposed to be the change input VCP code. With my inputs being 17, 18 & 15. Below are three .bat files I created but none of them seem to work. These are all the same code however I used different variations of the monitor name trying to get this to work. Any idea what I'm doing wrong here?

ControlMyMonitor.exe /SetValue ".\DISPLAY3\Monitor0" 60 17

ControlMyMonitor.exe /SetValue "LG HDR 4K" 60 17

ControlMyMonitor.exe /SetValue "MONITOR\GSM7707{4d36e96e-e325-11ce-bfc1-08002be10318}\0004" 60 17

Hi any luck? I have the LG 29UM68 and only switching to hdmi1 works (17)...all other source doesn't work 15 and 18 :(

awdpro commented 4 years ago

I was never able to figure it out so I gave up.

Sent from my iPad

On Jun 9, 2020, at 2:22 AM, yeahman45 notifications@github.com wrote:

 I have a LG 27UL500 I'm also trying to right a simple batch file to switch inputs as it is too time consuming to do via the monitor. I used clickmonitoddc & control my monitor to try to create but have not been successful in changing the input. 60 is supposed to be the change input VCP code. With my inputs being 17, 18 & 15. Below are three .bat files I created but none of them seem to work. These are all the same code however I used different variations of the monitor name trying to get this to work. Any idea what I'm doing wrong here?

ControlMyMonitor.exe /SetValue ".\DISPLAY3\Monitor0" 60 17

ControlMyMonitor.exe /SetValue "LG HDR 4K" 60 17

ControlMyMonitor.exe /SetValue "MONITOR\GSM7707{4d36e96e-e325-11ce-bfc1-08002be10318}\0004" 60 17

Hi any luck? I have the LG 29UM68 and only switching to hdmi1 works (17)...all other source doesn't work 15 and 18 :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

yeahman45 commented 4 years ago

well it is a shame :( ... I would have had a perfect software kvm solution with input director switching my usb mouse and keyboard... right now I can only switch to hdmi1 but cannot switch back to displayport after that.. which is a shame

awdpro commented 4 years ago

You got further than me!

Sent from my iPad

On Jun 9, 2020, at 9:50 AM, yeahman45 notifications@github.com wrote:

 well it is a shame :( ... I would have had a perfect software kvm solution with input director switching my usb mouse and keyboard... right now I can only switch to hdmi1 but cannot switch back to displayport after that.. which is a shame

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

baldurfour commented 1 year ago

Here goes nothing... Did you guys manage to get it working? It works perfectly on Dell but on LG monitors it doesn't... the input tries to change but goes back to the same input :(

ControlMyMonitor.exe /Switchvalue "\.\DISPLAY4\Monitor0" 60 15 18 ^ ^ DP HDMI2

ImIOImI commented 1 year ago

Here goes nothing... Did you guys manage to get it working? It works perfectly on Dell but on LG monitors it doesn't... the input tries to change but goes back to the same input :(

ControlMyMonitor.exe /Switchvalue ".\DISPLAY4\Monitor0" 60 15 18 ^ ^ DP HDMI2

I couldn't get it working with my LG monitor either. The screen goes blank temporarily like it's going to switch but when the screen comes back on the port is unchanged. I did notice that no matter what port I'm using, the set value seems to be "0." I suspect this is a bug in LG monitors. My Dell monitors work without issue, though.