Skip to content

Per-monitor options for speeding up ddcutil runtime #580

@JamiKettunen

Description

@JamiKettunen

Current state:

ddcutil API calls in https://github.com/fastfetch-cli/fastfetch/blob/dev/src/detection/brightness/brightness_linux.c take a really long time stalling fastfetch -l none -s brightness --stat for ~850ms in my case with 2 monitors:

Brightness (HP 24x): 60%
Brightness (VG2401 Series): 60%                                                                   858ms

Wanted state:

I noticed ddcutil -d 1 getvcp 10 for example takes ~760ms, but as per https://www.ddcutil.com/faq/#ddcutil-is-slow I could get it down to a very respectable ~50ms for both of my monitors with e.g. ddcutil --bus 7 --sleep-multiplier 0.01 getvcp 10!

$ ddcutil detect
Display 1
   I2C bus:  /dev/i2c-7
   EDID synopsis:
      Model:                HP 24x
...
Display 2
   I2C bus:  /dev/i2c-8
   EDID synopsis:
      Model:                VG2401 Series
...
$ time ddcutil -d 1 getvcp 10
VCP code 0x10 (Brightness                    ): current value =    75, max value =   100

real	0m0.757s
user	0m0.005s
sys	0m0.240s
$ time ddcutil --bus 7 --sleep-multiplier 0.01 getvcp 10
VCP code 0x10 (Brightness                    ): current value =    75, max value =   100

real	0m0.048s
user	0m0.003s
sys	0m0.035s

Comparison with some other args:

$ time ddcutil -d 1 --sleep-multiplier 0.01 getvcp 10
VCP code 0x10 (Brightness                    ): current value =    75, max value =   100

real	0m0.256s
user	0m0.004s
sys	0m0.241s
$ time ddcutil --bus 7 getvcp 10
VCP code 0x10 (Brightness                    ): current value =    75, max value =   100

real	0m0.351s
user	0m0.003s
sys	0m0.037s

Basically I would like an option similar to --brightness-ddcutil-monitors='HP 24x:7:0.01:VG2401 Series:8:0.01' where my example format is monitor:i2c_bus:sleep_multiplier allowing for similar ddcutil call I described above to be done from fastfetch when it calls the API.

Why the change is sensible:

It could make fastfetch even faster when showing display brightnesses via DDC/CI with a bit of configuration :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions