Display Configuration menu in System Settings shows either none or incorrect refresh rates for some display resolutions. I have two display configurations and it's not possible to switch both resolution and refresh rate to correct values in one go. Display Configuration would change the resolution but refresh rate is incorrectly displayed in the drop-down menu. I have to switch resolution first, then leave and open Display Configuration again, only after this it shows correct refresh rates (but also only for current resolution). I have custom modelines for this monitor, but the bug also present without any customizations. DP-2 connected primary 1920x1080+1366+0 (normal left inverted right x axis y axis) 527mm x 296mm 3840x2160_40.00_rb1 39.98 3840x2160_30.00_rb1 29.98 3840x2160 29.98 3200x1800_57.00_rb1 56.98 3200x1800_50.00_rb1 49.98 3072x1728_60.00_rb1 59.99 2560x1440 59.95 1920x1200 59.88 1920x1080 60.00* 60.00 50.00 59.94 24.00 23.98 1920x1080i 60.00 50.00 59.94 … STEPS TO REPRODUCE For example, I want to switch from 1920×1080@60Hz to 3840×2160@39.98Hz (custom profile). 1. Open Display Configuration, select the display, choose 3840×2160 resolution 2. Refresh rate in the drop-down menu is automatically set to 50 Hz. 3. Open Refresh rate drop-down menu, see 60/50/30/25/24 Hz options (only 30 Hz could be seen in xrandr for this resolution) 4. Choose any refresh rate (or leave 50 Hz), press apply button. The resolution is changed, the refresh rate is random. 5. Leave Display Configuration, enter it again, select the display 6. Refresh rate drop-down menu now has 40/30 Hz, as it should be. OBSERVED RESULT Refresh rate drop-down menu shows incorrect rates for all resolutions except current. EXPECTED RESULT Refresh rate drop-down menu should show correct set of rates for all resolutions, as it shown in xrandr. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora 33 KDE Plasma Version: 5.20.4 KDE Frameworks Version: 5.75.0 Qt Version: 5.15.2
Created attachment 134462 [details] Video Please watch the video. The video shows: 1. The display at 1920×1080@60, which I try to switch to 3840×2160@39.98 2. Display Configuration shows 60/50/30/25/24 Hz options for 3840×2160, switches to 30 Hz when 50 Hz is selected 3. After leaving configuration and entering it again, it shows correct 30/40 Hz for 3840×2160 4. Trying to switch from 3840×2160@30 to 1920×1080@60. Display Configuration shows 40/30 Hz for 1920×1080, switches to 30 Hz interlaced when none refresh rate is selected. 5. After leaving configuration and entering it again, it shows correct 60/50/30/25/24 Hz options for 1920×1080
Created attachment 134464 [details] kscreen-console json The output of kscreen-console json
It seems that Display Configuration applet is built on incorrect assumption that all resolution will have common refresh rates. It does not update refresh rates on resolution change, refreshRates() function accepts only output (screen) as a single argument.
Unfortunately the issue is still present in the newest KDE 5.22.4.
Thank you for the bug report. Unfortunately we were not able to get to it yet. Can we ask you to please see if you can reproduce the issue with Plasma 5.25 or 5.26? If you can, please change the status to CONFIRMED when replying. Thanks a lot!
(In reply to Nate Graham from comment #5) > Thank you for the bug report. Unfortunately we were not able to get to it > yet. Can we ask you to please see if you can reproduce the issue with Plasma > 5.25 or 5.26? > > If you can, please change the status to CONFIRMED when replying. Thanks a > lot! This is still an issue as of KDE 5.25.4 on Fedora 35.
Based on the attachment, it appears that the issue is that the refresh rates are stored as floats, like: > "refreshRate": 120.10496520996094, > "refreshRate": 120.00162506103516, That's not gonna work. We are losing precision so anything that tries to compare one to another will get a result of false.
I'm in favor of changing config format. Let's store framerate as a string which is a fixed point number with two decimal digits. Exactly two should be enough to distinguish any valid modes, e.g. - 640x480 @ 59.94 vs 59.93; - 1920x1080 @ 59.94 vs 60.00; note: this isn't a problem for [1280x720 @ 50.00] vs [720x576 @ 50.00], because in this case resolution is different. If there are legit two modes with same resolution but with refresh rate only diverting at or after third decimal digit, then I'd assume it doesn't matter which to pick up. > Based on the attachment, it appears that the issue is that the refresh rates are stored as floats, like: >> "refreshRate": 120.10496520996094, >> "refreshRate": 120.00162506103516, > That's not gonna work. We are losing precision so anything that tries to compare one to another will get a result of false. As a workaround, I could implement a fuzzy lookup, such that a mode with the closest value to the one loaded from config will be picked up, iff absolute delta is less than 1Hz.
+1 for storing as fixed point with two decimal places at the very minimum.
*** Bug 502764 has been marked as a duplicate of this bug. ***
(In reply to Nate Graham from comment #9) > +1 for storing as fixed point with two decimal places at the very minimum. It's basically what everyone else does. Round to two decimal places.