Bug 461822 - Triple-monitor setup with all monitors being the same model (with different serial numbers) gets scrambled on login
Summary: Triple-monitor setup with all monitors being the same model (with different s...
Status: RESOLVED NOT A BUG
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.27.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-14 15:06 UTC by Raman Gupta
Modified: 2023-05-17 20:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Display Configuration view (61.08 KB, image/png)
2022-11-16 18:16 UTC, Raman Gupta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raman Gupta 2022-11-14 15:06:00 UTC
SUMMARY

In a multimonitor setup, the "Primary display" setting does not persist across logins.

STEPS TO REPRODUCE
1. Connect two monitors to a computer, turn it on, and log into KDE.
2. In System Settings, select a different primary display and press "Apply".
3. Reboot and log into KDE.

OBSERVED RESULT
4. Panels appear on the wrong monitors.  Inspecting System Settings shows that this is because the primary display setting is back to the way it was originally.

EXPECTED RESULT
4. Primary display setting should have persisted.  Panels should have appeared on the correct monitors.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Platform: X11
On Fedora 36
Comment 1 Bug Janitor Service 2022-11-14 15:33:32 UTC
Thank you for the bug report!

Please note that Plasma 5.25.5 is not supported for much longer by KDE; supported versions are 5.24, and 5.26 or newer.

If at all possible please upgrade to a supported version and verify that the bug is still happening there.

If you're unsure how to do this, contact your distributor about it.
Comment 2 Nate Graham 2022-11-14 19:36:12 UTC
Can you paste the output of `kscreen-doctor -o` when it's working properly, and then again after rebooting when the Primary Display setting has gotten reset? Thanks a lot!
Comment 3 Raman Gupta 2022-11-16 16:31:00 UTC
(In reply to Nate Graham from comment #2)
> Can you paste the output of `kscreen-doctor -o` when it's working properly,

Output: 84 DisplayPort-0 enabled connected  DisplayPort Modes: 89:2560x1440@60*! 90:1920x1200@60 91:2048x1080@60 92:2048x1080@24 93:1920x1080@60 94:1920x1080@50 95:1920x1080@60 96:1600x1200@60 97:1680x1050@60 98:1280x1024@75 99:1280x1024@60 100:1440x900@60 101:1280x800@60 102:1152x864@75 103:1280x720@60 104:1280x720@50 105:1280x720@60 106:1024x768@75 107:1024x768@60 108:800x600@75 109:800x600@60 110:720x576@50 111:720x480@60 112:720x480@60 113:640x480@75 114:640x480@60 115:640x480@60 116:720x400@70 Geometry: 0,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 85 DisplayPort-1 enabled connected primary DisplayPort Modes: 89:2560x1440@60*! 93:1920x1080@60 94:1920x1080@50 95:1920x1080@60 96:1600x1200@60 98:1280x1024@75 99:1280x1024@60 100:1440x900@60 102:1152x864@75 103:1280x720@60 104:1280x720@50 105:1280x720@60 106:1024x768@75 107:1024x768@60 108:800x600@75 109:800x600@60 110:720x576@50 111:720x480@60 112:720x480@60 113:640x480@75 114:640x480@60 115:640x480@60 116:720x400@70 117:1920x1200@60 118:1920x1080@60 119:1920x1080@24 120:1920x1080@24 121:1680x1050@60 122:1280x800@60 Geometry: 2560,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown primary
Output: 86 DisplayPort-2 disabled disconnected  DisplayPort Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 87 HDMI-A-0 enabled connected  HDMI Modes: 89:2560x1440@60*! 90:1920x1200@60 91:2048x1080@60 92:2048x1080@24 93:1920x1080@60 94:1920x1080@50 95:1920x1080@60 96:1600x1200@60 97:1680x1050@60 98:1280x1024@75 99:1280x1024@60 100:1440x900@60 101:1280x800@60 102:1152x864@75 103:1280x720@60 104:1280x720@50 105:1280x720@60 106:1024x768@75 107:1024x768@60 108:800x600@75 109:800x600@60 110:720x576@50 111:720x480@60 112:720x480@60 113:640x480@75 114:640x480@60 115:640x480@60 116:720x400@70 Geometry: 5120,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown

(BTW, I have no idea what Output 86 is)

> and then again after rebooting when the Primary Display setting has gotten
> reset? Thanks a lot!

Output: 84 DisplayPort-0 enabled connected primary DisplayPort Modes: 89:2560x1440@60*! 90:1920x1200@60 91:2048x1080@60 92:2048x1080@24 93:1920x1080@60 94:1920x1080@50 95:1920x1080@60 96:1600x1200@60 97:1680x1050@60 98:1280x1024@75 99:1280x1024@60 100:1440x900@60 101:1280x800@60 102:1152x864@75 103:1280x720@60 104:1280x720@50 105:1280x720@60 106:1024x768@75 107:1024x768@60 108:800x600@75 109:800x600@60 110:720x576@50 111:720x480@60 112:720x480@60 113:640x480@75 114:640x480@60 115:640x480@60 116:720x400@70 Geometry: 0,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown primary
Output: 85 DisplayPort-1 enabled connected  DisplayPort Modes: 89:2560x1440@60*! 93:1920x1080@60 94:1920x1080@50 95:1920x1080@60 96:1600x1200@60 98:1280x1024@75 99:1280x1024@60 100:1440x900@60 102:1152x864@75 103:1280x720@60 104:1280x720@50 105:1280x720@60 106:1024x768@75 107:1024x768@60 108:800x600@75 109:800x600@60 110:720x576@50 111:720x480@60 112:720x480@60 113:640x480@75 114:640x480@60 115:640x480@60 116:720x400@70 117:1920x1200@60 118:1920x1080@60 119:1920x1080@24 120:1920x1080@24 121:1680x1050@60 122:1280x800@60 Geometry: 2560,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 86 DisplayPort-2 disabled disconnected  DisplayPort Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown 
Output: 87 HDMI-A-0 enabled connected  HDMI Modes: 89:2560x1440@60*! 90:1920x1200@60 91:2048x1080@60 92:2048x1080@24 93:1920x1080@60 94:1920x1080@50 95:1920x1080@60 96:1600x1200@60 97:1680x1050@60 98:1280x1024@75 99:1280x1024@60 100:1440x900@60 101:1280x800@60 102:1152x864@75 103:1280x720@60 104:1280x720@50 105:1280x720@60 106:1024x768@75 107:1024x768@60 108:800x600@75 109:800x600@60 110:720x576@50 111:720x480@60 112:720x480@60 113:640x480@75 114:640x480@60 115:640x480@60 116:720x400@70 Geometry: 5120,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown
Comment 4 Nate Graham 2022-11-16 18:03:33 UTC
Ok, so the problem is that the display connector ID that KScreen thinks each screen is connected to is reversing on login. On one boot, your intended primary monitor has the ID "DisplayPort-0" and on the next boot, it's got the ID "DisplayPort-0" Because this data is used to disambiguate screens that have otherwise identical information (e.g. identical serial numbers), KScreen is getting confused about which physical monitor is the primary one.

I'm assuming that you're not manually plugging your screens into different ports every time you restart the machine. :) 

Do you have an AMD graphics card, by any chance?

Also are both monitors the same model? Or are they different?
Comment 5 Raman Gupta 2022-11-16 18:11:40 UTC
(In reply to Nate Graham from comment #4)
> Ok, so the problem is that the display connector ID that KScreen thinks each
> screen is connected to is reversing on login. On one boot, your intended
> primary monitor has the ID "DisplayPort-0" and on the next boot, it's got
> the ID "DisplayPort-0" Because this data is used to disambiguate screens
> that have otherwise identical information (e.g. identical serial numbers),
> KScreen is getting confused about which physical monitor is the primary one.
> 
> I'm assuming that you're not manually plugging your screens into different
> ports every time you restart the machine. :) 

Correct :-)

