Open jonpas opened 4 years ago
Wow thanks @shinyquagsire23! Your script works great on my LG 34WN80C-B and I can finally do software input switching.
Since this monitor only has dp-1, 0xd1
is actually the usb-c input, but otherwise the script works perfectly.
@rockowitz thanks for adding this debug option (and having remarkably simple build documentation!)
sadly i tried this on my LG 43UN700-B and had no luck. although ddcutil says its done w/ OK 0, nothing happens after writing any known good values for inputs others have discovered (0xf4
, 0xd0
, 0xd2
, 0xd1
, 0x90
).
reading back the register it doesn't appear to have changed, 0xF4
always reads as sl=0x20
- although this is maybe expected if i'm reading other peoples results correctly
additionally, there is no diff between scanning registers when connected to HDMI1 vs DP1. this monitor has the ports HDMI1,2,34, DP, USBC.
future readers note that we can add the LG 43UN700-B to the unsupported monitors list for 0x60
. lg, life's good, but your monitor firmware isn't!
logs of reading/writing for reference: https://gist.github.com/benjamingwynn/bd8525cc86803847f9b3a3e3f069db2b
i wonder if LG are using a different version of their firmware for this monitor, since it has far more hdmi ports than usual ultrawide monitors. its worth noting that this monitor supports PIP and the OSD looks like the typical lg stuff so i'd expect it to be mostly the same, but maybe its entirely different?
A note for others with an LG 32QN650-B, that this approach for changing inputs works well. Tested using ddcutil version 2.0.0-rc1. To set Input HDMI1
for Display 1
,
$ ddcutil -d 1 setvcp xf4 x0090 --i1 x50 --noverify
For this monitor with three inputs, HDMI1, HDMI2, DP1
, the Input values are x0090, x0091, x00d0
respectively.
A little nervous about using this hidden "debug" interface, but desperation wins out. If this turns out to be a common use case, it would be nice to create a first-class option.
That's great to know.
The feature has until now been triggered by the "hidden" development option --i1 because there was no confirmation that it actually was useful and worked as intended. Your report indicates that's the case and it's time for a formal option. Another confirmation would seal the decision.
A note for others with an LG 32QN650-B, that this approach for changing inputs works well. Tested using ddcutil version 2.0.0-rc1. To set
Input HDMI1
forDisplay 1
,
$ ddcutil -d 1 setvcp xf4 x0090 --i1 x50 --noverify
For this monitor with three inputs,
HDMI1, HDMI2, DP1
, the Input values arex0090, x0091, x00d0
respectively.
Tested successfully on a LG 27UN850-W. I was able to switch from the USB-C input to the HDMI1, HDMI2 and DP1 inputs with the same codes.
Thanks!
Given confirmations that setting an alternative I2C source address works as expected, I've added option --i2c-source-addr in branch 2.0.0-dev. Utility option --i1 no longer performs this action. The option applies to the getvcp and setvcp commands.
Anyone tried switching inputs with GP950?
A follow-up to report that the new option "--ic2-source-addr" works well with my LG 32QN650-B monitor. Compiled from 2.0.0-dev branch July 12. A big thanks to rockowitz! To select Input HDMI1,
ddcutil -d 1 setvcp xF4 x0090 --i2c-source-addr=x50 --noverify
The "--noverify" option is still required as the monitor does not return good data for the corresponding getvcp command. If anyone figures out how to query the current input setting for these broken monitors, please let me know.
I have a pair of 32UD99-W. Has anyone managed to change from DisplayPort to USB-C? The following are confirmed as normal.
0x0090 = HDMI1 x0091 = HDMI2
FYI, I'm using a beta build of https://github.com/alin23/Lunar as I'm on MacOS, but thought I'd ask in here for the next person googling around with this model no :)
Have you tried using one of the following? In order of likelihood,
x00D2 (USB-C) x00D1 (Display Port 2) x00D0 (Display Port 1)
Would it be possible for us to start a wiki page, not sure if @rockowitz would be fine if it'll be part of this github project listing LG-specific custom comments/inputs per model?
That sounds like a good idea. I have 49WQ95C-W and would love to see the implementation of hotkey HDMI switching.--Sent from my Android phone with mail.com Mail. Please excuse my brevity.On 7/15/23, 3:45 PM Anton Romanov @.***> wrote:
Would it be possible for us to start a wiki page, not sure if @rockowitz would be fine if it'll be part of this github project listing LG-specific custom comments/inputs per model? —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
Have you tried using one of the following? In order of likelihood,
x00D2 (USB-C) x00D1 (Display Port 2) x00D0 (Display Port 1)
0xE0 is Display Port (there's no DP2 on this model) 0xC0 is USB-C.
I had to loop over each value to guess it. Happy to suggested them in the wiki if there's one
Accidentally closed. I did not mean to terminate this active and productive issue. However, it may be more useful to continue this topic as a discussion, summarizing what has been learned on the wiki.
I have a 27BN88Q-B and have been having the same problem as OP, but I've been using the side channel fix for a few weeks now without issue. Posting here because I've been trying to stay on top of any fixes for this, and noticed that my monitor family does not seem to be included in the wiki (unless I'm reading the model numbers wrong). I've been successfully switching between HDMI 1 (0x90) and display port 1 (0xD0) and have not tested the two other ports yet. Once I get back to my computer I can confirm whether or not all of the inputs (two HDMI, one DisplayPort, one USB-C) can be switched via the side channel.
Off topic but thought I'd mention: This monitor seems to only accept i2c on one of its input ports at a time (ddcutil detect --verbose
does not tell me anything as to why). I can't control my monitor from my host computer via HDMI, but the computer that is connected via display port can communicate and switch inputs with ddcutil using the side channel. Very strange.
For my LG 27UP850, indeed setvcp x60
does not function, much like all the other newer LG monitors described on this issue. It flickers off then back on without switching inputs. And indeed getvcp x60
reports x00.
The new --i2c-source-addr=x50
option for setvcp xf4 x00nn
works pretty well. The inputs on my 27UP850 are mapped to the following values:
Input | Value |
---|---|
HDMI 1 | x0090 |
HDMI 2 | x0091 |
DisplayPort | x00D0 |
USB Type-C (DisplayPort Alt-Mode) | x00D1 |
Thanks for all your work on this @rockowitz, @shinyquagsire23 and others.
(It's a pity I can't really do this on Windows using e.g. winddcutil given Win32 only seems to expose DDC/CI via the monitor control API.)
This monitor doesn't seem to support PBP -- using --i2c-source-addr=x51
with setvcp xd7 x000n
where n is 1, 2, 3, 5 doesn't do anything.
My monitor's i2c interface disappears once the input is switched away. Switching input back using OSD sometimes does not restore it -- I have to unplug and replug the DisplayPort connector.
My LG UltraGear 27GP850P-B reacts poorly to all recommendations here so far. If I'm using the DP cable on my Linux machine, Windows on HDMI2 and try those:
for code in 90 91 d0; do
ddcutil -d 3 setvcp xF4 0x${code} --i2c-source-addr=x50 --noverify
done
The monitor simply blinks to black then comes back without switching inputs.
My LG UltraGear 27GP850P-B reacts poorly to all recommendations here so far. If I'm using the DP cable on my Linux machine, Windows on HDMI2 and try those:
for code in 90 91 d0; do ddcutil -d 3 setvcp xF4 0x${code} --i2c-source-addr=x50 --noverify done
The monitor simply blinks to black then comes back without switching inputs.
I basically used this, which takes a few minutes to cycle through everything:
for a in 9 a b c d e f
do
for b in 0 1 2 3
do
set -x
ddcutil -b 25 setvcp xf4 x00$a$b --i2c-source-addr=x50 --noverify
set +x
sleep 6
done
done
which iterated through up to 28 values to identify which ones mapped to which inputs. However, on my monitor, those values that did not map to an input source basically had no effect on the monitor, so perhaps your monitor's controller is somehow different from the monitor controllers of most of the other LG monitors discussed here.
On my 27UP850 it was sufficient to repeatedly pull the control joystick towards myself as the commands were invoked to identify the current selected input source.
Can confirm this works for 29UM69G, the original monitor this issue was made with. :tada: Amazing work by everyone!
I have updated the wiki page with its input codes.
Any chance of porting this tool to windows?
On Mon, Aug 28, 2023, 18:15 jonpas @.***> wrote:
Can confirm this works for 29UM69G, the original monitor this issue was made with. 🎉 Amazing work by everyone!
I have updated the wiki page with its input codes.
— Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcutil/issues/100#issuecomment-1695779788, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEJTZP4K55Z3XZCMMCB4ZNLXXSRZLANCNFSM4J22O4BA . You are receiving this because you commented.Message ID: @.***>
ddcutil could be ported to Windows. Much of the lower layers responsible for I2C and DDC operations should be replaceable by Windows system calls, both simplifying the code and likely increasing its reliability (more robust I2C support in drivers, etc.). On the other hand, some functionality would likely be lost. There are a lot of Linux system calls throughout the code. This would be a non-trivial project for someone familiar with Windows programming and with using the Linux subsystem in Windows.
Unfortunately, the main API for DDC in Windows is SetVCPFeature, which does not allow to use a different I2C address. I've seen some APIs for I2C, but I'm not sure they are accessible from user space, and they might be "graphics card specific".
Yes, the only way to implement this in Windows is to use proprietary extension SDKs (ADL, NVAPI, IGCL). I've been working on a tool specific for my own LG monitor using ADL and IGCL (I don't have a Nvidia GPU to test with)
Can someone clarify the status of ADL on Windows? On Linux it applies only to the old proprietary fglrx driver, and support for it was pulled from ddcutil. Poking around, it appears that AMD continues to maintain it for Windows, not on their web site, but on https://github.com/GPUOpen-LibrariesAndSDKs.
ADL still works on Windows and is being updated semi regularly
I managed to use NVAPI to send input change: https://gist.github.com/drzony/1744b4f72dcd4fde309a125445c474a1 Unfortunately I'm getting the same results as @moviuro . The monitor (38WN95C) just blinks to black for a second and does not switch the input. The good news is that I was able to enable PBP using the code above. I'll release the code with fallback to Windows APIs as soon as I'm finished with it.
Is it possible run ddcutil on raspberry pi 3 and use it as a dedictated monitor switch controller? Does the hdmi on which raspberry pi is connected need to be active for ddcutil to work?
On Fri, Sep 1, 2023, 02:26 Drzony @.***> wrote:
I managed to use NVAPI to send input change: https://gist.github.com/drzony/1744b4f72dcd4fde309a125445c474a1 Unfortunately I'm getting the same results as @moviuro https://github.com/moviuro . The monitor (38WN95C) just blinks to black for a second and does not switch the input. The good news is that I was able to enable PBP using the code above.
— Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcutil/issues/100#issuecomment-1701862025, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEJTZP3DFCOEIB4CIRYVUDLXYEFRTANCNFSM4J22O4BA . You are receiving this because you commented.Message ID: @.***>
@yeahman45 yes, it only responds to DDC when it's the 'focused' input. The best way to handle it via RPi would be over USB, which I think my script might have gotten buried a bit but that's actually part of the reason I never bothered using I2C, whatever is plugged into USB can always control DDC.
Script is at https://gist.github.com/shinyquagsire23/f6b2adef253c6c3ab557a4852bf3abad for switching inputs, I also have nicer abstractions in https://github.com/shinyquagsire23/lg_display_manager/blob/main/display_manager.py but I also did a lot of (!!monitor specific!!) firmware patches to get fine-grained control of the PBP.
Thx for ur reply. Usb? Connect rpi to the monitor using usb? My monitor does not have a usb port.
On Fri, Sep 1, 2023, 09:45 Max Thomas @.***> wrote:
@yeahman45 https://github.com/yeahman45 yes, it only responds to DDC when it's the 'focused' input. The best way to handle it via RPi would be over USB, which I think my script might have gotten buried a bit but that's actually part of the reason I never bothered using I2C, whatever is plugged into USB can always control DDC.
Script is at https://gist.github.com/shinyquagsire23/f6b2adef253c6c3ab557a4852bf3abad for switching inputs, I also have nicer abstractions in https://github.com/shinyquagsire23/lg_display_manager/blob/main/display_manager.py but I also did a lot of (!!monitor specific!!) firmware patches to get fine-grained control of the PBP.
— Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcutil/issues/100#issuecomment-1702197263, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEJTZP6S2VB2Y5T4MVTWYBDXYFY55ANCNFSM4J22O4BA . You are receiving this because you were mentioned.Message ID: @.***>
@shinyquagsire23 Thanks for all your work. I'm still unable to get USB working. Can you point me as to where you got the "wrapping" values for HID? I can figure out some values from your code, but it would be nice to have some more info, so I could try to figure out what goes wrong on my monitor.
@aeleus not sure honestly, the easiest way would be via USB instead of i2c though, since i2c apparently has to go through GPU drivers which is its own mess. I've got a basic python script if anyone wants to try on Windows:
https://gist.github.com/shinyquagsire23/f6b2adef253c6c3ab557a4852bf3abad
Do you mean the service port USB on back of monitor or USB type c monitors. I have 24GN650N which apparently has service USB port on back.
My LG UltraGear 27GP850P-B reacts poorly to all recommendations here so far. If I'm using the DP cable on my Linux machine, Windows on HDMI2 and try those:
for code in 90 91 d0; do ddcutil -d 3 setvcp xF4 0x${code} --i2c-source-addr=x50 --noverify done
The monitor simply blinks to black then comes back without switching inputs.
I basically used this, which takes a few minutes to cycle through everything:
for a in 9 a b c d e f do for b in 0 1 2 3 do set -x ddcutil -b 25 setvcp xf4 x00$a$b --i2c-source-addr=x50 --noverify set +x sleep 6 done done
which iterated through up to 28 values to identify which ones mapped to which inputs. However, on my monitor, those values that did not map to an input source basically had no effect on the monitor, so perhaps your monitor's controller is somehow different from the monitor controllers of most of the other LG monitors discussed here.
On my 27UP850 it was sufficient to repeatedly pull the control joystick towards myself as the commands were invoked to identify the current selected input source.
Amazing, this is the mapping for model 34GL750
. Now I just have to fix the Display not found
problem when trying to switch back to HDMI1.
0x90 - HDMI 1 0x91 - HDMI 2 0xd0 - DP 1
Hello,
I post here to report that this also works on my LG ULTRAGEAR 32GP850-B
, manufactured in the week 12 of 2023.
ddcutil -d 1 setvcp xF4 x0090 --i2c-source-addr=x50 --noverify
0x0090 switches to HDMI-1 0x0091 switches to HDMI-2 0x00D0 switches to DP-1
Hi.
Thank you for the tip, folks!
I post here to report that this also works on my
LG ULTRAGEAR 32GP850-B
, manufactured in the week 12 of 2023.
ddcutil -d 1 setvcp xF4 x0090 --i2c-source-addr=x50 --noverify
0x0090 switches to HDMI-1 0x0091 switches to HDMI-2 0x00D0 switches to DP-1
Works for LG 34WN650-W
34" 21:9 monitor with /bin/ddcutil from ddcutil-2.1.2.
The --i2c-source-addr
flag is not recognized by /bin/ddcutil from ddcutil-1.4.5 package. So I updated client binary /bin/ddcutil to ddcutil-2.1.2 on my GNU/Linux system.
Hi,
The following works perfectly for me on LG monitor 35WN75C-B when I'm connected through HDMI but not when I'm connected from USB-C.
ddcutil -d 1 setvcp xF4 x0090 --i2c-source-addr=x50 --noverify
Also xd7 split the screen
Does anyone have any idea why it doesn't work on USB-C?
When i run "ddcutil capabilities" with my display attached via displayport it only gives me the Values for HDMI1, HDMI2, DP1 and DP2.
Feature: 52 (Active control) Feature: 60 (Input Source) Values: 11: HDMI-1 12: HDMI-2 0f: DisplayPort-1 10: DisplayPort-2 Feature: AC (Horizontal frequency) Feature: AE (Vertical frequency)
@alimoezzi https://www.ddcutil.com/usb/
Would be great if i can switch the inputs via shortcut because the osd is really slow.
I was able to get input switching working on Windows with my LG ULTRAGEAR 27GP850-B with these values: 0x90 switches to HDMI-1 0x91 switches to HDMI-2 0xD0 switches to DP-1
I adapted some sample code in the NVIDIA API for sending i2c commands https://github.com/kaleb422/NVapi-write-value-to-monitor
I was able to get input switching working on Windows with my LG ULTRAGEAR 27GP850-B with these values: 0x90 switches to HDMI-1 0x91 switches to HDMI-2 0xD0 switches to DP-1
I adapted some sample code in the NVIDIA API for sending i2c commands https://github.com/kaleb422/NVapi-write-value-to-monitor
Doesnt work on 34GN850-B unfortunately :(
For my LG 27UP850, indeed
setvcp x60
does not function, much like all the other newer LG monitors described on this issue. It flickers off then back on without switching inputs. And indeedgetvcp x60
reports x00.The new
--i2c-source-addr=x50
option forsetvcp xf4 x00nn
works pretty well. The inputs on my 27UP850 are mapped to the following values:Input Value HDMI 1 x0090 HDMI 2 x0091 DisplayPort x00D0 USB Type-C (DisplayPort Alt-Mode) x00D1 Thanks for all your work on this @rockowitz, @shinyquagsire23 and others.
(It's a pity I can't really do this on Windows using e.g. winddcutil given Win32 only seems to expose DDC/CI via the monitor control API.)
This monitor doesn't seem to support PBP -- using
--i2c-source-addr=x51
withsetvcp xd7 x000n
where n is 1, 2, 3, 5 doesn't do anything.My monitor's i2c interface disappears once the input is switched away. Switching input back using OSD sometimes does not restore it -- I have to unplug and replug the DisplayPort connector.
This works for LG HDR WQHD
as well. Thanks heaps!
I was able to get input switching working on Windows with my LG ULTRAGEAR 27GP850-B with these values: 0x90 switches to HDMI-1 0x91 switches to HDMI-2 0xD0 switches to DP-1
I adapted some sample code in the NVIDIA API for sending i2c commands https://github.com/kaleb422/NVapi-write-value-to-monitor
This works for my LG 32un880-b 👍
I was able to get input switching working on Windows with my LG ULTRAGEAR 27GP850-B with these values: 0x90 switches to HDMI-1 0x91 switches to HDMI-2 0xD0 switches to DP-1
I adapted some sample code in the NVIDIA API for sending i2c commands https://github.com/kaleb422/NVapi-write-value-to-monitor
Yo thanks for sharing! I'm getting an error: "NvAPI_EnumNvidiaDisplayHandle() failed with status -6" Apologies if this is a newbie query, I didn't manage to make any sense of it from the code. If it helps, I'm connected to a single LG 29WN600-W monitor via USB-C docking stations.
Hi,
I have the same monitor LG ULTRAGEAR 27GP850-B and trying to change value in VSC to display 1, mine is 1 here and not 0 it seems like. But when i try to update the .exe though VSC like this early in the code:
int display_index = 1; BYTE input_value = 0x90; BYTE command_code = 0xF4; //VCP code or equivalent BYTE register_address = 0x50;
And trying to run it it changes the .exe to an .obj and says that it can´t find the .exe file, what am I doing wrong? (I´m a beginner in VSC and starting it though "delevoper command prompot for VS"
I was able to get input switching working on Windows with my LG ULTRAGEAR 27GP850-B with these values: 0x90 switches to HDMI-1 0x91 switches to HDMI-2 0xD0 switches to DP-1
I adapted some sample code in the NVIDIA API for sending i2c commands https://github.com/kaleb422/NVapi-write-value-to-monitor
unfortunately does not seem to work on my lg 29um68 :(
Did anyone manage to make it work in LG UltraGear 32GR93U-B ? (Windows 11)
In ControlMyMonitor the monitor has this values. xF4 does not seem to change when I manually change from DisplayPort to Hdmi2. Thus, I am a bit afraid to try change it to any of these values: HDMI 1 x0090 HDMI 2 x0091 DisplayPort x00D0
I was able to get input switching working on Windows with my LG ULTRAGEAR 27GP850-B with these values: 0x90 switches to HDMI-1 0x91 switches to HDMI-2 0xD0 switches to DP-1 I adapted some sample code in the NVIDIA API for sending i2c commands https://github.com/kaleb422/NVapi-write-value-to-monitor
Yo thanks for sharing! I'm getting an error: "NvAPI_EnumNvidiaDisplayHandle() failed with status -6" Apologies if this is a newbie query, I didn't manage to make any sense of it from the code. If it helps, I'm connected to a single LG 29WN600-W monitor via USB-C docking stations.
@Synvani Looks like you're getting the return value NVAPI_NVIDIA_DEVICE_NOT_FOUND which means "No NVIDIA device found in the system". This solution uses the NVIDIA API are you running an NVIDIA gpu?
Hi,
I have the same monitor LG ULTRAGEAR 27GP850-B and trying to change value in VSC to display 1, mine is 1 here and not 0 it seems like. But when i try to update the .exe though VSC like this early in the code:
int display_index = 1; BYTE input_value = 0x90; BYTE command_code = 0xF4; //VCP code or equivalent BYTE register_address = 0x50;
And trying to run it it changes the .exe to an .obj and says that it can´t find the .exe file, what am I doing wrong? (I´m a beginner in VSC and starting it though "delevoper command prompot for VS"
@SlimmaB try running the exe with command line arguments like this "writeValueToScreen.exe 1 0x90 0xF4 0x50". Otherwise you can try compiling the source code unaltered then run it the same way
@kaleb422 Your "script" works on LG-UltraGear-32GR93U-B with the exact same numbers exist on README: https://github.com/kaleb422/NVapi-write-value-to-monitor
Which is really interesting, because I forgot to change display-id and used "0" as you did.
But check here the ddcutil-detect output on my PC:
>>>>>C:\Users\xx\Downloads>winddcutil.exe detect
1 Dell S2721DGF (DP) (Another monitor I use)
2 glgl (That's my UltraGear, just renamed)
3 Generic PnP Monitor (Laptop's display I guess...
As long it works, I won't ask for more. Thank you.
Any luck with 32MP60G?
I was able to get input switching working on Windows with my LG ULTRAGEAR 27GP850-B with these values: 0x90 switches to HDMI-1 0x91 switches to HDMI-2 0xD0 switches to DP-1
I adapted some sample code in the NVIDIA API for sending i2c commands https://github.com/kaleb422/NVapi-write-value-to-monitor
thank you very much for your great work . it worked for me half of it.what i mean is i used hdmi2 for the monitor with one computer and hdmi1 for another latop, then i used the command code is: writeValueToDisplay.exe 0 0x90 0xF4 0x50, it works fine to swicth to hdmi1,but when i used codes: writeValueToDisplay.exe 0 0x91 0xF4 0x50, it cannot switch back.
how do i switch back to hdmi2??? many thanks.
LG 29UM69G fails at switching monitor inputs. I did not try other capabilities. Performing
$ ddcutil --display 2 setvcp 60 0x[0f|11]
simply flashes the screen, but nothing changes.There is no
Supports DDC: [true|false]
in the output.$ ddcutil environment
shows all permissions are correct (read & write).This shows up correctly as
VGA-1 (sl=0x01)
for display 1 (secondary monitor).ClickMonitorDDC on Windows has the same issue of reporting
0x00
and not being able to switch.Both monitors are connected to both an integrated GPU (Intel CPU) and dedicated GPU (GTX 1060) in the following way (VFIO setup):
Thank you in advance!