Last year August 2016 I experimented with Wayland, the alternative to the X Window system. My goal was to see if it is possible to run a Plasma5 desktop session on a Wayland compositor instead of using X.Org.
There was one big showstopper at the time. Kwin_wayland has a dependency on the ‘logind’ DBus API and at that time last year, this API was only provided by systemd-logind. Luckily, someone treated the logind component of systemd similarly to its udev component. Where Slackware already uses “eudev” which is a standalone udev source extracted from the systemd source, there’s also “elogind” which is the standalone logind sourcecode, extracted from systemd sourcecode. With some difficulty I managed to create a Slackware package for elogind and everything compiled. I just could not get a working Wayland session.
As it turns out today, that failure to get Wayland working was an omission on my side… more on that later.
Shortly after, IBM told me I would lose my job, I found another job at ASML and life was hectic and remained so. I never got another opportunity to research the root cause of my Wayland failure.
Now that I have a week off, I decided to revisit the old Wayland disaster. After last year’s frustration over the need for elogind, I talked to the ConsoleKit2 developer and to the KWin developer, to see if CK2 could be extended with the required logind DBus API (parts of that API were already incorporated) and to get CK2 accepted as an alternative to systemd-logind on systems that don’t ship with systemd. Both wishes were fulfilled this summer, so I could drop elogind from my package set. I still needed to recompile / upgrade some other packages to add wayland support to them, but the fact is: Slackware does not need PAM or systemd to get Wayland working.
Therefore, my KDE 5_17.10_testing repository contains mostly what you already know and love: KDE Frameworks 5.39.0, Plasma 5.11.0 and Applications 17.08.2. All based on Qt 5.9.2. Just with 17 differences in the package list.
Why does Wayland work now, while it did not last year?
Well, that was entirely my perception of things. Probably would have worked last year as well, if only I had recognized the signs. Last year, and yesterday as well, all the puzzle pieces seemed to be OK, but their integration failed. The signs (using strace and gdb to find out why the Wayland session would not start) were telling me that KWin was trying to find a logind provider on the DBus and no-one was answering. It took a sudden insight this morning, the realization that there is one difference between Slackware and all those other distros. And I have been using a workaround for ages, and I just did not think about that.
It’s PAM.
When you login on a system running PAM, a login session is registered on the bus using either ConsoleKit2 or systemd-logind. Our PAM-free Slackware needs an additional “ck-launch-session” command in front of the “dbus-launch” command to connect a new ConsoleKit2 session to the bus and let KWin find it there… when I fixed that, my Wayland session just sprang into existence!
How to start a Plasma5 Wayland session
- Runlevel 3 (console): run the ‘startkwayland‘ command as your regular user.
- Runlevel 4 (SDDM): select “Plasma (Wayland)” from the session dropdown and then proceed to login.
Caveats
Of course… nothing works 100% the first time. So what have I ran into? Note that I have been running Wayland for a couple of hours only, so I can say little about its stability.
- Dropbox does not start, unless you ‘unset’ the QT_QPA_PLATFORM variable first. This is caused by the fact that Dropbox uses its own internal Qt5 libraries and it does not come with Wayland support.
- Gnome-keyring does not start for some reason, so you can not auto-login to skypeforlinux for instance
- HP-tray was eating 100% CPU at some point and draining my battery. I had to kill the process.
- Yakuake does not work (I know, it is not part of my ‘ktown’ package set)
- Unlike an X.Org session, the Wayland session does not require an additional <Ctrl> keypress to switch to a virtual console. Therefore, when I wanted to invoke krunner with <Alt><F2>, instead I was switched to the second virtual console, tty2. Upon returning to the Wayland session (which was running on VT4 as opposed to VT7 for X.Org) the krunner window was waiting for me. Apparently both the OS and KWin process the <Alt><FunctionKey> combos.
A note about NVIDIA: I know that there are issues between the binary driver and Wayland. Please do your research if you use the binary Nvidia blob. My laptop has an Intel GPU which runs on the open source kernel driver, and has no issues.
Note: check out the KDE page which documents the Wayland issues: https://community.kde.org/Plasma/Wayland_Showstoppers
What’s needed to make Plasma5 work with Wayland in Slackware
We need Wayland support in the core of the OS as well as in the dependencies for Plasma5. Also we need a version of ConsoleKit2 that works with Kwin_wayland. Which means:
- add a wayland-protocols package (wayland is no longer sufficient)
- add an upgraded ConsoleKit2
- recompile Slackware’s mesa using a slightly modified SlackBuild script (change the package tag from ‘alien’ to ‘wayland’)
- write a xorg-server.SlackBuild script based on the code in the x11.SlackBuild framework of Slackware, and recompile xorg-server with that script (change the package tag from ‘alien’ to ‘wayland’)?
- recompile libxkbcommon (change the package tag from ‘alien’ to ‘wayland’)
- recompile qt5 (change the package tag from ‘alien’ to ‘wayland’)?
With the ‘deps’ taken care of, proceed to Frameworks:
- recompile kwayland and plasma-framework (change the package tag from ‘alien’ to ‘wayland’)
And finally the Plasma packages that use Wayland in some way or other:
- recompile kinfocenter, kscreenlocker, kwayland-integration, libkscreen2, plasma-desktop, plasma-integration, plasma-workspace, powerdevil and kwin (change the package tag from ‘alien’ to ‘wayland’)
You will have noticed that the packages I tagged with ‘wayland‘ instead of the usual ‘alien‘ tag, are the ones that picked up Wayland support as compared with their originals. This makes it quite easy for you to switch back to the original packages (mesa and xorg-server in Slackware and the other 13 in ‘ktown’) if you are done with your testing. The remaining ‘alien’ packages (wayland-protocols and ConsoleKit2) can be kept without penalty.
A final note about this updated xorg-server package. My version of that package is a 4-into-1 package; it contains xorg-server-xephyr, xorg-server-xnest and xorg-server-xvfb as well. If you decide to remove the testing packages and want to go back to Slackware’s non-wayland version of xorg-server, you must also re-install the other three xorg-server-x* packages.
Installing or upgrading Frameworks, Plasma and Applications
Please use the README file in the ‘latest’ repository for the installation & upgrade instructions. I reserved the README.testing in the ‘testing’ repository to highlight the differences between the two repositories.
Where to get these ‘testing’ packages for Plasma Wayland
Package download locations are listed below (you will find the sources in ./source/5/ and packages in /current/testing/ subdirectory). Only “bear” has the packages for now, the mirrors should follow within 24 hours. If you are interested in the development of KDE 5 for Slackware, you can peek at my git repository too. There is now only one source tree to create both ‘latest‘ and ‘testing‘ repositories.
- http://bear.alienbase.nl/mirrors/alien-kde/ (my own mirror), rsync URI is rsync://bear.alienbase.nl/mirrors/alien-kde/.
- http://repo.ukdw.ac.id/alien-kde/ (willysr’s Indonesian mirror), rsync URI: rsync://repo.ukdw.ac.id/alien-kde/
- http://ftp.lip6.fr/pub/linux/distributions/slackware/people/alien-kde/ French fast mirror thanks to Tonus.
- http://slackware.uk/people/alien-kde/ (fast UK based mirror, run by Darren Austin), rsync URI: rsync://slackware.uk/people/alien-kde/
Live ISO of PLASMA5
There will probably not be a Plasma5 Live ISO image based on the ‘testing’ repository with working Wayland support. My ‘bear’ server just does not have the disk space to host an additional 4 GB ISO file. Nevertheless, you can tranfer the existing Plasma5 Live ISO to USB stick, change the ‘latest‘ ktown repository to ‘testing‘ in the slackpkg+ configuration file “/etc/slackpkg/slackpkgplus.conf” and run “slackpkg update ; slackpkg install ktown ; slackpkg upgrade ktown” to get the 4 new packages and upgrade the 13 other packages. If you do not use slackpkg with slackpkg+ then simply look at the short list of packages to be installed or upgraded, higher up on this page.
Have fun! Eric
Wow Eric! This sounds like a very important step towards the goal of granting us a solid future!
My congratulations and gratitude 🙂
I see you are a major writer / documenter as well. I would assume this could be a path to getting Plasma 5 into a Slackware release…just thinking out loud.
You have a gift Eric, one that I have not developed, so I am very grateful for your time and effort. Thank you.
Eric! That’s huge! Congratulations!
Your announcement just paved the way for a ‘modern’ Slackware at some point in the future (just like pulseaudio did).
Patrick should be very proud of you… and laughing out loud from that wild systemd guy. Well, I’m! 😛
It’s funny thing that i have been using ck-launch-session in MATE and Cinnamon for a long time. I just didn’t think it was the key to work with with Wayland 🙂
I’ve added this link to the main article, it is full of interesting info: https://community.kde.org/Plasma/Wayland_Showstoppers
I tested, last night, plasma, starts correctly, but kwin crashes and restarts almost every launch of an application.
Hi Willy, exactly that is why I wrote “I have been using a workaround for ages”…
The startup scripts for Plasma and SDDM already get fixed for years by adding a ck-launch-session call. It’s just that in the past, we only lost some functionality when not using ck-launch-session (issues with ‘switch user’, the startup animation, screenlocker) but for KWin_Wayland it is an “all-or-nothing”. Without that ck-launch-session it would simply refuse to start.
Gérard, did you perhaps skip a package that should have been replaced or added?
In first time i have just upgraded OR installed your all wayland package,
After i have build plasma-5.11.2 with your build script , but, the result is the same,
but I did not really investigated the problem 😉
I’m currently playing with your plasma wayland and these are my finding:
– Alt+Tab shortkey crashes wayland session
– System Settings crashes on close
– Yakuake 2.9.9 runs without problem, including shortkey F12
– HPLIP tray is working normally with normal cpu usage
I’ll play with this plasma wayland for the next couple hours. I hope I don’t accidentally pressing the Alt+Tab keys 😛
Forgot to mention that my application menu setting which is using global menu is not working in wayland session.
Ok, Eric, i have tested wayland on one opensuse tumblewed and i have same problème, i think it’s a hardware problem, the support of my radeon card is probably buggy in wayland 😉
Updates after reinstalling all testing packages:
– Alt+Tab finally working
– Maybe krdc needs to be rebuild or upgraded. It keep saying xfreerdp is too old while I’m using freerdp 2.0.0-rc0 (latest release). Remmina works, though.
– I had to restart kwalletd5 service before I can using it properly
– Global menu still not working
– Restarting HP-systray seems a workaround for it’s high cpu usage problem, but the GUI will stop working because it says error importing cupsext module. It’s strange because I can import/open it from inside python3 shell.
That’s for now. Thanks for your huge effort on this plasma5 wayland.
Widya, thanks for documenting your findings. I may not answer to all of them, but I will investigate to see if there’s anything that can be done on our side.
I’ve followed your instructions but x server doesn’t start.
I got these warnings:
Warning: Missing charsets in String to FontSet conversion
Warning: Unable to load any usable fontset
synteejol – Wayland is not the same as an X server. They are different protocols. I assume you meant to say that the Wayland session is not starting.
Since you provide zero detail about the steps you took and do not show any errors, there is not a lot I can do.
At a minimum, describe your initial Slackware setup (what release and archtecure; full install or partial install, already running Plasma5 or not), I want to see the commands you used to download the packages and the commands you used to upgrade to Plasma5 ‘testing’.
Also tell me where you saw these warnings, and whether there was additional output.
FYI:
If you want Plasma, and KWin, to output more and better debug messages, you can follow the instructions here:
https://wiki.postmarketos.org/wiki/Plasma_Mobile
I’m running Slackware current 64 bit.
First of all I’ve installed slackpg+, added your repository and then installato ktown
I obtain a long error message. I write some linea
/usr/bin/startkde: line 152: qtpaths: command not found
Xset: bad font path element
I know it’s my fault.
You probably forgot something.
What is the URL of the ktown repository you are using in /etc/slackpkg/slackpkgplus.conf ? You will only get Wayland working if you use the ‘testing’ repository.
The error “/usr/bin/startkde: line 152: qtpaths: command not found” sounds like you forgot to install the qt5 package, or else forgot to logout/login afterwards.
Were you trying to start Plasma5 as the root user perhaps?.
This is the URL http://bear.alienbase.nl/mirrors/alien-kde/
I was trying ad root and ad normale user.
I should check every step I take during installation
Synteejol that would not be the correct URL.
The slackpkg+ configuration expects the URL to a repository which is specific to a certain version and architecture. In this case, where you want to test Wayland, you would use the URL http://bear.alienbase.nl/mirrors/alien-kde/current/testing/x86_64/
But considering your obvious lack of Slackware knowledge and skill, I wonder why you chose to install our work-in-progress aka slackware-current. This is where we do our development and you are in fact considered a beta tester. And you are expected to know your way around Slackware and fix things on your own.
On top of that you chose to install a 3rd-party testing repository for Wayland support, something that will probably not be available in stable Slackware for years to come.
Please re-consider.
I’ve moved from debian to slackware for few times, and I have a lack of knowledge on this distribution. I’m really sorry if I wasted your time.
My intention was install this system on a machine in the lab where I work in order to use an OS I like and show it to my colleagues (as you can guess, they prefer to work on windows machine). Kde5 is more attractive than kde4 so people can appreciate it soon.
As you suggest I’ll switch to 14.2 version or back to debian. Thank for time you spent with me.
On my laptop ASUS A456U (intel + Nvidia) still not working, any idea for intel + nvidia for running plasma wayland? thanks
Just for info, you can install all wayland packages and use xorg, xorg remains fully functional 😉