Contribute
Register

Controlling Your Monitor with OSX: DDC Panel

Status
Not open for further replies.
The main idea behind that was to get the brightness buttons and illumination HUD from the system (sort of faking presence of ACPI PNLF). I took the BrightnessMenulet sources recently and added your DDC files to it and my main issue was that i couldn`t listen for the apple F1 and F2 keys from original apple keyboard.

The question is how the system handles those commands, is the Brightness kext the only component which receives those signals and if yes, is it possible to intercept those commands and use it for DDC and not for PNLF?
 
If I double click DDC Panel.app it freezes right away
That difference is because a little restructuring moved the commands into an earlier part of the app launch. If you understand how to use Xcode, you should consider debugging the procedure yourself using the source zip, modifying the delay scaling as necessary. None of the machines I can access have this issue.

The main idea behind that was to get the brightness buttons and illumination HUD from the system (sort of faking presence of ACPI PNLF)
as you can see in the DDC source, the events are sent to all apps if they fire. If the BezelUIServer doesn't launch, the events weren't sent; if brightness isn't supported, there don't appear to be any userspace events generated.
 
Tested on a 3 display system:

NVIDIA GeForce GTX 770:


Chipset Model: NVIDIA GeForce GTX 770
Type: GPU
Bus: PCIe
PCIe Lane Width: x16
VRAM (Total): 2048 MB
Vendor: NVIDIA (0x10de)
Device ID: 0x1184
Revision ID: 0x00a2
ROM Revision: preset 1.0.0
Displays:
HP 2310:
Resolution: 1920 x 1080 @ 60 Hz
Pixel Depth: 32-Bit Color (ARGB8888)
Display Serial Number: 3CQ0442J37
Main Display: Yes
Mirror: Off
Online: Yes
Rotation: Supported
IBM9512 T541:
Resolution: 1024 x 768 @ 60 Hz
Pixel Depth: 32-Bit Color (ARGB8888)
Display Serial Number: 2326338
Mirror: Off
Online: Yes
Rotation: Supported
E2350:
Resolution: 1920 x 1080 @ 60Hz (1080p)
Pixel Depth: 32-Bit Color (ARGB8888)
Display Serial Number:
Mirror: Off
Online: Yes
Rotation: Supported
Television: Yes

Here are the results:

Screen Shot 2014-02-22 at 8.57.28 AM.pngScreen Shot 2014-02-22 at 8.58.33 AM.pngScreen Shot 2014-02-22 at 8.58.37 AM.png

The older HP display seems not to work with the 'magic', however all display dimming/contrast works with the newer LG display. The IBM display is VGA>DVI - don't think it's capable.
 
the version tony used, plus an addition to support factory-resetting the monitor, are now up. v1.6
 
Thanks works well here - Mac Pro 2013, Dell UP2414Q 4K display, only brightness slider works but that's all i need.

I linked the brightness keyboard buttons with scripts that call your app to manage brightness from the keyboard using BetterTouchTool and a pair of AppleScript files to increase / decrease brightness.

How about a command line utility ? Would be more convenient that emulating clicking on the brightness slider with scripts!
 
the point of DDC Panel was as a test app, that's why the source is posted alongside. If you want a command line version to fit your needs, I suggest you look into it.
 
attached is SJ's Xcode project containing an additional command line proggy I whipped up

How-to download, extract, build, and run:

Code:
$ cd DDC Panel
$ xcodebuild -target setddc
...
** BUILD SUCCEEDED **
$ build/Release/setddc
2014-04-15 01:13:21.435 setddc[4557:507] I: found 2 displays
2014-04-15 01:13:21.437 setddc[4557:507] Usage: setddc -d <1-N> [display#]
    -b <0-??> [brightness]
    -c <0-??> [contrast]
    -m <1|2> [mute speaker OFF/ON]
    -v <0-254> [speaker volume]
    -i <1-12> [select input source]
$ setddc -d 1 -b 50 -c 50
2014-04-15 01:18:34.865 setddc[4567:507] I: found 2 displays
2014-04-15 01:18:34.866 setddc[4567:507] I: polling display 1's EDID
2014-04-15 01:18:34.895 setddc[4567:507] I: got edid.name: HP LP2465
2014-04-15 01:18:34.896 setddc[4567:507] I: got edid.serial: CNK7220HT9
2014-04-15 01:18:34.897 setddc[4567:507] I: command arg: d: 1
2014-04-15 01:18:34.897 setddc[4567:507] I: command arg: b: 50
2014-04-15 01:18:34.898 setddc[4567:507] I: sending DDC command: 16 = 50
2014-04-15 01:18:34.947 setddc[4567:507] I: command arg: c: 50
2014-04-15 01:18:34.948 setddc[4567:507] I: sending DDC command: 18 = 50
$

I leave it to you to install it where you want, write your related applescripts, launchd jobs, etc etc.
I do insist you hook up a second monitor for your terminal to develop your toggle scripts. And not blame me if your target monitor's OSD explodes with a fiery bolt to your face! The low-level communication code is shared with the GUI app, but this console app does almost no checking of your input before sending it to the monitor.

Use the GUI app to figure out the number values you want for the settings. I don't have speakers on my monitor so I couldn't test the audio switches. The input switcher did work for me.

my mavericks 64-bit build is in the zip, if you don't want to install GB's of Xcode.. although you should, its free!

SJ, feel free to merge (and mangle) this into your releases if it meets your approval. Same GPL license as the rest of it.
 

Attachments

  • DDC Panel 1.6.setddc.zip
    514.6 KB · Views: 324
Everyone is free to make derivatives so long as they comply with the license. I don't expect to do more than bug fixes.
 
@joeykork:
hey, thanks for the command line utility.
i have one wish, though: getddc functionality would be nice. maybe you could add that?
thank you!
 
updated with get function (?) and incremental/decremental function ( - or +, good for hotkey assignments). enjoy!

Code:
Usage:
 setddc -d <1-..> [display#]
    -b <1-..> [brightness]
    -c <1-..> [contrast]
    -m <1|2> [mute speaker OFF/ON]
    -v <1-254> [speaker volume]
    -i <1-12> [select input source]
 -X ? (queries setting X)
 -X <NN>- (decreases setting X by NN)
 -X <NN>+ (increases setting X by NN)

$ setddc -d 1 -b ?
setddc[2880:507] I: found 2 displays
setddc[2880:507] I: polling display 1's EDID
setddc[2880:507] I: got edid.name: HP LP2465
setddc[2880:507] I: got edid.serial: CNK7220HT9
setddc[2880:507] D: command arg-pair: d: 1
setddc[2880:507] D: command arg-pair: b: ?
setddc[2880:507] D: querying VCP control: #16 =?
setddc[2880:507] I: VCP control #16 = current: 50, max: 100

$ setddc -d 1 -b 50+
setddc[2878:507] I: found 2 displays
setddc[2878:507] I: polling display 1's EDID
setddc[2878:507] I: got edid.name: HP LP2465
setddc[2878:507] I: got edid.serial: CNK7220HT9
setddc[2878:507] D: command arg-pair: d: 1
setddc[2878:507] D: command arg-pair: b: 50+
setddc[2878:507] D: querying VCP control: #16 =?
setddc[2878:507] I: VCP control #16 = current: 50, max: 100
setddc[2878:507] D: relative setting: 50 + 50 = 100
setddc[2878:507] D: setting VCP control #16 => 100
 

Attachments

  • DDC Panel 1.6.setddc+1.zip
    528.9 KB · Views: 390
Status
Not open for further replies.
Back
Top