> Do you have an AMD graphics card, by any chance?

Yes, AMD Radeon RX 6600 XT (ASUS).

> Also are both monitors the same model? Or are they different?

DisplayPort-0 and DisplayPort-1, which are the two monitors KScreen is confused about, are actually different models. DisplayPort-0 is a Dell U2717D and DisplayPort-1 is a Dell U2711.

HDMI-A-0 is also a U2717D but KScreen is not confusing the two U2717D monitors.

FYI also: `kscreen-doctor` doesn't show it, but the "Display Configuration" kcm "Identify" function shows the U2717Ds with unique serial numbers. The U2711 DOES NOT show a unique serial number, but I only have one of those monitors anyway.

Therefore, as far as I can tell, there is no reason KScreen should be confused about this setup.
Comment 6 Raman Gupta 2022-11-16 18:16:10 UTC
Created attachment 153812 [details]
Display Configuration view

Attached a view of the Display Configuration kcm, with the monitor models and serial numbers detected showing, and a visual representation of which monitor I am choosing as primary and which KDE keeps selecting as primary on reboot.
Comment 7 Nate Graham 2022-11-16 19:01:02 UTC
Thanks. There's probably a bug in the detection algorithm that's causing it to incorrectly take into account the connector name when it doesn't need to, which triggers the issue due to an AMD-specific kernel bug that results in the connector IDs changing on boot (which I can't find a link to right now, sorry).

