subraizada3 / 27gn950controller

Control bias lighting on the LG 27GN950 monitor
Other
65 stars 12 forks source link

38GN950 not detected #14

Closed subraizada3 closed 2 years ago

subraizada3 commented 2 years ago

@lamyipming reported:

I have a 38GN950 connected to a displayport. Program also print out "No monitors found". The ID should be VID_043E&PID_9A8A

I found that the "usage page" of my device is 0xFF00 instead of 0xFF01

I removed the "usage_page" condition check and got through, but the monitor doesn't seem to respond to the demo commands.

subraizada3 commented 2 years ago

@lamyipming My 27GN950 presents two HID devices. One with usage page 0xff00, one with usage page 0xff01. The ff00 usage page is for something else - not sure what, but it's not for lighting control and doesn't respond to any of the lighting commands. The ff01 page is what works for lighting on my monitor.

@imkebe found that the 0xff01 usage page worked on his 38GN950.

The purpose of the usage page check is to filter out the 'useless' 0xff00 HID device, otherwise it detects the single monitor as two monitors - one which doesn't work, and one which does. Could you check what usage pages your monitor presents? From commit 72421dc, change the three marked lines in lib27gn950.py, then run the console or gui and see what it prints out.

Also you could try updating to the latest firmware through OnScreenControl. I'm not sure if that will make any difference.

def is_valid_monitor(vid, pid, usage_page):
    if vid == 0x043e and pid == 0x9a8a:  # <==== remove usage_page check
        return '27GN950 / 38GN950'
    if vid == 0x043e and pid == 0x9a57:
        return '38GL950G'
    return False

def find_monitors():
    device_paths = []
    for device in hid.enumerate():
        vid = device['vendor_id']
        pid = device['product_id']
        usage_page = device['usage_page']
        model = is_valid_monitor(vid, pid, usage_page)
        if model:
            device_paths.append({
                'path': device['path'],
                'serial': device['serial_number'],
                'model': model,
                'usage_page': usage_page,  # <====
            })
    print(device_paths)  # <====
    return device_paths
imkebe commented 2 years ago

My usb printout:

                    LG Monitor Controls:

                      Product ID: 0x9a8a
                      Vendor ID: 0x043e  (LG Electronics USA Inc.)
                      Version: 5.21
                      Serial Number: XXXXXXXXX
                      Speed: Up to 12 Mb/s
                      Manufacturer: LG Electronics Inc.
                      Location ID: 0x14521400 / 38
                      Current Available (mA): 500
                      Current Required (mA): 0
                      Extra Operating Current (mA): 0

connected via USB3.0 HUB

@lamyipming Mine was working out of the box

lamyipming commented 2 years ago

Thank you so much for the hint. It turned out that for some reason my monitor is only emitting a usage_page of ff00. {'vid': 1086, 'pid': 39562, 'usage_page': 65281, 'serial_number': '103NTMXCP011', 'path': b'\\?\hid#vid_043e&pid_9a8a&mi_01#8&3b6822ea&1&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}'}

After a factory reset on the monitor, and removing the driver on my computer, the program now works flawlessly. Please mark this issue closed.