UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Running Wayland apps on edge?

    Scheduled Pinned Locked Moved App Development
    19 Posts 4 Posters 2.1k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • alan_gA Offline
        alan_g @zubozrout
        last edited by

        @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?

        Z 1 Reply Last reply Reply Quote 0
        • Z Offline
          zubozrout @alan_g
          last edited by

          @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
          
          alan_gA 1 Reply Last reply Reply Quote 0
          • alan_gA Offline
            alan_g @zubozrout
            last edited by

            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.

            Z 1 Reply Last reply Reply Quote 0
            • Z Offline
              zubozrout @alan_g
              last edited by zubozrout

              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
              
              1 Reply Last reply Reply Quote 0
              • dobeyD Offline
                dobey @zubozrout
                last edited by

                @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.

                Z 1 Reply Last reply Reply Quote 0
                • Z Offline
                  zubozrout @dobey
                  last edited by

                  @dobey Ha, good point. I'll try that when I can - and thank you very much for the info :).

                  1 Reply Last reply Reply Quote 0
                  • Z Offline
                    zubozrout
                    last edited by

                    Ok, I am getting the same error even if I remove and install the app again or compile it with a higher version number.

                    alan_gA dobeyD 2 Replies Last reply Reply Quote 0
                    • alan_gA Offline
                      alan_g @zubozrout
                      last edited by

                      Is SDL_VIDEODRIVER=wayland? Or mir?

                      1 Reply Last reply Reply Quote 0
                      • dobeyD Offline
                        dobey @zubozrout
                        last edited by

                        @zubozrout Are your changes in a branch of git, which I could compile locally for x86?

                        Z 1 Reply Last reply Reply Quote 0
                        • Z Offline
                          zubozrout @dobey
                          last edited by

                          @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

                          1 Reply Last reply Reply Quote 1
                          • mariogripM Offline
                            mariogrip Administrators
                            last edited by

                            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
                            
                            Z 1 Reply Last reply Reply Quote 2
                            • Z Offline
                              zubozrout @mariogrip
                              last edited by

                              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:

                              1. sudo ubports-qa install xenial_-_edge_-_wayland (finished with error)
                              2. 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 getting what(): 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.

                              1 Reply Last reply Reply Quote 0
                              • dobeyD Offline
                                dobey
                                last edited by

                                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.

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post