There is little to no discussion of how to use Wayland with BalenaOS to set up something like Sway, KDE, Enlightenment, Wayfire, etc. Is there something I’m missing, or do I have to try and figure this out on my own? I appreciate any help on this! Thank you.
Hi there,
What device are you trying Wayland on? There is a playground project that uses Wayland here, I think that would be a good starting point. There is also a discussion on using Wayland on a Jetson nano device here, in case that provides you any additional information. Let me know how that goes, and maybe we can put a sample project together.
The devices I’m interesting in using are Pi-like arm SOCs. Let’s just say the Raspberry Pi 1, 2 and or 3 for now.
I’d love to try and get gnome working inside a Balena environment, the use case here is for appliances like vinyl cutters, 3d printers, cnc machines, etc.
This thread from the Maslow cnc forums is where I got a lot of info from in regards to running KDE in Wayland. It’s relatively buggy and not ready, but from what I see it looks like Gnome is entirely ready for it.
It’s seems that you managed to get a working project, that sounds great! Did you using balenaOS for it? I had a conversation with a teammate and he said GPU acceleration on a raspberry PI using Wayland would likely not work and you won’t probably get great performance, so you should keep that in mind.
It would be great, if you don’t mind, sharing a link to your project in this thread, so others can also benefit from it.
Cheers!
No, I’ve not yet used Balena for this task, since that would require a different set of knowledge. I’m just trying to get all this stuff working on the Pi on Raspbian first.
I’d also like to say that I don’t think your teammate is correct considering the precedents that exist. Could you go into more detail as to why he thinks this? Take a look at:
I’ve managed to get XFCE working really well in a project I’ll later put up on github as balena-xfce-base, but am now having trouble with Wayland as it can’t seem to find a tty in /dev/, Will go into more detail when I fully understand what’s happening.
Have you published the balena-xfce-base project on github yet?
I would also be interested to run xfce in a container in balena os.
Have you posted this yet? I can’t find the project either.
@sngehl @bbinet The stuff I did with X11 was based on this project, it’s just adding to what this file already has. https://github.com/balenalabs-incubator/x11-window-manager
I’ve recently created a Wayland kiosk using Sway + WPE for a raspberry pi 4. A simplified version of the source code is available on gitlab for testing purposes: https://gitlab.com/steffend/balena-performance-test
Maybe this is useful for somebody.
Hello @steffend,
I’m trying to use your example to run my electron application on an Intel NUC. I have both containers (Wayland and electron) running without errors but the screen is solid blue. Because of this, I think the Wayland is OK but the problem is to access the screen output from the electron container.
(I am a noob on those subjects - so apologies if I am missing some important technical aspects on this).
I am pretty confident on my electron dockerfile since I was use it on previous PoCs.
However, I don’t have sure about my init.sh script.
#!/bin/sh
echo "hello from cr-electron"
#udevd &
/lib/systemd/systemd-udevd --debug &
udevadm trigger
# link displayserver sockets to shared volume
ln -s /tmp/displayserver/.X11-unix/ /tmp/
ln -s /tmp/displayserver/.wayland/ /tmp/
export XDG_RUNTIME_DIR=/tmp/.wayland
export WAYLAND_DISPLAY=wayland-0
node_modules/.bin/electron --no-sandbox index.js
any idea on this?
thanks in advance,
Hi there. Try to look into the /tmp/displayserver
directory in the container and specifically in /tmp/displayserver/.wayland
. I’ve sometimes seen the wayland display created as wayland-1
instead of wayland-0
. You should be able to see this in the directory. Changing the WAYLAND_DISPLAY
variable accordingly should help in this case.
You are correct that the blue screen means that wayland (specifically sway in this case) is running.
Hello. Thanks for the answer.
I have a wayland-0
so I would say it is something else.
Should the env var XDG_RUNTIME_DIR
be:
=/tmp/displayserver.wayland
instead of
=/tmp/.wayland
?
Note that this uses Electron 16, as Electron 17 seems to crash under Wayland for me.
Hello.
I finally managed to run the sample you provided to me but was just able to do it so using electron 17.
Despite I am using an HDMI display the dmr in use is now the card0-DP-1. Does it make sense?
I was trying to force a specific output’s resolution/framerate.
By running: sudo swaymsg -t get_inputs
I get: [swaymsg/main.c:417] Unable to retrieve socket path
Looking into the env vars the var SWAYSOCK
is not defined.
According to my research, it should exist under /run/user/
but it doesn’t. Any advice on this?
Interesting, for me it did not work with Electron 17, only 16. Electron and Wayland seem to be a bit flaky…
The sway IPC socket is in the XDG_RUNTIME_DIR
. I’ve updated the code to set the environment variable for the Electron app accordingly.
Yes, I’ve seen this before. I think this indicates that despite having an HDMI port, internally the NUC uses Displayport.
Has anyone had any success running river?