scottaxcell / winddcutil

Windows implementation of the ddcutil Linux program for querying and changing monitor settings, such as brightness and color levels.
https://github.com/scottaxcell/winddcutil
MIT License
154 stars 19 forks source link

swap pbp / switch usb input #6

Closed nobanzai closed 9 months ago

nobanzai commented 11 months ago

Hi, for my DELL U4924DW monitor I wrote a small script to swap pbp and switch usb input:

@echo off set DDCUTIL=C:\bin\winddcutil.exe set MONITOR=0

%DDCUTIL%" setvcp %MONITOR% 0xe5 0xf000 timeout /t 1 /nobreak "%DDCUTIL%" getvcp %MONITOR% 0xe5 timeout /t 4 /nobreak "%DDCUTIL%" setvcp %MONITOR% 0xe7 0xff00 timeout /t 1 /nobreak "%DDCUTIL%" getvcp %MONITOR% 0xe7

The timeouts are necessary, because otherwise the following command isn't accecpted, because the monitor seems to be still working on the command before. In general this script works as expected, but sometimes the command to switch usb does something completely different, i.e. it switches the usb devices to a different input (HDMI1, ...). The problem also occurs, when swapping pbp is commented out, so it is not a problem with the order of commands. Swapping pbp always works as expected. When the problem occurs, getvcp 0xe7 returns "VCP 0xe7 0", while "VCP 0xe7 1500" is shown, if the command succeeds.

The problem doesn't occur with ddcutil on Linux.

scottaxcell commented 9 months ago

I have ported winddcutil to Python, can you try the latest release to see if your issue has been resolved?

scottaxcell commented 9 months ago

I cannot reproduce the issue on my end as I do not have that particular monitor. Feel free to debug the C++ source and Windows API yourself. Please create a PR if you discover a bug. Happy hunting!