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

[Bug]: Unable to get brightness value: DDC/CI error: invalid DDC/CI length #114

Open
goekce opened this issue Sep 6, 2024 · 4 comments
Open

Comments

@goekce
Copy link

goekce commented Sep 6, 2024

Steps for reproducing the issue

  1. Connect three daisy-chained monitors via USB Video
  2. Activate ddcutil in wluma with name HP and capturer Wlroots
  3. start wluma
  4. Logs show: ERROR wluma::brightness::controller] Unable to get brightness value: DDC/CI error: invalid DDC/CI length

Setting the brightness via ddcutil works.

What is the buggy behavior?

Wluma cannot get the brightness value

What is the expected behavior?

Wluma should be able to get the brightness value

Logs

RUST_LOG=debug wluma


2024-09-06T19:45:58Z DEBUG wluma] Using Config {
        als: Iio {
            path: "/sys/bus/iio/devices",
            thresholds: {
                800: "outdoors",
                250: "normal",
                500: "bright",
                20: "dark",
                80: "dim",
                0: "night",
            },
        },
        output: [
            Backlight(
                BacklightOutput {
                    name: "eDP-1",
                    path: "/sys/class/backlight/intel_backlight",
                    capturer: Wlroots,
                    min_brightness: 1,
                },
            ),
            DdcUtil(
                DdcUtilOutput {
                    name: "HP",
                    capturer: Wlroots,
                    min_brightness: 1,
                },
            ),
        ],
    }
[2024-09-06T19:46:24Z DEBUG wluma::brightness::ddcutil] Discovered displays (check_caps=true): ["HP Z24u G3 ...", "HP Z24u G3 ...", "HP Z24u G3 ...", "HP Z24n G2 ..."]
[2024-09-06T19:46:24Z DEBUG wluma::brightness::ddcutil] Using display 'HP Z24u G3 CN43520628' for config 'HP' (check_caps=true)
[2024-09-06T19:46:24Z INFO  wluma] Continue adjusting brightness and wluma will learn your preference over time.
[2024-09-06T19:46:24Z DEBUG wluma::frame::capturer::wlroots] Using output 'HP Inc. HP Z24u G3 ... (DP-5)' for config 'HP'
[2024-09-06T19:46:24Z DEBUG wluma::frame::capturer::wlroots] Using output 'HP Inc. HP Z24u G3 ... (DP-7)' for config 'HP'
[2024-09-06T19:46:24Z DEBUG wluma::frame::capturer::wlroots] Using output 'HP Inc. HP Z24n G2 ... (DP-8)' for config 'HP'
[2024-09-06T19:46:25Z ERROR wluma::brightness::controller] Unable to get brightness value: DDC/CI error: invalid DDC/CI length


### Version

Using Archlinux package with version 4.4.0

### Environment

```shell
Linux m 6.10.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 04 Sep 2024 15:16:37 +0000 x86_64 GNU/Linux
853 sway
914 swayidle
egrep: warning: egrep is obsolescent; using grep -E
sway 1:1.9-5
sway-contrib 1.9.0-2
swayidle 1.8.0-2
swaylock 1.8.0-1
vulkan-headers 1:1.3.285-1
vulkan-icd-loader 1.3.285-1
vulkan-intel 1:24.2.1-1
wlroots0.17 0.17.4-3
zsh: command not found: dpkg
egrep: warning: egrep is obsolescent; using grep -E
@goekce
Copy link
Author

goekce commented Sep 6, 2024

I believe the problem is related to the phantom display (with serial xxx below) which has the same name as the real display. The phantom display probably does not deliver a brightness value.

["HP Z24u G3 xxx", "HP Z24u G3 xxx", "HP Z24u G3 yyy", "HP Z24n G2 zzz"]
$ ddcutil detect
Invalid display
   I2C bus:  /dev/i2c-11
   DRM connector:           card1-eDP-1
   EDID synopsis:
      Mfg id:               CMN - Chimei Innolux Corporation
      Model:                
      Product code:         5173  (0x1435)
      Serial number:        
      Binary serial number: 0 (0x00000000)
      Manufacture year:     2021,  Week: 13
   This is a laptop display.  Laptop displays do not support DDC/CI

Phantom display
   Associated non-phantom display: bus /dev/i2c-16
   I2C bus:  /dev/i2c-12
   DRM connector:           card1-DP-1
   EDID synopsis:
      Mfg id:               HPN - UNK
      Model:                HP Z24u G3
      Product code:         14026  (0x36ca)
      Serial number:        xxx
      Binary serial number: 0 (0x00000000)
      Manufacture year:     2023,  Week: 52
   DDC communication failed
   Use non-phantom device bus /dev/i2c-16

Display 1
   I2C bus:  /dev/i2c-16
   DRM connector:           card1-DP-5
   EDID synopsis:
      Mfg id:               HPN - UNK
      Model:                HP Z24u G3
      Product code:         14026  (0x36ca)
      Serial number:        xxx
      Binary serial number: 0 (0x00000000)
      Manufacture year:     2023,  Week: 52
   VCP version:         Detection failed

Display 2
   I2C bus:  /dev/i2c-17
   DRM connector:           card1-DP-7
   EDID synopsis:
      Mfg id:               HPN - UNK
      Model:                HP Z24u G3
      Product code:         14027  (0x36cb)
      Serial number:        yyy
      Binary serial number: 0 (0x00000000)
      Manufacture year:     2023,  Week: 52
   VCP version:         2.2

Display 3
   I2C bus:  /dev/i2c-18
   DRM connector:           card1-DP-8
   EDID synopsis:
      Mfg id:               HPN - UNK
      Model:                HP Z24n G2
      Product code:         13445  (0x3485)
      Serial number:        zzz
      Binary serial number: ...
      Manufacture year:     2019,  Week: 12
   VCP version:         2.2

@maximbaz
Copy link
Owner

maximbaz commented Sep 6, 2024

Hello! I believe you can match on the serial number of your display in wluma config, in case the serial number doesn't change across reboots. Otherwise it's a bit tough to find a solution to skip phantom displays without necessary hardware, what worked so far was to filter displays only for those that can successfully respond to "update capabilities" request, but clearly in your case the phantom display is able to respond to that 🤔 If you'd like to tinker with the code and see if you can identify another condition that can distinguish a phantom from a real display in your setup, the necessary parts are here, and any findings would be very appreciated:

.filter_map(|mut display| {
let caps = if check_caps {
display.update_capabilities()

@goekce
Copy link
Author

goekce commented Sep 6, 2024 via email

@maximbaz
Copy link
Owner

maximbaz commented Sep 9, 2024

Sure thing! Your output of ddcutil detect has an interesting extra line for the phantom display: "DDC communication failed". Hopefully we'll be able to find a command that can tell us this, and use this as a filter.

Let's keep it open for some time and see if anyone is able to help. I do think it's a bit hard to investigate this without having the hardware to test against, but maybe there will be someone else having the exact same problem.

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

No branches or pull requests

2 participants