Strange issues with laptop and external display on KDE

I’m having a very peculiar issue with an external display plugged to my laptop. I’m running Manjaro with Plasma. Here are “steps to reproduce”.

  1. Start the laptop and log into my account with the display unplugged.
  2. Connect the display.
  3. The display is detected. It is used to extend my desktop to the right of my laptop’s screen.
  4. I open “Configure Display Settings…” to rearrange my displays and make the external one primary.
  5. Now I unplug the external display and plug it again.

What happens next looks like the system and the display can’t get to grips with each other. My external display just repeatedly flashes the message that it detects an input, but can’t display anything. My laptop’s display shows my desktop that flickers between two layouts: with the external display or without it. If I manage to get a glimpse of “Display Configuration” window it shows a message at the top: “An output has been removed, settings reloaded”. So it looks like something rapidly retries to connect to the display.

When that happens I found two ways to get out of that situation. One is to reboot with the display connected. After reboot and logging in it works as before, with my chosen arrangement. Another is to disconnect the display again, clear display settings by running rm -rf ~/.local/share/kscreen and connecting again. This resets the settings so I have to rearrange the displays again.

Now some observations:

  • The event that triggers this situation could be anything that forces Plasma to reorient itself in the available displays. Could be unplugging and plugging again like I said above and that is the most reproducible. Sometimes it could also be closing the laptop’s lid, or waking from sleep.
  • If I switch out of xorg session with Ctrl+Alt+F2 then everything is replicated on both displays as you’d expect.
  • The first screen of SDDM, the “choose account” screen after boot up, is not affected. If the external display is connected during boot up, it will use both displays. If I plug it after boot up while I’m already on this first screen, it will not use it.
  • The second screen of SDDM, the lock screen, is just affected as normal desktop.
  • I have a dual boot with Windows 11 on this laptop. There are no such problems with the same display on Windows.
  • There is no such problem when using the same laptop with a different monitor.

I’m completely in the dark as to where to even start looking so I welcome any suggestions.

The laptop is ASUS TUF Gaming and the display is Samsung C27JG5X.

neofetch:

██████████████████  ████████   su@laptop 
██████████████████  ████████   --------- 
██████████████████  ████████   OS: Manjaro Linux x86_64 
██████████████████  ████████   Host: ASUS TUF Gaming F17 FX706HCB_FX706HCB 1.0 
████████            ████████   Kernel: 5.15.89-1-MANJARO 
████████  ████████  ████████   Uptime: 55 mins 
████████  ████████  ████████   Packages: 1495 (pacman), 6 (flatpak) 
████████  ████████  ████████   Shell: bash 5.1.16 
████████  ████████  ████████   Resolution: 1920x1080, 2560x1440 
████████  ████████  ████████   DE: Plasma 5.26.5 
████████  ████████  ████████   WM: KWin 
████████  ████████  ████████   Theme: Breath Light [Plasma], Breeze [GTK2/3] 
████████  ████████  ████████   Icons: [Plasma], breeze [GTK2/3] 
████████  ████████  ████████   Terminal: konsole 
                               CPU: 11th Gen Intel i5-11400H (12) @ 4.500GHz 
                               GPU: NVIDIA GeForce RTX 3050 Mobile 
                               GPU: Intel TigerLake-H GT1 [UHD Graphics] 
                               Memory: 3640MiB / 31842MiB 

xrandr output, with display connected and working:

Screen 0: minimum 320 x 200, current 4480 x 1440, maximum 16384 x 16384
eDP-1 connected 1920x1080+0+360 (normal left inverted right x axis y axis) 382mm x 215mm
   1920x1080    144.03*+  60.01    59.97    59.96    60.01    59.93  
   1680x1050     59.95    59.88  
   1400x1050     74.76    59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     85.02    75.02    60.02  
   1400x900      59.96    59.88  
   1280x960      85.00    60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1280x800      59.99    59.97    59.81    59.91  
   1152x864      75.00  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      85.00    75.05    60.04    85.00    75.03    70.07    60.00  
   1024x768i     86.96  
   960x720       85.00    75.00    60.00  
   928x696       75.00    60.05  
   896x672       75.05    60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   832x624       74.55  
   960x540       59.96    59.99    59.63    59.82  
   800x600       85.00    75.00    70.00    65.00    60.00    85.14    72.19    75.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       74.76    59.98  
   800x450       59.95    59.82  
   640x512       85.02    75.02    60.02  
   700x450       59.96    59.88  
   640x480       85.09    60.00    85.01    72.81    75.00    59.94  
   720x405       59.51    58.99  
   720x400       85.04  
   684x384       59.88    59.85  
   640x400       59.88    59.98    85.08  
   576x432       75.00  
   640x360       59.86    59.83    59.84    59.32  
   640x350       85.08  
   512x384       85.00    75.03    70.07    60.00  
   512x384i      87.06  
   512x288       60.00    59.92  
   416x312       74.66  
   480x270       59.63    59.82  
   400x300       85.27    72.19    75.12    60.32    56.34  
   432x243       59.92    59.57  
   320x240       85.18    72.81    75.00    60.05  
   360x202       59.51    59.13  
   360x200       85.04  
   320x200       85.27  
   320x180       59.84    59.32  
   320x175       85.27  
