Adjust backlight via DDC

backlightbrightnessdisplayhdmiscripting

I'm looking for a simple way of adjusting an external monitor's backlight
using DDC. Something like good-ddc-tool --monitor 0 --backlight 100 that just works without complicating things when a single monitor is connected (the common case).

I've tried the answers to this question without success:

First answer (ddccontrol)

$ sudo ddccontrol -p

[...]

Probing for available monitors........
Detected monitors :
No monitor supporting DDC/CI available.
If your graphics card need it, please check all the required kernel modules are loaded (i2c-dev, and your framebuffer driver).

$ sudo modprobe i2c-dev
$ sudo lsmod | grep i2c
i2c_nforce2            20480  0

…fail?

Second answer (ddcutil)

Quick test:

$ sudo ddcutil capabilities
Display not found

…fail.

Guess:

$ sudo ddcutil detect
Invalid display
   I2C bus:             /dev/i2c-4
   EDID synopsis:
      Mfg id:           DEL
      Model:            DELL 2209WA
      Serial number:    [redacted]
      Manufacture year: 2009
      EDID version:     1.3
   DDC communication failed

Invalid display? Well it's the right manufacturer, model and manufacture year — not sure how it managed to display this information if "DDC communication failed".

I know the display and cable are fully capable of adjusting backlight on other OSes on other systems, and it feels far-fetched to think a Geforce GTX 550 lacks basic DDC support. Obviously it doesn't since it successfully read the display model.

Third answer (xrandr)

Quick (guess) tests:

$ xrandr --output HDMI2 --brightness 0.6
warning: output HDMI2 not found; ignoring
xrandr: Need crtc to set gamma on.

$ xrandr --output HDMI1 --brightness 0.6
warning: output HDMI1 not found; ignoring
xrandr: Need crtc to set gamma on.

…fail. Same for HDMI0 and just HDMI.

Guess:

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x279 cap: 0x1, Source Output crtcs: 2 outputs: 4 associated providers: 0 name:NVIDIA-0

I don't really know what this tells me, and I couldn't find a way to list "outputs" which just leaves me guessing.


Update

I found special instructions for ddcutil for nvidia cards, but I couldn't find the file that was mentioned in the first of the two suggestions:

A file for making this change is 90-nvidia_i2c.conf located in distribution directory data/etc/X11/xorg.conf.d

I'm using Xubuntu. Where is it suggesting I look?

The results of the second suggestion in the link can be found in an answer below.


Update 2

I tried ddcutil on a MacBook/Intel HD Graphics/Ubuntu with the same monitor and it works without a problem.

This suggests to me that the GeForce GTX 550 or its driver is most likely the problem.

Best Answer

I am the developer of ddcutil.

It looks like you have a monitor with a marginal I2C implementation. The Nvidia options are forcing the driver to use the lowest bus speed defined in the I2C spec, 100 kbps. Unfortunately, there's no way to tell the driver to use an even lower bus speed.

Use the --ddc option to see DDC data errors, and the --stats option for cumulative error counts and the number of times ddcutil had to retry operations.

There are a couple ddcutil options that may help. If you see lots of failures in the --stats output showing maximum retries exceeded, you can try increasing the number of retries using the --maxtries option. Second, the DDC/CI protocol mandates that the application wait a certain amount of time (commonly 50 ms) between the time it sends a request to the monitor and the time it reads the reply. This is to allow the monitor time to perform the operation and/or assemble a reply. The --sleep-multiplier option increases the time that ddcutil waits. For example, --sleep-multiplier 2 makes ddcutil wait 100 ms when the spec mandates a 50 ms wait. (Conversely, I've seen some well behaved video card/monitor implementations that work with a sleep-multiplier value as low as .1, i.e., waiting only 5 ms when the spec requires 50.)

Finally, I apologize for the difficulty of finding file 90-nvidia_i2c.conf. The documentation for the file on the web site had not been updated for the current location.

Related Question