Wayland support

So this is something that is lurking around the corner. Getting Wayland as a possibility on Linux. I would like to get an idea of how complicated of a task that is from the JUCE side. I'm working @Samsung now in a Tizen team, part of my "yearly target" is porting JUCE to Tizen. I see Tizen moving in the wayland directio (Intel is pushing it hard in it's IVI Tizen builds, but Samsung is using Xorg for now and that's what i'm working on witht the in-house hardware i'm testing Tizen on).

Anyway i got Juce to run on the internal hardware on Tizen 2 and 3 but using Xorg ofcourse, it runs just like on any other Linux distro (to write some utilities i needed i'd rather take JUCE then the very weird SDK provided by Samsung that's based on Enlightenment).

So my question would be, where to start, is the native file for windows in the juce sources the main Xorg specific code or is Xorg in some other places. If i'll know where to start i'll try to get to it, so far i got wayland+weston running on Tizen3 on exynos hardware (it's really just a GALAXY S3 with a Tizen logo that never went public, but that's our target device and that's what wen to other developers). Can you give me any hints on where to start and how to test this, i'm taking the "platform" aspect out of the equasion and will be doing that nativly on x86 with weston to simplify stuff. My goal is to get the Demo and Introjucer running under Weston and move to ARM/Exynos a bit later. I might get some help on that from Intel (we are working close with Intel on this).

Any help you can give me would be great, if someone would like to jump aboard i see no problem, my team does everything publicly so there are no licensing issues. I will start a git repeo and try to do my work there (git and gerrit are the main tools used here).

Porting JUCE on Tizen 3/2 with Xorg was not an issue it's running fine. Wayland uses GL for all it's drawing i was hoping that this will help due to the fact that JUCE has it's owen GL support. But the Software Renderer would be a nice thing too..

 

Anyway i'm counting on you guys and maybe we can do something really cool in the world of Linux.

cheers

Would love to see this! But apart from a vague notion of what it is, I know absolutely nothing about Wayland or how it works.

Is it something where you'd build your app with a compile-time switch to either work on X or Wayland, or could you build it so that it takes advantage of Wayland if it's available, and falls back to X if not?

I think a macro would be best for this (disabled by default for now).

If we're targetting wayland, it would be best to NOT build any X11 stuff. But there might be an issue regarding VST plugins, which need an X11 Window pointer...

Trying to handle Wayland events plus X11 might be tricky, so perhaps the best choice is to use X11 for VSTs and Wayland everywhere else?

(btw, LV2 plugins don't require X11)

 

Yeah wayland replaces Xorg completly.

There is a compatibility layer in wayland for older Xorg applications, there are issues with that now (what i saw input handling is the biggest one). But it's there.

I thought about a replacement for Xorg, that is never to include both in the library. However both are also possible and an application could theoreticly work on Xorg and Wayland i think (that's how GNOME does that now it supports both).

Wayland itself is a library, it's not a server, only the compositor runs as a process there is no "server layer" in wayland. There is a short description of the architecture: http://wayland.freedesktop.org/architecture.html

QT5 supports it GTK3 supports it (and latest GNOME), EFL can now be a compositor (replacaes Weston) and the work seems to be moving forward.

Yeah, wayland is for sure the future on Linux desktops. My only concern right now is how to handle the Mir vs Wayland situation...

For commercial products this is going to get very tricky.

Can't wait to start shipping three different versions of my application + plugin, one targetting X11, one targetting Wayland and a last one for Mir !

(sorry , just grumbling, the wayland version will have to happen anyway -- it would be great, though, if a single binary could work on both wayland and x11)

Hey it's not my fault that Xorg is broken beyond repait and the Mir/Wayland issue is something weird, i don't know why Canonical didn't agree on something with the community.

All i can say is i got wayland to wokr on an ARM target (a galaxy S3) with Tizen (it's linux on a linux kernel 3.10) and it works much faster using a generic driver (there is no real support for MALI/Exynos on that hardware, so wayland is using something called swrast). I got transparency really fluent movement and it starts much faster.

QT5 / GTK3 / SDL2 / cairo support wayland, waiting for JUCE.

1 Like

VSTs are already using X11 window handles, I don't think that is going to change.

For standalones and LV2 we should use wayland.

+1 for wayland support, I am unable to use GitHub - helio-fm/helio-sequencer: One music sequencer for all major platforms, desktop and mobile because of this.

1 Like

having wayland support will be awesome fore sure

dont know what it is but you have my wholehearted support

4 Likes

+1
seems like everything moves to wayland, so having no wayland support for juce means that there is not really a linux support out of the box for juce?
E.g. if you have a fresh ubuntu installation, which is the most common linux OS, drag and drop is not working:

2 Likes

+1, it was raised many times already.

That would also open possibilities of using JUCE directly on embedded platforms which cannot provide support for X11 or it is very limited (been there, done that). Right now this land is occupied mostly by Qt.

1 Like

That’s a good point… it might be worth turning this into a proper Feature Request post type in order to accumulate votes.

I wonder if this is a possible workaround?

1 Like

I will do the Wayland work if there is a desire to accept the PRs

9 Likes

I upstreamed Wayland support for OpenCV, Google Filament, own/maintain ivi-homescreen (Flutter on Wayland), etc.

That’s great, I’m sure there would be, Direct2D got in for Windows in a similar fashion so I don’t see why Wayland support would be blocked.

I keep chipping away at Vulkan support but I’m at the point where I am trying to compare my downstream work in Vkav against what @parawave did to see where to pick up the pieces.

It’s slow going but hopefully we’ll see more of these types of projects benefiting the JUCE community.

yeah Vulkan would be the move