HDMI-1 connected primary 2560x1440+1920+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440    144.00*+ 120.00    99.95    59.95  
   1920x1080     60.00    50.00    59.94  
   1680x1050     59.88  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x800      59.91  
   1152x864      75.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
DP-1-0 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)

That’s not sddm; that’s kscreenlocker. Those are two very different programs.

Then perhaps the problematic monitor is not properly sending its EDID when reconnected. :man_shrugging:

Thank you for your reply. I just noticed another thing: unless I change the display settings to rearrange displays I can unplug and plug again to my heart’s content with no issue. That’s why I’m inclined to blame software rather than hardware here.

That said, I used xrand --props to get my display’s EDID and put it through edid-decode, which didn’t turn up anything alarming:

edid-decode (hex):

00 ff ff ff ff ff ff 00 4c 2d 57 0f 34 52 57 43
31 1d 01 03 80 3c 22 78 2a 13 75 a7 57 52 9b 25
10 50 54 bf ef 80 71 4f 81 00 81 c0 81 80 95 00
a9 c0 b3 00 01 01 98 e2 00 a0 a0 a0 29 50 08 40
35 00 55 50 21 00 00 1a 00 00 00 fd 00 32 90 1e
e1 3c 00 0a 20 20 20 20 20 20 00 00 00 fc 00 43
32 37 4a 47 35 78 0a 20 20 20 20 20 00 00 00 ff
00 48 34 5a 4d 43 30 30 37 36 32 0a 20 20 01 52

02 03 23 f1 46 90 1f 04 13 03 12 23 09 07 07 83
01 00 00 67 03 0c 00 20 00 80 3c 67 d8 5d c4 01
78 80 00 02 3a 80 18 71 38 2d 40 58 2c 45 00 55
50 21 00 00 1e 56 5e 00 a0 a0 a0 29 50 30 20 35
00 55 50 21 00 00 1a 5a a0 00 a0 a0 a0 46 50 30
20 35 00 55 50 21 00 00 1a 6f c2 00 a0 a0 a0 55
50 30 20 35 00 55 50 21 00 00 1a 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.3
  Vendor & Product Identification:
    Manufacturer: SAM
    Model: 3927
    Serial Number: 1129796148
    Made in: week 49 of 2019
  Basic Display Parameters & Features:
    Digital display
    Maximum image size: 60 cm x 34 cm
    Gamma: 2.20
    DPMS levels: Off
    RGB color display
    First detailed timing is the preferred timing
  Color Characteristics:
    Red  : 0.6523, 0.3408
    Green: 0.3203, 0.6083
    Blue : 0.1455, 0.0654
    White: 0.3134, 0.3291
  Established Timings I & II:
    IBM     :   720x400    70.081663 Hz   9:5     31.467 kHz     28.320000 MHz
    DMT 0x04:   640x480    59.940476 Hz   4:3     31.469 kHz     25.175000 MHz
    Apple   :   640x480    66.666667 Hz   4:3     35.000 kHz     30.240000 MHz
    DMT 0x05:   640x480    72.808802 Hz   4:3     37.861 kHz     31.500000 MHz
    DMT 0x06:   640x480    75.000000 Hz   4:3     37.500 kHz     31.500000 MHz
    DMT 0x08:   800x600    56.250000 Hz   4:3     35.156 kHz     36.000000 MHz
    DMT 0x09:   800x600    60.316541 Hz   4:3     37.879 kHz     40.000000 MHz
    DMT 0x0a:   800x600    72.187572 Hz   4:3     48.077 kHz     50.000000 MHz
    DMT 0x0b:   800x600    75.000000 Hz   4:3     46.875 kHz     49.500000 MHz
    Apple   :   832x624    74.551266 Hz   4:3     49.726 kHz     57.284000 MHz
    DMT 0x10:  1024x768    60.003840 Hz   4:3     48.363 kHz     65.000000 MHz
    DMT 0x11:  1024x768    70.069359 Hz   4:3     56.476 kHz     75.000000 MHz
    DMT 0x12:  1024x768    75.028582 Hz   4:3     60.023 kHz     78.750000 MHz
    DMT 0x24:  1280x1024   75.024675 Hz   5:4     79.976 kHz    135.000000 MHz
    Apple   :  1152x870    75.061550 Hz 192:145   68.681 kHz    100.000000 MHz
  Standard Timings:
    DMT 0x15:  1152x864    75.000000 Hz   4:3     67.500 kHz    108.000000 MHz
    DMT 0x1c:  1280x800    59.810326 Hz  16:10    49.702 kHz     83.500000 MHz
    DMT 0x55:  1280x720    60.000000 Hz  16:9     45.000 kHz     74.250000 MHz
    DMT 0x23:  1280x1024   60.019740 Hz   5:4     63.981 kHz    108.000000 MHz
    DMT 0x2f:  1440x900    59.887445 Hz  16:10    55.935 kHz    106.500000 MHz
    DMT 0x53:  1600x900    60.000000 Hz  16:9     60.000 kHz    108.000000 MHz (RB)
    DMT 0x3a:  1680x1050   59.954250 Hz  16:10    65.290 kHz    146.250000 MHz
  Detailed Timing Descriptors:
    DTD 1:  2560x1440  144.000477 Hz  16:9    213.265 kHz    580.080000 MHz (597 mm x 336 mm)
                 Hfront    8 Hsync  64 Hback   88 Hpol P
                 Vfront    3 Vsync   5 Vback   33 Vpol N
    Display Range Limits:
      Monitor ranges (GTF): 50-144 Hz V, 30-225 kHz H, max dotclock 600 MHz
    Display Product Name: 'C27JG5x'
    Display Product Serial Number: 'H4ZMC00762'
  Extension blocks: 1
