Running Wayland apps on edge?
-
@dobey said in Running Wayland apps on edge?:
Almost certainly, as apps can only access their package-specific path in $XDG_RUNTIME_DIR I think. We might need to add something to the apparmor policy to allow apps to see this socket?
That sounds similar to the situation with snaps. As well as the AppAmour policy, client apps need to do a "little dance" to use the Wayland socket. For example: https://github.com/MirServer/mir-kiosk-kodi/blob/master/glue/bin/kodi-launch.sh
-
Thank you all for your reply :).
phablet@ubuntu-phablet:~$ echo $XDG_RUNTIME_DIR /run/user/32011 phablet@ubuntu-phablet:~$ ls /run/user/32011/ confined mir_socket upstart-dbus-bridge.1685.pid dbus-session mir_socket_trusted upstart-file-bridge.1685.pid dconf pulse upstart-udev-bridge.1685.pid keyring signond wayland-0 libertine upstart wayland-0.lock
$WAYLAND_DISPLAY
- I don't thinks it is set at all but maybe I am looking wrong.I've also tried to make the app unconfined and there is no difference in the error at all.
https://www.iubuntu.cz/apps/zub.sdldemo_0.2_armhf.click (unconfined click with some binaries with it - I've built it from the zub's source, it is hosted on my server, but you should never trust random packages like that so this is only for those very adventurous) -
@zubozrout said in Running Wayland apps on edge?:
$WAYLAND_DISPLAY - I don't thinks it is set at all but maybe I am looking wrong.
That's fine - it overrides the default of
wayland-0
.If you've dropped any confinement then the next question is:
What are the permissions on
$XDG_RUNTIME_DIR/wayland-0
? -
@alan_g Seems ok to me:
phablet@ubuntu-phablet:~$ ls -al $XDG_RUNTIME_DIR/wayland-0 srwxrwxr-x 1 phablet phablet 0 srp 14 17:01 /run/user/32011/wayland
-
If you set WAYLAND_DEBUG=client when starting your app, the libwayland library will write what's happening (if anything) to the console log. There may be clues there.
-
I've tried this but it doesn't seem to be the way to go (It doesn't tell me more info):
WAYLAND_DEBUG=client ubuntu-app-launch zub.sdldemo_SDLDemo_0.2
And running just this doesn't tell me much more but I'd expect there would be something missing for the app to run without ubuntu-app-launch:
phablet@ubuntu-phablet:~$ WAYLAND_DEBUG=client /opt/click.ubuntu.com/zub.sdldemo/current/sdl_demo terminate called after throwing an instance of 'SDL2pp::Exception' what(): SDL_Init failed: No available video device Aborted
-
@zubozrout said in Running Wayland apps on edge?:
I've also tried to make the app unconfined and there is no difference in the error at all.
You did change the version number when doing this, yes? Or completely removed the old version first? Otherwise it will still have the old profile from the previous install.
-
@dobey Ha, good point. I'll try that when I can - and thank you very much for the info :).
-
Ok, I am getting the same error even if I remove and install the app again or compile it with a higher version number.
-
Is
SDL_VIDEODRIVER=wayland
? Ormir
? -
@zubozrout Are your changes in a branch of git, which I could compile locally for x86?
-
@dobey This one should be it: https://gitlab.com/zubozrout/sdl2-demo/tree/wayland
To build it it should hopefully be enough to follow these instructions: https://gitlab.com/zubozrout/sdl2-demo/tree/wayland#building-the-sdl2-demo-project
-
If this is an android device, wayland currently will not work on stock edge, as some changes to the android graphic plugin is needed for wayland to work.
See: https://github.com/ubports/mir-android-platform/pull/7
I have setup an experimental branch that you can try:
sudo ubports-qa install xenial_-_edge_-_wayland
but yeah, this is highly experimental
Please note that the "startup screen might just be black, but unity8 should come up after some time"
To start any applications you need to set:
export EGL_PLATFORM=wayland
-
It seems like this is a bit more difficult on MX4 (no space left in the respective filesystem) - but with a bit of persuading I was able to get the update installed following these steps:
sudo ubports-qa install xenial_-_edge_-_wayland
(finished with error)apt -o Dir::Cache::Archives=/home/phablet/Downloads full-upgrade
(processing the updates using Downloads folder to save the packages to prior installing)
With the above modifications I can confirm the screen being black on startup :).
Unfortunately though I am still gettingwhat(): SDL_Init failed: No available video device
. And this could be an issue with my Wayland modifications in the code - which now seems more probable. -
If you build your app on a PC with your build of SDL, does it work under wayland/weston? That's probably a good place to start debugging.
Once that's working, if you have a 16.04 VM set up with unity8 installed, I would build an x86 version of the click, install it in the VM, and see what works.
Once both of those are working, it should also work on phones/tablets, once the remaining bits to get wayland clients working there are done.