| Summary: | Refresh rate values in Display Configuration menu are always incorrect due to floating-point precision issues | ||
|---|---|---|---|
| Product: | [Applications] systemsettings | Reporter: | valdikss |
| Component: | kcm_kscreen | Assignee: | kscreen-bugs-null <kscreen-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | adolfotregosa, boot.efi, ilikefoss, nate, plasma-bugs-null |
| Priority: | NOR | ||
| Version First Reported In: | 5.22.4 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| See Also: | https://bugs.kde.org/show_bug.cgi?id=424997 | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Video
kscreen-console json |
||
|
Description
valdikss
2021-01-02 11:51:18 UTC
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. On my Dell Inspiron 5770, with its built-in 2K display the refesh rate is shown as: 60.01 Hz.
kscreen-doctor -o shows:
Output: 1 eDP-1 1c060aa7-39a3-419d-95c2-12addc2a9006
enabled
connected
priority 1
Panel
replication source:0
Modes: 1:1920x1080@60.01*! 2:1920x1080@48.01 3:1280x1024@59.90 4:1280x1024@59.90 5:1024x768@59.92 6:1024x768@59.92 7:1280x800@59.81 8:1280x800@59.81 9:1600x900@59.95 10:1600x900@59.95 11:1368x768@59.88 12:1368x768@59.88 13:1280x720@59.85 14:1280x720@59.85
Geometry: 0,0 1600x900
Scale: 1.2
Rotation: 1
Overscan: 0
Vrr: incapable
RgbRange: Full
HDR: incapable
Wide Color Gamut: incapable
ICC profile: none
Color profile source: sRGB
Color power preference: prefer efficiency and performance
Brightness control: supported, set to 97% and dimming to 100%
Color resolution: automatic (10), range: [6; 12] bits per color
Allow EDR: always
Sharpness control: unsupported
Info Center's EDID page shows:
# card0-eDP-1 #######################
Block 0, Base EDID:
EDID Structure Version & Revision: 1.4
Vendor & Product Identification:
Manufacturer: CMN
Model: 5944
Made in: week 43 of 2015
Basic Display Parameters & Features:
Digital display
Bits per primary color channel: 6
DisplayPort interface
Maximum image size: 38 cm x 21 cm
Gamma: 2.20
Supported color formats: RGB 4:4:4
First detailed timing includes the native pixel format and preferred refresh rate
Color Characteristics:
Red : 0.6464, 0.3378
Green: 0.3164, 0.6142
Blue : 0.1572, 0.0439
White: 0.3134, 0.3291
Established Timings I & II: none
Standard Timings: none
Detailed Timing Descriptors:
DTD 1: 1920x1080 60.007852 Hz 16:9 67.929 kHz 152.840000 MHz (381 mm x 214 mm)
Hfront 48 Hsync 32 Hback 250 Hpol P
Vfront 3 Vsync 5 Vback 44 Vpol N
DTD 2: 1920x1080 48.005497 Hz 16:9 54.342 kHz 122.270000 MHz (381 mm x 214 mm)
Hfront 48 Hsync 32 Hback 250 Hpol P
Vfront 3 Vsync 5 Vback 44 Vpol N
Alphanumeric Data String: 'N1YPX�173HCE'
Checksum: 0x08
----------------
EDID conformity: PASS
So in my case the rounding to only 2 decimal places is not that good, I mean nice to see.
I would rather see just 60 Hz or the full 60.007852 Hz
Or just 60 Hz, but with a way to also see the more precise version, other than looking at the EDID.
Anyway, I wanted mainly just to report what I'm seeing on my laptop (the GPU is an Intel UHD 620, if that helps).
I'm using Debian 14 (Forky, AKA the 'testing' repository), Linux 6.17, Mesa 25.3, Plasma 6.5.4, Frameworks 6.20.
|