I think we changed the detection algorithm in Plasma 5.26. Any chance you could test with 5.26 to see if it's still happening?
Comment 8 Nate Graham 2022-11-16 19:15:04 UTC
A colleague found the AMD kernel bug for me: https://bugzilla.kernel.org/show_bug.cgi?id=206387.
Comment 9 Raman Gupta 2022-11-16 19:53:52 UTC
(In reply to Nate Graham from comment #7)
> Thanks. There's probably a bug in the detection algorithm that's causing it
> to incorrectly take into account the connector name when it doesn't need to,
> which triggers the issue due to an AMD-specific kernel bug that results in
> the connector IDs changing on boot (which I can't find a link to right now,
> sorry).
> A colleague found the AMD kernel bug for me: https://bugzilla.kernel.org/show_bug.cgi?id=206387.

I don't think this kernel bug is affecting me -- my Xorg logs show that the output names are consistent from boot to boot:

[root@edison ~]# grep DisplayPort- /var/log/Xorg.0.log
[    27.175] (II) AMDGPU(0): Output DisplayPort-0 has no monitor section
[    27.177] (II) AMDGPU(0): Output DisplayPort-1 has no monitor section
[    27.177] (II) AMDGPU(0): Output DisplayPort-2 has no monitor section
[    27.218] (II) AMDGPU(0): EDID for output DisplayPort-0
[    27.218] (II) AMDGPU(0): Printing probed modes for output DisplayPort-0
[    27.220] (II) AMDGPU(0): EDID for output DisplayPort-1
[    27.221] (II) AMDGPU(0): Printing probed modes for output DisplayPort-1
[    27.221] (II) AMDGPU(0): EDID for output DisplayPort-2
[    27.222] (II) AMDGPU(0): Output DisplayPort-0 connected
[    27.222] (II) AMDGPU(0): Output DisplayPort-1 connected
[    27.222] (II) AMDGPU(0): Output DisplayPort-2 disconnected
[    27.222] (II) AMDGPU(0): Output DisplayPort-0 using initial mode 2560x1440 +0+0
[    27.222] (II) AMDGPU(0): Output DisplayPort-1 using initial mode 2560x1440 +2560+0

[root@edison ~]# grep DisplayPort- /var/log/Xorg.0.log.old 
[    26.438] (II) AMDGPU(0): Output DisplayPort-0 has no monitor section
[    26.440] (II) AMDGPU(0): Output DisplayPort-1 has no monitor section
[    26.440] (II) AMDGPU(0): Output DisplayPort-2 has no monitor section
[    26.487] (II) AMDGPU(0): EDID for output DisplayPort-0
[    26.487] (II) AMDGPU(0): Printing probed modes for output DisplayPort-0
[    26.489] (II) AMDGPU(0): EDID for output DisplayPort-1
[    26.490] (II) AMDGPU(0): Printing probed modes for output DisplayPort-1
[    26.490] (II) AMDGPU(0): EDID for output DisplayPort-2
[    26.491] (II) AMDGPU(0): Output DisplayPort-0 connected
[    26.491] (II) AMDGPU(0): Output DisplayPort-1 connected
[    26.491] (II) AMDGPU(0): Output DisplayPort-2 disconnected
[    26.491] (II) AMDGPU(0): Output DisplayPort-0 using initial mode 2560x1440 +0+0
[    26.491] (II) AMDGPU(0): Output DisplayPort-1 using initial mode 2560x1440 +2560+0

> I think we changed the detection algorithm in Plasma 5.26. Any chance you
> could test with 5.26 to see if it's still happening?

I'm planning to update to Fedora 37 shortly which I believe has 5.26. I'll report back here once I have tried it.
Comment 10 Raman Gupta 2022-11-17 00:50:42 UTC
I confirm this issue still exists on 5.26.2. Exactly the same behavior as before.

Operating System: Fedora Linux 37
KDE Plasma Version: 5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 6.0.8-300.fc37.x86_64 (64-bit)
Graphics Platform: X11

`kscreen-doctor -o` has same output as before.
Comment 11 Nate Graham 2022-11-18 17:09:48 UTC
Thanks. Out of curiosity, does it work better when you start in a Wayland session and reboot into another wayland session?
Comment 12 Raman Gupta 2022-11-23 12:41:18 UTC
(In reply to Nate Graham from comment #11)
> Thanks. Out of curiosity, does it work better when you start in a Wayland
> session and reboot into another wayland session?

Same problem in Wayland, except (somewhat amusingly), it keeps choosing the center monitor -- the one I want -- as the Primary display rather than the left monitor like in X11.
Comment 13 Raman Gupta 2023-02-20 18:36:58 UTC
So I had high hopes for Plasma 5.27 solving this, but it looks like this is *still* an issue in 5.27.

Some of my hardware is different from my prior reports, but the problem remains the same. I now have 3 different monitors -- my monitors are all the same model (Dell S2721QS), but Display Configuration shows a different serial # for all of them, so there is no particular reason why Plasma/KScreen shouldn't be able to differentiate them.

I choose the screen priorities (middle monitor as highest priority). The display shifts as expected. I then logout, restart sddm, log in again and -- the left monitor has become highest priority again.
Comment 14 Raman Gupta 2023-02-23 02:14:25 UTC
Here is the new `kscreen-doctor -o` output with my new hardware:

Output: 84 DisplayPort-0 enabled connected priority 2 DisplayPort Modes: 89:3840x2160@60*! 90:3840x2160@60 91:3840x2160@60 92:3840x2160@30 93:3840x2160@25 94:3840x2160@24 95:3840x2160@30 96:3840x2160@24 97:2560x1440@60 98:2048x1280@60 99:1920x1200@60 100:1920x1080@60 101:1920x1080@60 102:1920x1080@50 103:1920x1080@60 104:1920x1080@25 105:1920x1080@24 106:1920x1080@24 107:1600x1200@60 108:1680x1050@60 109:1600x900@60 110:1280x1024@75 111:1280x1024@60 112:1440x900@60 113:1280x800@60 114:1152x864@75 115:1280x720@60 116:1280x720@60 117:1024x768@75 118:1024x768@60 119:800x600@75 120:800x600@60 121:720x576@50 122:720x480@60 123:720x480@60 124:640x480@75 125:640x480@60 126:640x480@60 127:720x400@70 Geometry: 0,0 3840x2160 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown
Output: 85 DisplayPort-1 enabled connected priority 1 DisplayPort Modes: 89:3840x2160@60*! 90:3840x2160@60 91:3840x2160@60 92:3840x2160@30 93:3840x2160@25 94:3840x2160@24 95:3840x2160@30 96:3840x2160@24 97:2560x1440@60 98:2048x1280@60 99:1920x1200@60 100:1920x1080@60 101:1920x1080@60 102:1920x1080@50 103:1920x1080@60 104:1920x1080@25 105:1920x1080@24 106:1920x1080@24 107:1600x1200@60 108:1680x1050@60 109:1600x900@60 110:1280x1024@75 111:1280x1024@60 112:1440x900@60 113:1280x800@60 114:1152x864@75 115:1280x720@60 116:1280x720@60 117:1024x768@75 118:1024x768@60 119:800x600@75 120:800x600@60 121:720x576@50 122:720x480@60 123:720x480@60 124:640x480@75 125:640x480@60 126:640x480@60 127:720x400@70 Geometry: 3840,0 3840x2160 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown
Output: 86 DisplayPort-2 disabled disconnected priority 0 DisplayPort Modes: Geometry: 0,0 0x0 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown
Output: 87 HDMI-A-0 enabled connected priority 3 HDMI Modes: 90:3840x2160@60*! 91:3840x2160@60 92:3840x2160@30 93:3840x2160@25 94:3840x2160@24 95:3840x2160@30 96:3840x2160@24 97:2560x1440@60 100:1920x1080@60 101:1920x1080@60 102:1920x1080@50 103:1920x1080@60 104:1920x1080@25 105:1920x1080@24 106:1920x1080@24 107:1600x1200@60 109:1600x900@60 110:1280x1024@75 111:1280x1024@60 114:1152x864@75 115:1280x720@60 116:1280x720@60 117:1024x768@75 118:1024x768@60 119:800x600@75 120:800x600@60 121:720x576@50 122:720x480@60 123:720x480@60 124:640x480@75 125:640x480@60 126:640x480@60 127:720x400@70 128:1920x1200@60 129:1680x1050@60 130:1440x900@60 131:1280x800@60 Geometry: 7680,0 3840x2160 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown
Comment 15 Raman Gupta 2023-03-26 13:49:29 UTC
Still an issue on 5.27.3.
Comment 16 Raman Gupta 2023-04-26 05:27:41 UTC
Still an issue on 5.27.4.
Comment 17 Raman Gupta 2023-05-17 13:39:41 UTC
Another problem which I suspect is related... I've been trying to switch over to Wayland and have this issue on Wayland as well. Plus on Wayland I have another problem, which is that the per-monitor scaling gets reset to 100% on every login. The scaling setting is not persisted at all.

On X11, the global scaling is not affected -- it saves and restores correctly.
Comment 18 Raman Gupta 2023-05-17 20:08:33 UTC
Ok, so someone on Redditt found the root cause here by pointing me to https://bugs.kde.org/show_bug.cgi?id=463527 -- my kscreen2 background service was not running. I recalled I had disabled it some time ago because it was causing issues with my monitors suspending or unsuspending or something, and disabling it helped. Re-enabling the kscreen2 service fixes this problem, as well as https://bugs.kde.org/show_bug.cgi?id=469115.
Comment 19 Nate Graham 2023-05-17 20:09:42 UTC
Amazing. No wonder I was tearing out my hair and getting nowhere. I'll remember to ask for this in the future. Thanks for following up!