Forums

The Raspberry Pi two screen problem

Who is this for? If you have a raspberry Pi 5 and two displays running at a resolution of 2560 x 1440, then you’ll likely have a problem, so read on. If not, this one isn’t likely of interest. What’s the problem? So if you have a Raspber...

Who is this for?

If you have a raspberry Pi 5 and two displays running at a resolution of 2560 x 1440, then you’ll likely have a problem, so read on. If not, this one isn’t likely of interest.

What’s the problem?

So if you have a Raspberry Pi5 with a single screen, or two screens running at say 1920x1024, then you won’t experience this issue. But newer 28" screens tend to have a 2560x1440 resolution (or higher) and for developing, two screens of often very beneficial. The problem on the RPi5 however is that with this very specific configuration you will probably experience one of these three issues;

  • Instability and daily lock-ups if you are using the Wayland display manager
  • Mouse flicker, screen shake, screen flicker, screen corruption
  • Two screen overlap with the cursor position not mapping to the screen making the system unusable

Why ME?!

Now, for anyone with these problems and not understanding why all Rpi5 users don’t experience said issues, here’s the reason.

Wayland

Firstly the Wayland display driver, typically for Gnome, has fixed all the screen corruption and flickering issues, however being relatively “new” experiences a number of memory leaks either in it’s own code or in the RPi5’s low-level graphics drivers. Eventually after a certain amount of usage some of the memory allocation calls made by Wayland start to fail and eventually (typically) the Gnome desktop will hang. (or Chromium will hang) Any kind of recovery is short lived since in-memory buffers have leaked, only a restart of the desktop or system will solve the problem.

X11

If you’ve experienced this, your next stop will have been to fall back on the X11 display driver. Good old tried and tested X11. Hmm. So falling back to Gnome on X11 seems to work, and the system doesn’t hang, however you will notice flickering under the mouse, random screen garbling, under certain conditions the one screen will jump up and down then the mouse is on the other screen. It’s kinda usable but it’s clearly broken and a royal pain on the annoyance scale.

KDE

So the next approach if you want an advanced desktop is to try KDE. Unfortunately if you’ve done this, you’ll end up with the overlapping screen problem where part of one screen is mapped onto the other and the mouse won’t actually be where it appears to be on the screen. The immediate conclusion is “wierd, KDE doesn’t work!”, but it’s not quite as simple as that.

We need to talk about the Compositor

After reading around the subject, nobody seems to know exactly what it is, but you see the term “compositor” used quite a bit. So, fallback again to XFCE and lo and behold, it too suffers from the screen overlap issue.How can this be, XFCE and KDE have the same problem! Well it turns out there is a fix for this, the fix being to turn off the compositor function which is a feature in the “Windows Manager Tweaks” application. So … the “compositor” is apparently the issue. So what happens when you go back to “Gnome/X11” and install a compositor like “Compton” and fire that up? Well, yes, you also get the screen overlap problem.

So the issue has been narrowed to two screens at 2560x1440 running a desktop that supports a compositor. Why not run XFCE or Gnome and leave it “off”? Well on Gnome you get lots of screen display issues, on XFCE, you “could”, however you lose some graphical display functionality and you need to turn off some features like “draw windows contents while dragging” or “while resizing”, because without the compositor feature it’s just too slow.

Here comes the hardware bomb

OR, you could just run two screens at 1920x1024! … so, how is it that the resolution causes this problem? Well, it would seem that on reading the RPi5 specs that for this specific resolution, it runs in “interlace” mode. i.e. it outputs alternative scan-lines on each VSync, rather than the entire picture. So alternate scan lines at 60Hz effectively give you a full picture at 30Hz. (if you’ve ever seen TV’s quoted as 1080p or 1080i, that “i” stands for “interlaced”, which means it’s not reallllly supporting the resolution you think it is, it’s effectively supporting the resolution by slight of hand … well, eye)

So what’s the problem then, despite documentation to the contrary it would “appear” as if all the compositors I’ve seen (with the exception of Wayland which is unstable) don’t properly support two interlaced displays … and without a compositor you’re going to get screen display issues.

What’s the solution?

Well it depends to an extent on your tolerance for visual screen defects, however for me, viable solutions seem to be;

  • Stick to XFCE with the compositor disabled
  • Wait for the Wayland issues to be fixed in the “next” release
  • Keep trying other Window managers and look for something else that works Ok without a compositor
  • Keep trying other compositors and look for one that works with interlacing
  • Revert to one screen
  • Drop the screen resolution to 1920x1024

It’s one of those WTF?! moments that I guess wasn’t envisaged by the guys at Raspberry Pi when they thought it would be a good idea to support the higher resolution without using slightly better hardware … (!)

If any of my assumptions here are wrong …

Please let me know, even better, if you have a working fix, please let me know. In the meantime I’m looking forward to a new Gnome/Wayland release to see if it’s a more stable option. I’m still at a loss to understand why the new compositor in Wayland seems work where old X11 compositors seem not to.

rpi5x2

1 post - 1 participant

Read full topic