Bug 489945 - Wayland compositor (sometimes) outputs corrupted video signal to one of two external monitors
Summary: Wayland compositor (sometimes) outputs corrupted video signal to one of two e...
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.1.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-08 19:32 UTC by Alex Lowe
Modified: 2025-03-11 18:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Lowe 2024-07-08 19:32:22 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
When using kwin_wayland and plugging in a USB4 docking station with two UHD monitors, the video to one of the monitors is often corrupted. Switching to an x11 display and then back fixes this corruption. (Works fine with Thunderbolt hardware.)

STEPS TO REPRODUCE
1. Boot up and login to kwin_wayland without a docking station attached
2. Detach power from docking station, reattach power. (This is important, as it seems to change some mode in the docking station - this could indicate that the bug is in the docking station software - see Additional Information below)
3. Attach a docking station with two 3840x2160 resolution monitors in DisplayPort mode

OBSERVED RESULT
Corrupted video signal to the monitor designated on the "second" DisplayPort port

EXPECTED RESULT
Normal video

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.0
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.0
Kernel Version: 6.8.0-36-generic (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon 780M Graphics
Memory: 60.6 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Framework
Product Name: Laptop 13 (AMD Ryzen 7040Series)
System Version: A7
Docking Station: Anker 568 USB Docking Station, product number A8399 (https://www.anker.com/products/a8399?variant=42385578393750)

ADDITIONAL INFORMATION
Workaround: Start an X11 session (even as simply as using Plasma's "switch user" button) with the dock plugged in

The docking station in question contains a VIA Labs USB4 hub. I've tested the following hardware combinations:

AMD Framework laptop:
 - Works with X11 or after an X11 session
 - Produces a corrupted signal when the first plugin after the dock goes to sleep or is powered on.
Intel Framework laptop (12th generation):
 - Works properly with kwin_wayland
 - Works properly with X11
Macbook (M1) running macOS:
  - Works as expected, with known Apple silicon mac limitation of the external display rendering the same image (but not corrupted)
Steam Deck:
  - Works as expected in desktop mode (which uses X11)

I recognise that this bug may well be somewhere other than kwin_wayland. However, there appears to be something being done in x11 that works around this problem until the dock goes to sleep, so I'm hopeful that not only can kwin_wayland implement this workaround, but that also the expertise here can help point me to the proper place to file any other relevant bug reports.
Comment 1 Zamundaaa 2024-07-09 17:23:14 UTC
Does switching to a different tty and back also fix it?
Comment 2 Alex Lowe 2024-07-17 18:30:29 UTC
(In reply to Zamundaaa from comment #1)
> Does switching to a different tty and back also fix it?

No, only switching to an X session. In my configuration though switching to a terminal TTY doesn't output to those displays.
Comment 3 Alex Lowe 2024-07-17 18:32:32 UTC
(In reply to Alex Lowe from comment #2)
> (In reply to Zamundaaa from comment #1)
> > Does switching to a different tty and back also fix it?
> 
> No, only switching to an X session. In my configuration though switching to
> a terminal TTY doesn't output to those displays.

I should probably clarify though: after switching to the X session, the Wayland session does work (at least until the dock goes to sleep), so it's something in initialisation.

Likewise, the Wayland session works fine after plugging in my Steam Deck.
Comment 4 Alex Lowe 2024-07-26 21:14:24 UTC
(In reply to Zamundaaa from comment #1)
> Does switching to a different tty and back also fix it?

OK so more about that with a kernel update and other updates (Qt 6.7.2, kernel 6.8.0-39-generic): I'm no longer getting the corruption - instead I'm getting the monitors not coming out of sleep. Switching to a different TTY and waiting for the monitors to wake up and show the terminal does fix it, but I have to wait for the monitors to show the terminal. This is probably a separate issue so I'll file it as such, but I can no longer reproduce the corruption.