kfix / ddcctl

DDC monitor controls (brightness) for Mac OSX command line
GNU General Public License v3.0
1.86k stars 150 forks source link

Unable to control 30" Apple Cinema Display #108

Closed forthrin closed 3 years ago

forthrin commented 3 years ago

Happy to report that the program adjusts brightness, volume and mute for a Apple 27" LED Cinema Display:

$ ddcctl -d 1 -b 255
D: CGDisplay FAF159AF-1A5E-4482-1E79-47D34F7EC340 dispID(#69504025) (2560x1440 0°) 109.00 DPI
I: found 1 external display
I: polling EDID for #1 (ID 69504025 => IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@1)
I: got edid.serial: W82031866JL
I: got edid.name: LED Cinema
D: action: b: 255
D: setting VCP control #16 => 255
~$

However, no control work on a classic 30" Apple Cinema Display.

$ ddcctl -d 1 -b 100
D: CGDisplay 54D930DB-5C93-8B60-B108-C7389BAE7797 dispID(#69503705) (2560x1600 0°) 101.00 DPI
I: found 1 external display
I: polling EDID for #1 (ID 69503705 => IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@1)
I: got edid.name: Cinema HD 
I: got edid.name: Display
D: action: b: 100
D: setting VCP control #16 => 100
~

System information:

      Model Identifier: MacBookAir7,2
      Processor Name: Dual-Core Intel Core i5
      Processor Speed: 1,8 GHz
      Memory: 8 GB
      System Firmware Version: 427.0.0.0.0
      SMC Version (system): 2.27f2

Other information:

Making & running a debug build (make debug) and reproducing your issue to provide
detailed output for the report is highly encouraged!

Not sure what to make of this, as make debug only does a clean.

debug: clean
clean:
        $(RM) $(BUILD_DIR)/*.o $(PRODUCT_DIR)/ddcctl
kfix commented 3 years ago

I believe these Apple monitors present a USB HID device over their internal hub for the OS to control them using the native control panel. Its not DDC at all, which is what ddcctl is about.

https://www.usb.org/document-library/monitor-control-class-10

There are also linux-oriented utilities for controlling them but I have no idea if they can run on OS X

https://github.com/ondrej-zary/usbmonctl https://github.com/warvariuc/acdcontrol https://www.ddcutil.com/usb/

I have no intent of adding support for this myself, open to it if a patch seems reasonable and if there's no other working option on OS X for command line control.

forthrin commented 3 years ago

The two first seem to need things like hiddev_report_info and HIDIOCGUSAGE from Linux-specific(?) includes:

#include <linux/types.h>
#include <asm/types.h>

The last one requires libudev which also seems Linux-specific.

If anyone has a workaround or other tools that accomplish the task, post them here.