Contribute
Register

Controlling Your Monitor with OSX: DDC Panel

Status
Not open for further replies.
the first slider should let you choose which display to control. machines with multiple displays should have one or more tick marks.
NVidia timing still needs a lot of work, someone needs to calculate what "30" actually is in units. ATI/AMD follows exactly what is expected, nanoseconds.
Check for exceptions by running the app from source in Xcode.
 
the first slider should let you choose which display to control. machines with multiple displays should have one or more tick marks.

When I have external monitor as primary, I see two displays (Dell U2312HM and Color LCD).
When I have laptop lcd as primary, I see only Color LCD and cannot slide to change to external Dell.
 
make sure your Dell is in the ActiveDisplayList when not primary. MainDisplayNumber() reads that list.
 
make sure your Dell is in the ActiveDisplayList when not primary. MainDisplayNumber() reads that list.

I think the problem is that there's a read failure for Color LCD when it's the primary display, which prevents further progress to populate the second display on the slider.
Code:
2013-04-03 06:07:06.973 DDC Panel[1090:303] Read Failure on 0x10

Also when external is primary display, I had to set below to prevent read failures from occurring occasionally.
Code:
    usleep(45*kMicrosecondScale);
 
uncaught exceptions cause the current thread to stop. please re-read the first post. I have cleaned up the thread because I don't want it side-tracked with explanations about how Objective-C and Cocoa work. I'm very clear in the first post about any read/write error throwing an exception, right now your issue seems to be that the delay isn't long enough for all cases.
As far as timing, checking on PJ's Pro, minReplyDelay is in milliseconds for NVidia (3*1000 = 3sec), but still nanoseconds for ATI and I believe Intel. Clearly NVidia doesn't expect anyone to use the I2C interface which is a shame and horrible practice, but there it is (filed as rdar://13867935).
If you continue to get failures, try increasing the base delay from 30 to 45. usleep() is a poor solution for reads because all it does is block the current thread, not actually delay the request's attempt to read the reply. I use usleep() for writes simply to prevent users from making too many requests at once. At some point I will implement a request queue which will do this automatically.
 
I been away for awhile and was waiting to see an update on this and from the first versions I tried it and failed. Now that 1.5 is here, My god it worked everything but Mute. I've been looking for something like this for awhile and now its here, i use my audio off my monitor via HDMI and i hated to manually go to the screen's menu and having both turn up and down the volume so as the brightness. Thank you SJ for this. Its one of a kind :) Now i don't have to worry about the hassles and yes it works with the keyboard controls as well for audio :D. Would be awesome to see it running in the background like some what of this app called boom so it could hang some where on the top like this http://d.pr/i/FFCH Would make it better so that it opens on start up and i can control it like if it was built in or something. Looking forward for future updates :)
 
I am using this in combination with f.Lux to have a low brightness + low color temp "Night Mode" on my screens so I can fall asleep faster when done with 'puter work. I think I could write a big AppleScript to auto-adjust the brightness slider at a set time at night & morning (f.lux does this for color temps already), but maybe a CLI mode could be useful as well.

EDIT:
And here's the invisible applescript that turns my two monitors to full blast brightness, you will need to play with the numbers for your particular monitors.
slider 5 is monitor #
slider 1 is brightness
slider 2 is contrast
The delays are needed to let the pokey I2C bus do its thing. Have to select the 2nd monitor twice to consistently get that one to adjust

Code:
[B]do shell script[/B] "open -jga \"DDC Panel\""
    [B]delay[/B] 1
    [B]tell[/B] [I]application[/I] "System Events"
        [B]tell[/B] [I]process[/I] "DDC Panel"
            [B]tell[/B] [I]window[/I] "DDC Panel"
                [B]set[/B] value [B]of[/B] [I]slider[/I] 5 [B]to[/B] 0
                [B]delay[/B] 0.2
                [B]set[/B] value [B]of[/B] [I]slider[/I] 1 [B]to[/B] 100
                [B]set[/B] value [B]of[/B] [I]slider[/I] 2 [B]to[/B] 75
                [B]delay[/B] 0.2
                [B]set[/B] value [B]of[/B] [I]slider[/I] 5 [B]to[/B] 1
                [B]delay[/B] 0.2
                [B]set[/B] value [B]of[/B] [I]slider[/I] 5 [B]to[/B] 1
                [B]delay[/B] 0.2
                [B]set[/B] value [B]of[/B] [I]slider[/I] 1 [B]to[/B] 85
                [B]set[/B] value [B]of[/B] [I]slider[/I] 2 [B]to[/B] 80
                [B]delay[/B] 0.2
            [B]end[/B] [B]tell[/B]
        [B]end[/B] [B]tell[/B]
    [B]end[/B] [B]tell[/B]
    [B]tell[/B] [I]application[/I] "DDC Panel" [B]to[/B] [B]quit[/B]

You can make that a Calendar Alarm with Automator, or use something like ControlPlane to adjust the brightness based on time or app usage (watching an iTunes movie). If your monitor is on powersave or your computer is asleep when the script is run, the changes won't take affect when its all woken up.

SJ_UnderWater, my eyes thank you!
 
I'm basically finished with `ddcd` except I need to figure out how to definitively map an audio device to a monitor. I was hoping to use the device names for both, but two identical models break that assumption. I don't have two monitors so I can't test on my machine.
 
I also tweaked this script to make an incremental increase (or decrease) and then tied it to a keyboard shortcut via bettertouchtool

Code:
[B]do shell script[/B] "open -jga \"DDC Panel\""[B]delay[/B] 0.1
[B]tell[/B] [I]application[/I] "System Events"
	[B]tell[/B] [I]process[/I] "DDC Panel"
		[B]tell[/B] [I]window[/I] "DDC Panel"
			[B]set[/B] value [B]of[/B] [I]slider[/I] 1 [B]to[/B] (value [B]of[/B] [I]slider[/I] 1) + 10
		[B]end[/B] [B]tell[/B]
	[B]end[/B] [B]tell[/B]
[B]end[/B] [B]tell[/B]
[B]tell[/B] [I]application[/I] "DDC Panel" [B]to[/B] [B]quit[/B]
 
Hello,

I was searching for a way to use the keyboard to adjust my Dell screen brightness on my mac mini. However the mac mini (with intel hd 4000 graphics) freezes just after launching the app. Even the mouse pointer is frozen.
Have you any idea to solve this problem?

Anyway, thank you for that work!
 
Status
Not open for further replies.
Back
Top