Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DDC to control external display brightness #41

Open
cassidyjames opened this issue May 16, 2017 · 7 comments
Open

Use DDC to control external display brightness #41

cassidyjames opened this issue May 16, 2017 · 7 comments

Comments

@cassidyjames
Copy link
Contributor

cassidyjames commented May 16, 2017

See: https://wiki.archlinux.org/index.php/backlight#External_Monitors

Would require testing, but it'd be awesome to be able to control supported external displays with the brightness slider.

Would need design to handle multiple displays.

@andirsun
Copy link
Contributor

andirsun commented Aug 5, 2021

I want to work on this.
Actually in my external monitor Samsung im able to change the brightness with ddcutil

sudo ddcutil getvcp 10
VCP code 0x10 (Brightness                    ): current value =   100, max value =   100

We can handle more parameters from display like colors calibration.

Display 1
   I2C bus:             /dev/i2c-3
      I2C address 0x50 (EDID) present: true 
      Is eDP device:                   false
      /sys/bus/i2c/devices/i2c-3/name: i915 gmbus dpb
   EDID synopsis:
      Mfg id:           SAM
      Model:            S22F350
      Serial number:    H4ZM401625
      Manufacture year: 2019
      EDID version:     1.3
      Product code:     3354
      Extra descriptor: 
      Video input definition: 0x80 - Digital Input
      Supported features:
         DPMS active-off
         Digital display type: RGB 4:4:4
         Standard sRGB color space: False
      White x,y:        0.313, 0.329
      Red   x,y:        0.646, 0.337
      Green x,y:        0.328, 0.615
      Blue  x,y:        0.146, 0.056
      Extension blocks: 1
   EDID source: 
   EDID hex dump:
              +0          +4          +8          +c            0   4   8   c   
      +0000   00 ff ff ff ff ff ff 00 4c 2d 1a 0d 46 4d 5a 5a   ........L-..FMZZ
      +0010   12 1d 01 03 80 30 1b 78 2a 52 95 a5 56 54 9d 25   .....0.x*R..VT.%
      +0020   0e 50 54 bf ef 80 71 4f 81 c0 81 00 81 80 95 00   .PT...qO........
      +0030   a9 c0 b3 00 01 01 02 3a 80 18 71 38 2d 40 58 2c   .......:..q8-@X,
      +0040   45 00 dd 0c 11 00 00 1e 00 00 00 fd 00 32 4b 1e   E............2K.
      +0050   51 11 00 0a 20 20 20 20 20 20 00 00 00 fc 00 53   Q...      .....S
      +0060   32 32 46 33 35 30 0a 20 20 20 20 20 00 00 00 ff   22F350.     ....
      +0070   00 48 34 5a 4d 34 30 31 36 32 35 0a 20 20 01 08   .H4ZM401625.  ..
   VCP version:         2.0
   Controller mfg:      Mstar
   Firmware version:    0.1
   Monitor returns DDC Null Response for unsupported features: false

@cassidyjames
Copy link
Contributor Author

@andirsun that would be awesome! Let's stick to brightness for now as this could quickly balloon the scope. I think the main thing we'll need to handle is multiple displays and how to distinguish them; if there's one display, it could look like the experience with a laptop today. If there are multiple displays, we should label them with as unique information as we can, like we do in the Displays plug and possibly denoting (Primary) or ⭐ on the primary display to help further distinguish them.

@andirsun
Copy link
Contributor

@cassidyjames whats the best approach to handle this ?.
I'm thinking on execute ddcutil terminal commands to modify brightness.

@cassidyjames
Copy link
Contributor Author

@andirsun generally that's not the best approach as it relies on the external command arguments never changing, and afaik that's not a stable API or anything. It looks like the ddcutil GitHub repo includes a library that's built along with the executable, and there's a Qt UI that's built with it so it should be possible to use the library directly. We may need to package it in our repo though, as I don't see it in the Ubuntu repos.

@andirsun
Copy link
Contributor

I going to check the library and do some tests.

@aral
Copy link

aral commented Nov 22, 2021

Any word on where you’re at with this? It’s something I’m interested in seeing also. (Not a major thing but would be nice not to have to mess with three levels of brightness controls every night.) And on that front, it might be an idea to include this as part of the night light feature to allow screens to be dimmed when the night light kicks in.

@Maccer1
Copy link

Maccer1 commented May 24, 2022

To control external display brightness you can use the command/tool sudo ddcutil setvcp 10 XX where XX is the value. Usually between 0-100.

The vcp code is always 10 because this is part of the DDC/CI standard.

You might need a fix for nvidia gpus

You can install i2c-tools and add your user to the group i2c to change brightness without root

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants