-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Severity of VCPIOError errors #5
Comments
I have seen this behavior once before on a different monitor, what helped for that was increasing the timeout beyond the DDC-CI minimum values. Can you try increasing these constants to see if it changes the behavior? monitorcontrol.vcp.vcp_linux.LinuxVCP.GET_VCP_TIMEOUT = 0.2 # default 0.04
monitorcontrol.vcp.vcp_linux.LinuxVCP.CMD_RATE = 0.2 # default 0.05 |
Unfortunately, it does not help:
|
Huh, interesting! This is the first monitor that I have heard of that violates the spec then. I would like to keep the exceptions as the default behavior since they usually mean that the rest of the command will fail. I am thinking of a static class variable to disable exceptions; something along the lines of: monitorcontrol.vcp.vcp_linux.LinuxVCP.BYPASS_CHECKSUM: bool = True
# and others for the various locations where VCPIOError can be raised Would that work for your application? |
Bypassing only checksum won't work as most probably remaining code will fail as well. I saw this already - not only checksum was incorrect but expected data was too short thus unpacking failed and it was not caught. For my application it would be better to pass some argument during runtime down to vcp to bypass checksum and following operations and try to recover and/or use some predefined default values i.e. I have config file in which I can specify e.g. which bus number should have it bypassed and remaining one(s) should not. As I have physical access to this monitor I can prototype and propose something. What do you think? |
That would be great! 👍 It is hard to develop for something that does not meet the spec. |
I have latest Arch Linux, ddcutil works great, but I would like to use Python implementation, because I plan gui and small hw which will be set backlight value from ambient light (I finished HW, next part is SW in Python). But unfortunately latest monitorcontrol said:
But the problem is not in monitor (it is HPE243i), because on Windows |
...huh, if two people have this issue then this likely is a bug. I'll add something this weekend to optionally disable the checksum. @jiri-one does you monitor also work aside from the bad checksum? |
On Win10 I tested only get and set luminance and it worked great. But on Archlinux everything ended with bad checksum. |
I also always get the VCPIOError which says: checksum does not match: 80, but I didn't get the display run on my Ubuntu properly with other tools while it works perfect on macOS with ddcutil. |
I pushed a 2.2.0 release which disables the checksums by default. https://monitorcontrol.readthedocs.io/en/latest/api.html#checksum-behaviour This does not fully address this issue since there were also problems with the payload unpacking mentioned here. Let me know if this solves any of the problems you guys are having (or what new problems you now have). |
I tested new version on Archlinux and it is not working. |
Exact same issue at my side... :-(
… Am 05.10.2020 um 07:00 schrieb jiri-one ***@***.***>:
I tested new version on Archlinux and it is not working.
https://pastebin.com/xNYnmCP1
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@newAM Maybe you want to make some tests on my monitor? If you contact me directly on email jiri spot one in domain pm spot me (I hope I confused the spambots enough :)) then I can redirect some port on my router to my ArchLinux PC, and you can connect to it over SSH. Just if you want, it is just idea. |
Thanks for the offer @jiri-one , I may take you up on that pending the results of this next iteration. I made another release, 2.3.0 with debug logging in the VCP class (and a From the CLI can one of you repeat this with the new version (
Yours should look similar but with the exception instead of The byte values of the header and the payload will help a lot to compare with the spec. |
Hi, sorry for my delay, but covid shot me. Here is output:
|
No worries, hope you are doing well now!
Well, I am not sure what I expected, but it definitely wasn't that. I will take you up on your offer to SSH into your box if that is still open - this will require some trial and error to get to the bottom of, I sent you an email with my public SSH key. |
I got access to a failing monitor (thanks @jiri-one !) a while ago. I think I found the root cause of this issue in the way the DDC packets were being constructed. Using Jiri's monitor with
>>> hex(0x51 ^ 0x82 ^ 0x01 ^ 0x10)
'0xc2' The difference between >>> hex(0xC2 ^ 0xAC)
'0x6e' Now there's a familiar number from the DDC spec! Sure enough, shift it by one, and you get the DDC-CI command address: >>> hex(0x6E >> 1)
'0x37' Now that's where the problems start occurring, the address is set in the VCP constructor with # transmission data
data = bytearray()
data.append(self.GET_VCP_CMD)
data.append(code)
# add headers and footers
data.insert(0, (len(data) | self.PROTOCOL_FLAG))
data.insert(0, self.HOST_ADDRESS)
data.append(self.get_checksum(data))
The correct checksum is calculated if I just prepend the command address to the CRC. # transmission data
data = bytearray()
data.append(self.GET_VCP_CMD)
data.append(code)
# add headers and footers
data.insert(0, (len(data) | self.PROTOCOL_FLAG))
data.insert(0, self.HOST_ADDRESS)
data.append(
self.get_checksum(bytearray([self.DDCCI_ADDR << 1]) + data)
) Anyway, a pull-request is here to fix this: #20 Also turns out my monitors are just ignoring invalid CRC, which explains why I couldn't reproduce this 👎 |
Not a problem newAM and note, your access to my PC is still on, so if you need some more tests, it is not a problem ... because: This is version from git:
And this is version from git with replaced file from commit 27235db
|
I have a problem, is there any way to send and get commands like 6e 88 88 02 00 60 00 00 03 00 01 in vcp_linux from vcp_windows |
I'm not sure I understand the "in vcp_linux from vcp_windows" part. |
Hmm...I mean I want to use the command 03 10 00 100 on windows instead of using -set-luminance 100, and I will get the information returned by the monitor like 6F 6E 88 02... |
It has been a while since I wrote this, but I don't think you can do (exactly) that with the APIs Microsoft provides for Windows, because it abstracts away some of the headers/footers: https://learn.microsoft.com/en-us/windows/win32/api/lowlevelmonitorconfigurationapi/#functions If that's just a set/get VCP feature then you can use the |
Due to high level of errors severity it is impossible to use monitorcontrol (VCPIOError exception thrown) with monitors which do not follow the DDC/CI standard e.g. Philips 223V monitors returns corrupted data i.e. incorrect checksum and/or wrong length, despite that it is possible to control it.
Example output:
Reading 0x60...
Send: 51 82 01 60 dc | Q...
Recv: 6e | n
Invalid response, corrupted data - xor is 0x5e, length 0x08
6e 88 88 02 00 60 00 00 03 00 01 | n.........
Send: 51 82 01 60 dc | Q...
Recv: 6e | n
Invalid response, corrupted data - xor is 0x5e, length 0x08
6e 88 88 02 00 60 00 00 03 00 01 | n.........
Send: 51 82 01 60 dc | Q...
Recv: 6e | n
Invalid response, corrupted data - xor is 0x5e, length 0x08
6e 88 88 02 00 60 00 00 03 00 01 | n.........
If possible, it could be better to handle errors without throwing an exception and try to continue execution.
The text was updated successfully, but these errors were encountered: