Contribute
Register

Controlling Your Monitor with OSX: DDC Panel

Status
Not open for further replies.
Joined
Aug 3, 2012
Messages
9
Motherboard
Asus > need model # > See Rules!
CPU
i7-3770K
Graphics
HD 7970
Mac
  1. Mac Pro
Mobile Phone
  1. iOS
Hi Guys! I have a problem with my AOC D2757Ph
In DDC Panel all slider are inactive
Скриншот 2014-06-22 09.02.32.png
however i can adjust brightness and contrast in setddc, but there are some problems with reading data

Code:
[SIZE=1][COLOR=#000000][FONT=Monaco]2014-06-22 09:05:07.564 setddc[39843:507] I: found 1 displays2014-06-22 09:05:07.565 setddc[39843:507] I: polling display 1's EDID[/FONT]
[FONT=Monaco]2014-06-22 09:05:07.590 setddc[39843:507] I: got edid.name: D2757[/FONT]
[FONT=Monaco]2014-06-22 09:05:07.590 setddc[39843:507] I: got edid.serial: AUCD59A000019[/FONT]
[FONT=Monaco]2014-06-22 09:05:07.591 setddc[39843:507] D: command arg-pair: d: 1[/FONT]
[FONT=Monaco]2014-06-22 09:05:07.591 setddc[39843:507] D: command arg-pair: b: ?[/FONT]
[FONT=Monaco]2014-06-22 09:05:07.592 setddc[39843:507] D: querying VCP control: #16 =?[/FONT]
[FONT=Monaco]2014-06-22 09:05:07.593 setddc[39843:507] E: Failed to send DDC command![/FONT][/COLOR][/SIZE]

Here softMCCS dump and ioreg
 

Attachments

  • softMCCS.log
    22.8 KB · Views: 182
Joined
Aug 6, 2012
Messages
7
Motherboard
I didn't
CPU
read the
Graphics
Rules
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac mini
Are you using a DVI cable with your monitor? I had the same issues when using VGA cables.

If that isn't the problem, then you have to use Xcode to debug the read attempt to get the exact Kernel error for the send failure, it doesn't get relayed to setddc itself.

Just open the .xcodproj file in the Finder and press Opt + < (Opt+Shift+,).
select the "setddc" in the Scheme drop-down list, and then pick the "Run setddc" target in the pane on the left.
Add "-d", "1", "-b" and "?" to the "arguments passed on launch" list. Then hit "OK".

use the file navigator on the left to get to DDC Panel/DDC.c
scroll to the DisplayRequest() function.
look for the line starting with "IOObjectRelease".
click once in the left-most margin of that line, a big blue arrow should then fill the margin: you have just set a breakpoint for debugging.

now hit the big "Play" button in the top left corner.

a debug panel will pop-up on the bottom showing a stack viewer and the console output.
the execution will stop at the breakpoint and you can view the stack, showing all the variables' state at the breakpoint.

the first time you hit the breakpoint will be when setddc is looking at the EDID for the monitor's name string.
if you hit the small Play button above the stack viewer (hover-over help says "continue program execution"), execution will continue to the failing query-brightness attempt and will break again. the stack will look different to the last break, the differences may indicate how the I2C write is failing.


I can't really do all that for you from my end, and no dump can help me simulate your monitors firmware or kernel.
good luck!
 
Joined
Aug 3, 2012
Messages
9
Motherboard
Asus > need model # > See Rules!
CPU
i7-3770K
Graphics
HD 7970
Mac
  1. Mac Pro
Mobile Phone
  1. iOS
Thanks for reply! I'am using HDMI
And that's what we have:

1st breakpoint at IOObjectRelease

Скриншот 2014-06-23 05.00.31.png

2nd
Скриншот 2014-06-23 05.11.44.png

And some strange stuff from ddcread and getcontrol

Скриншот 2014-06-23 05.15.12.png

Скриншот 2014-06-23 05.20.23.png

Where it fails i don't understand :oops:
 

SJ_UnderWater

Moderator
Joined
Dec 3, 2010
Messages
461
Motherboard
Gigabyte GA-H55M-S2V
CPU
Intel i3-530
Graphics
HIS HD 6570
Mac
  1. iMac
Classic Mac
Mobile Phone
  1. Android
If you can write but have trouble reading, it's possible the read delay isn't long enough. Since it's set in the kernel, simply stepping through the debugger won't help, which by the way, you shouldn't do in the critical IOKit section because you're accessing shared system resources and lingering there can have side-effects.

The default value used by DDC Panel is based on what should mathematically be the latency of the connection, but it's not precise; even long cables can disrupt it. I haven't found a good, performant value so far.
 
Joined
Aug 3, 2012
Messages
9
Motherboard
Asus > need model # > See Rules!
CPU
i7-3770K
Graphics
HD 7970
Mac
  1. Mac Pro
Mobile Phone
  1. iOS
Can you share source of some older version? As i remember reading worked for one of them but with wrong values.
 
Joined
Aug 6, 2012
Messages
7
Motherboard
I didn't
CPU
read the
Graphics
Rules
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac mini
I guess SJ is suggesting that you increase kDelayBase in DDC.c a little more.
 
Joined
Aug 3, 2012
Messages
9
Motherboard
Asus > need model # > See Rules!
CPU
i7-3770K
Graphics
HD 7970
Mac
  1. Mac Pro
Mobile Phone
  1. iOS
I tried to increase the value from 30 to 100 and it does not help. Is there any sense to trying greater value? I think no.
 
Joined
Aug 6, 2012
Messages
7
Motherboard
I didn't
CPU
read the
Graphics
Rules
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac mini
Yeah, I wouldn't increase the delay any more than 100.

The result logic in DisplayRequest() and DDCRead() may be raising an error with your monitor even though you could be getting some data back.

Try this and see what that data is:
Code:
[COLOR=#703DAA][FONT=Menlo]uint[/FONT][/COLOR][FONT=Menlo] get_control([/FONT][COLOR=#703DAA][FONT=Menlo]CGDirectDisplayID[/FONT][/COLOR][FONT=Menlo] cdisplay, [/FONT][COLOR=#703DAA][FONT=Menlo]uint[/FONT][/COLOR][FONT=Menlo] control_id)[/FONT][FONT=Menlo]{[/FONT]
[COLOR=#4F8187][FONT=Menlo][COLOR=#bb2ca2]struct [/COLOR]DDCReadCommand[COLOR=#000000] command;[/COLOR][/FONT][/COLOR]
[FONT=Menlo]   command.[COLOR=#4f8187]control_id[/COLOR] = control_id;[/FONT]
[FONT=Menlo]   command.[COLOR=#4f8187]max_value[/COLOR] = [COLOR=#272ad8]0[/COLOR];[/FONT]
[FONT=Menlo]   command.[COLOR=#4f8187]current_value[/COLOR] = [COLOR=#272ad8]0[/COLOR];[/FONT]
[FONT=Menlo]
[/FONT]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#3d1d81]NSLog[/COLOR][COLOR=#000000]([/COLOR]@"D: querying VCP control: #%u =?"[COLOR=#000000], command.[/COLOR][COLOR=#4f8187]control_id[/COLOR][COLOR=#000000]);[/COLOR][/FONT][/COLOR]
[FONT=Menlo]   [COLOR=#bb2ca2]if[/COLOR] (![COLOR=#31595d]DDCRead[/COLOR](cdisplay, &command)){[/FONT]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#3d1d81]NSLog[/COLOR][COLOR=#000000]([/COLOR]@"E: DDC send command failed!"[COLOR=#000000]);[/COLOR][/FONT][/COLOR]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#3d1d81]NSLog[/COLOR][COLOR=#000000]([/COLOR]@"E: VCP control #%u = current: %u, max: %u"[COLOR=#000000], command.[/COLOR][COLOR=#4f8187]control_id[/COLOR][COLOR=#000000], command.[/COLOR][COLOR=#4f8187]current_value[/COLOR][COLOR=#000000], command.[/COLOR][COLOR=#4f8187]max_value[/COLOR][COLOR=#000000]);[/COLOR][/FONT][/COLOR]
[FONT=Menlo]   } [COLOR=#bb2ca2]else[/COLOR] {[/FONT]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#3d1d81]NSLog[/COLOR][COLOR=#000000]([/COLOR]@"I: VCP control #%u = current: %u, max: %u"[COLOR=#000000], command.[/COLOR][COLOR=#4f8187]control_id[/COLOR][COLOR=#000000], command.[/COLOR][COLOR=#4f8187]current_value[/COLOR][COLOR=#000000], command.[/COLOR][COLOR=#4f8187]max_value[/COLOR][COLOR=#000000]);[/COLOR][/FONT][/COLOR]
[FONT=Menlo]   }[/FONT]
[FONT=Menlo]   [COLOR=#bb2ca2]return[/COLOR] command.[COLOR=#4f8187]current_value[/COLOR];[/FONT]
[FONT=Menlo]}
[/FONT]
 
Joined
Aug 3, 2012
Messages
9
Motherboard
Asus > need model # > See Rules!
CPU
i7-3770K
Graphics
HD 7970
Mac
  1. Mac Pro
Mobile Phone
  1. iOS
2014-06-24 20:43:46.186 setddc[3798:303] I: found 1 displays
2014-06-24 20:43:46.187 setddc[3798:303] I: polling display 1's EDID
2014-06-24 20:43:46.210 setddc[3798:303] I: got edid.name: D2757
2014-06-24 20:43:46.211 setddc[3798:303] I: got edid.serial: AUCD59A000019
2014-06-24 20:43:46.211 setddc[3798:303] D: command arg-pair: d: 1
2014-06-24 20:43:46.212 setddc[3798:303] D: command arg-pair: b: ?
2014-06-24 20:43:46.212 setddc[3798:303] D: querying VCP control: #16 =?
2014-06-24 20:43:46.213 setddc[3798:303] E: DDC send command failed!
2014-06-24 20:43:46.214 setddc[3798:303] E: VCP control #16 = current: 0, max: 0
Program ended with exit code: 0
 

SJ_UnderWater

Moderator
Joined
Dec 3, 2010
Messages
461
Motherboard
Gigabyte GA-H55M-S2V
CPU
Intel i3-530
Graphics
HIS HD 6570
Mac
  1. iMac
Classic Mac
Mobile Phone
  1. Android
The other possibility is it needs more time between write and read, so try adding a "sleep(1);" before the second dispatch_semaphore_signal in AppDelegate.m. That would explain why EDID works, but write/read doesnt.
 
Status
Not open for further replies.
Top