Checksum: 0x52

----------------

Block 1, CTA-861 Extension Block:
  Revision: 3
  Underscans IT Video Formats by default
  Basic audio support
  Supports YCbCr 4:4:4
  Supports YCbCr 4:2:2
  Native detailed modes: 1
  Video Data Block:
    VIC  16:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz (native)
    VIC  31:  1920x1080   50.000000 Hz  16:9     56.250 kHz    148.500000 MHz
    VIC   4:  1280x720    60.000000 Hz  16:9     45.000 kHz     74.250000 MHz
    VIC  19:  1280x720    50.000000 Hz  16:9     37.500 kHz     74.250000 MHz
    VIC   3:   720x480    59.940060 Hz  16:9     31.469 kHz     27.000000 MHz
    VIC  18:   720x576    50.000000 Hz  16:9     31.250 kHz     27.000000 MHz
  Audio Data Block:
    Linear PCM:
      Max channels: 2
      Supported sample rates (kHz): 48 44.1 32
      Supported sample sizes (bits): 24 20 16
  Speaker Allocation Data Block:
    FL/FR - Front Left/Right
  Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
    Source physical address: 2.0.0.0
    Supports_AI
    Maximum TMDS clock: 300 MHz
  Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8:
    Version: 1
    Maximum TMDS Character Rate: 600 MHz
    SCDC Present
  Detailed Timing Descriptors:
    DTD 2:  1920x1080   60.000000 Hz  16:9     67.500 kHz    148.500000 MHz (597 mm x 336 mm)
                 Hfront   88 Hsync  44 Hback  148 Hpol P
                 Vfront    4 Vsync   5 Vback   36 Vpol P
    DTD 3:  2560x1440   59.950550 Hz  16:9     88.787 kHz    241.500000 MHz (597 mm x 336 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol P
                 Vfront    3 Vsync   5 Vback   33 Vpol N
    DTD 4:  2560x1440   99.946436 Hz  16:9    150.919 kHz    410.500000 MHz (597 mm x 336 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol P
                 Vfront    3 Vsync   5 Vback   62 Vpol N
    DTD 5:  2560x1440  119.997589 Hz  16:9    182.996 kHz    497.750000 MHz (597 mm x 336 mm)
                 Hfront   48 Hsync  32 Hback   80 Hpol P
                 Vfront    3 Vsync   5 Vback   77 Vpol N
Checksum: 0x64  Unused space in Extension Block: 20 bytes

Your system might be one of those that require this:

I tried it, but it didn’t make any difference.

I think you should try setting/selecting lower refresh rate and/or resolution. Also it may have something to do with HDMI port you are using. I would have tried Type C connector or even dock.
The last resort I can think of is to wait for the next Plasma release, 5.27, which is said to contain a lot of fixes to its screen management stack.

Yeah, I used this monitor with this laptop several months ago and I surely would have noticed this issue then. Same cable, same hdmi port, same nvidia drivers, the only difference being presumably some Plasma updates in between.
I tried using an hdmi-usb-c dongle and while this specific problem did not occur, everything else was all kinds of messed up: lags, missing borders around windows, messed up window layouts, etc… so quite clearly a suboptimal signal path.

I should also add that while the monitor causing problems is 4K, the other one I mentioned that works without issue is only Full HD. So signal throughput may very well be a factor.

1 Like

OK, so I lowered the refresh rate from 144Hz to 60Hz and that seems to have solved the problem.

Good for you. Btw you mentioned that you have the same nVidia driver version but what makes you think that your external screen is managed by Nvidia device? Chances are it’s Intel UHD and it could have seen updates (in-kernel) recently, hence the bug you’re experiencing.
Issue xrandr --listproviders and other xrandr command as per its man page to find out what actually drives your HDMI port. Sorry can’t tell you the exact command as I am far from my laptop now.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.