Bug 443832

Summary: Wallpapers sometimes being reset to default
Product: [Plasma] plasmashell Reporter: gudvinr+kde
Component: generic-multiscreenAssignee: Aleix Pol <aleixpol>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate, plasma-bugs
Priority: NOR    
Version: 5.22.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description gudvinr+kde 2021-10-16 13:00:44 UTC
SUMMARY

I need to re-enable custom wallpapers from time to time because they are being reset to default one.

I have 2 monitor setup (DP + HDMI) and 4 different activities. I do not see strong connection of this bug with neither specific activity nor specific monitor.


STEPS TO REPRODUCE
1. Set wallpaper to specific activity
2. Work with PC as usual not touching wallpaper and monitor settings

OBSERVED RESULT

After a while (including power off and power on cycles) Plasma sometimes reset wallpapers on activities. It's either wallpaper for one display or both.


EXPECTED RESULT

Not resetting walpapers.


SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.12-arch1-1 (64-bit)
Graphics Platform: X11
Comment 1 Nate Graham 2021-10-17 23:37:13 UTC
When the wallpaper gets reset like this, does it return to the default one, or does the whole background turn black?

Do you have an AMD GPU?

Does the problem happen if you plug the two screens into different physical connectors (if possible)? e.g. plug the DP screen into HDMI, and the HDMI screen into DP.
Comment 2 gudvinr+kde 2021-10-18 09:14:43 UTC
(In reply to Nate Graham from comment #1)
> When the wallpaper gets reset like this, does it return to the default one,
> or does the whole background turn black?

As I said, to default one.

> Do you have an AMD GPU?

That is correct, AMD Polaris 22 with open source drivers.

> Does the problem happen if you plug the two screens into different physical
> connectors (if possible)? e.g. plug the DP screen into HDMI, and the HDMI
> screen into DP.

It would be quite challenging for me to execute because of cable management and monitor placement.
I have dual-monitor setup with different monitors and one of them is in vertical orientation. So if I switch their connectors it'll probably mess up my desktop layout badly.

This is how it is:
 ______________   ________
|              | |        |
|              | |        |
|     DP-2     | |        |
|              | | HDMI-1 |
|______________| |        |
                 |        |
                 |________|
Comment 3 Nate Graham 2021-10-18 16:01:29 UTC
Aha, your AMD GPU is experiencing a kernel but (https://bugzilla.kernel.org/show_bug.cgi?id=206387) which triggers the issue.

I'm not aware of a workaround, unfortunately.
Comment 4 gudvinr+kde 2021-10-18 16:36:44 UTC
I do not agree that this wallpaper stuff is an upstream bug.

It is connected to AMD driver behaviour, yes. But it is an issue with KDE that it relies on volatile identifiers that indicate interfaces rather than monitors.

Plasma (or KWin, does not matter) developers made an assumption that interface name will identify monitor. It is undestandable because commonly on desktop you usually plug montitors and forget. And older graphics cards even had only one HDMI/DP/VGA/etc. But this is wrong on many levels.

For example, if you want to change interfaces it'll reset desktop settings.
If you have a laptop with multiple ports (USB-C/miniDP) it will also break settings if you unplug your monitor and then plug it back to other interface.

It has same effect as notorious issue with network device names.
If you have more than one network adapter, they can be enumerated by kernel unpredictable. E.g. your onboard network card will be /dev/eth1 and PCIe card is /dev/eth2 and on the next boot it could change.

If you swap SATA ports on your motherboard it'll break your mounts in fstab if you don't use partition UUID.

Same logic should be applied here.

Monitors already have unique serial numbers in EDID and XOrg is able to get them:

[    47.193] (II) AMDGPU(0): Serial No: ABCXYZ123QWERTY
[    47.193] (II) AMDGPU(0): Monitor name: BenQ XX1234Q
--
[    47.196] (II) AMDGPU(0): Serial No: ASDF9876IOP321
[    47.196] (II) AMDGPU(0): Monitor name: DELL X4321P


These IDs can (and should) be used instead of interface names to avoid issues like this one.
Comment 5 Nate Graham 2021-10-18 16:39:26 UTC
Yes, our decision to use the connector name was in retrospect a poor one, IMO. I'm not sure of the history for why we didn't use serial numbers. We probably should. It would solve a whole constellation of issues.

Can you file a new bug report about that specifically? Thanks!
Comment 6 gudvinr+kde 2021-10-18 16:51:02 UTC
(In reply to Nate Graham from comment #5)
> Yes, our decision to use the connector name was in retrospect a poor one,
> IMO. I'm not sure of the history for why we didn't use serial numbers. We
> probably should. It would solve a whole constellation of issues.

It's just straightforward. That was completely valid assumption a while back. As I said already it was not really very common to have more that one interface of same type.
Nowadays it's usually HDMI or DP and you can easily have 4xDP on video card.

Daisy chain over DP wasn't a thing either. As person in the issue you linked said, you can't have consistent interface names if you create virtual interfaces for every monitor in daisy chain.

I tried to use MST but it caused me other issues with KDE.

I really doubt that there were a lot of developers with non-standard configurations and nobody just couldn't even imagine that in the future drivers would create virtual display interfaces.

> Can you file a new bug report about that specifically? Thanks!

Sure, Where should I put that?
I'll link this one there too.
Comment 7 Nate Graham 2021-10-18 17:08:17 UTC
(In reply to gudvinr from comment #6)
> (In reply to Nate Graham from comment #5)
> > Can you file a new bug report about that specifically? Thanks!
> 
> Sure, Where should I put that?
> I'll link this one there too.
plasmashell | Multi-screen support

Thanks!
Comment 8 gudvinr+kde 2021-10-18 17:40:24 UTC
https://bugs.kde.org/show_bug.cgi?id=443986