ddcctl icon indicating copy to clipboard operation
ddcctl copied to clipboard

Question about reply checksum logic

Open aleclarson opened this issue 6 years ago • 3 comments

How did you come up with the logic for the "reply checksum" below?

https://github.com/kfix/ddcctl/blob/4818757471369543e2734ea0080fbacd37a3794b/DDC.c#L223

For the Samsung monitors I'm testing with (U28E590 & S22E310), the checksum is failing, so I'm wondering if maybe that logic isn't 100% correct.

aleclarson avatar Aug 01 '19 19:08 aleclarson

Also, any guess as to why a display's reply wouldn't pass the checksum? Could it be using a different "version" of DDC or something?

aleclarson avatar Aug 01 '19 19:08 aleclarson

I'm also curious how you conjured the IOI2CRequest incantations. Is there any guidance out there on that? Apple doesn't seem to document such things, although I found this example (but that's only for EDID test).

edit: Nevermind the next part here. Just a bug with lldb I guess.

Interestingly, lldb spits out the following when I execute p request while paused right before the DisplayRequest(displayID, &request) call:

{
  sendTransactionType = 1
  replyTransactionType = 1
  sendAddress = 110
  replyAddress = 111
  sendSubAddress = '\0'
  replySubAddress = 'Q'
  __reservedA = ([0] = '\0', [1] = '\0')
  minReplyDelay = 0
  result = 0
  commFlags = 0
  __padA = 5
  sendBytes = 0
  __reservedB = ([0] = 0, [1] = 0)
  __padB = 11
  replyBytes = 0
  completion = 0xefbfd75000000000
  sendBuffer = 17275764039804289022
  replyBuffer = 32766
  __reservedC = ([0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0, [6] = 0, [7] = 0, [8] = 0, [9] = 32767)
}

That's a read request for the display's brightness. Notice how sendBytes and replyBytes are strangely zero. Not sure why the assignment isn't being respected. Any ideas?

aleclarson avatar Aug 01 '19 20:08 aleclarson

How did you come up with the logic for the "reply checksum" below?

https://github.com/kfix/ddcctl/blob/4818757471369543e2734ea0080fbacd37a3794b/DDC.c#L223

For the Samsung monitors I'm testing with (U28E590 & S22E310), the checksum is failing, so I'm wondering if maybe that logic isn't 100% correct.

I didn't come up with it, code came from this: https://github.com/jontaylor/DDC-CI-Tools-for-OS-X/blob/master/ddc/ddc.c#L118

kfix avatar Sep 10 '19 16:09 kfix