davidhi7 / ddcci-plasmoid

KDE Plasma widget to adjust the brightness of multiple external monitors
MIT License
390 stars 11 forks source link

Option to disable search for duplicate monitors (Bug - only one display is shown if they have the same model/serial number) #44

Open peterhoeg opened 9 months ago

peterhoeg commented 9 months ago

I have 2 relatively cheap 4k panels of the same model, but I am only shown 1 monitor for which to adjust brightness.

ddcci

I'm guessing (without having looked at the code) this has to do with the fact that they have the same serial number.

Display 1
   I2C bus:  /dev/i2c-6
   DRM connector:           card0-DP-1
   EDID synopsis:
      Mfg id:               HKC - UNK
      Model:                N07
      Product code:         10019  (0x2723)
      Serial number:        0000000000001
      Binary serial number: 0 (0x00000000)
      Manufacture year:     2023,  Week: 4
   VCP version:         2.1

Display 2
   I2C bus:  /dev/i2c-7
   DRM connector:           card0-DP-2
   EDID synopsis:
      Mfg id:               HKC - UNK
      Model:                N07
      Product code:         10019  (0x2723)
      Serial number:        0000000000001
      Binary serial number: 0 (0x00000000)
      Manufacture year:     2023,  Week: 4
   VCP version:         2.1

Just to add - this machine used to have 2 identical Dell monitors, but with those I could adjust the brightness of each monitor individually as expected.

davidhi7 commented 9 months ago

Yes, monitors with identical serial numbers are sorted out as a workaround for an amdgpu driver bug, because they usually represent the identical monitor hardware. I think the only solution to this is to add a setting that disables the search for duplicate 'identical' monitors altogether.

ChristianAnke commented 9 months ago

+1

peterhoeg commented 9 months ago

You cannot use the bus address or the connector for identification together with the serial?

davidhi7 commented 9 months ago

The bus address is in fact different, I'm not sure if the connector values are different as well. If not, comparing them is a better option, thanks for pointing this out.

davidhi7 commented 9 months ago

The connector is also different, so (at least on my setup) the only way to detect duplicate monitors is by comparing the serial numbers.

peterhoeg commented 9 months ago

The connector is also different, so (at least on my setup) the only way to detect duplicate monitors is by comparing the serial numbers.

Are you saying that in some cases a single monitor will show more than once while connected to multiple outputs?

davidhi7 commented 9 months ago

Not quite, in my setup one monitor occurs twice in ddcutil output with different busses and connectors reported by ddcutil, while the monitor is physically connected to my GPU with one DP cable. Consequently, before I implemented this check for duplicate serial numbers, I had two fully functional brightness sliders controlling the same monitor.

SamuelAleks commented 4 months ago

Added bus identification in my fork. Not currently implemented into the project, but you should be able to test if it works for you.

davidhi7 commented 4 months ago

Comparing the i2c busses doesn't solve this issue. On my setup, the ddcutil detect output features identical serial numbers and different i2c busses as well, but the two entries do represent the identical monitor.

SamuelAleks commented 4 months ago

Sorry, I know very little about monitor hardware and interfaces. I just added EDID bus identifiers in the process of my tinkering, and I just know the program detected my 3 identical monitors instead of just one.

Apologies if this isn't an optimal solution for production.

davidhi7 commented 4 months ago

Glad it works for you. But I think there is just no reliable way to differentiate the problem of different monitors sharing the same 'serial number' and the identical monitor appearing twice in ddcutil output because of GPU driver issues.

peterhoeg commented 4 months ago

The way I worked around this:

  1. dump the EDID date from one monitor
  2. edit the EDID file to make the following changes:
    1. change the serial from 1 to 2
    2. change the checksum to match
  3. pass the modified EDID to the linux kernel on boot

And they would then appear properly as 2 different monitors due to the serials being different.

It was however short lived as it turns out one of the cheap non-brand monitors gave up on life, so I returned them both for a full refund and then simply bought LG instead. That's what I get for trying to be cheap...

EDIT: I can write up some documentation as a PR if you are interested @davidhi7

davidhi7 commented 4 months ago

Sounds interesting, would happily include this in the README if this is a reliable and somewhat simple solution.