Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Standalone Xwayland
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 11, 2021 8:44 pm    Post subject: Standalone Xwayland Reply with quote

I ran across a bug request for a standalone server. https://bugs.gentoo.org/785430
Neither the person asking nor the dev answering seem to have a clue.

So I did something that I had been intending to do, create an ebuild for standalone Xwayland.

I was already running the standalone version (downloaded, ran meson, and move binary where I wanted :) )
so wasn't something terribly new to me.

Anyway on that thread, I posted the ebuild and patch that goes with it, as attachments.

For anyone that wants to try it out ... Enjoy
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2732

PostPosted: Fri Jun 11, 2021 9:06 pm    Post subject: Re: Standalone Xwayland Reply with quote

Anon-E-moose wrote:
I ran across a bug request for a standalone server. https://bugs.gentoo.org/785430
Neither the person asking nor the dev answering seem to have a clue.
fwiw no dev answered this (yet), it's just users / contributors. Only dev involved assigned the bug (but some non-devs have editbugs privileges too :?)

But yeah standalone xwayland (and also xorg-server meson migration) is something that'll need to be done sooner or later, right now the primary X dev been focusing on gnome-40 stuff though.

That aside, always nice to have some ebuild/patch around.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 11, 2021 9:40 pm    Post subject: Reply with quote

Yeah, I realize now that I didn't see a dev tag. Anyway, it's there, I'm running it now. So I know it works.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2732

PostPosted: Sat Jun 12, 2021 4:56 pm    Post subject: Reply with quote

Having a quick look it's nice to see this USE=eglstream :) Considering I added egl-wayland some time ago.

If it works well may eventually be able to look into making gnome default to wayland even for nvidia-drivers, do need to do more testing with that and might as well wait for 470.xx though.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Sat Jun 12, 2021 9:40 pm    Post subject: Reply with quote

Ionen wrote:
Having a quick look it's nice to see this USE=eglstream :) Considering I added egl-wayland some time ago.

If it works well may eventually be able to look into making gnome default to wayland even for nvidia-drivers, do need to do more testing with that and might as well wait for 470.xx though.


I tried to incorporate only the few things that the user might want to change (meson default is either false or blank, depending on var)

The ebuild needs to be added to, at least the dependencies, I didn't bother with things that I knew would be put down by xorg-server, and they need to added. Looking forward to when people won't install xorg-server but will install Xwayland, then the dependencies on libX11 and a few other things need to be added.

I moved over what I'm working on to github, so I'll get around to improving it soon.

If I'm not mistaken, there should be lots of wayland changes in the upcoming 470.
Though it looks like they will drop the kepler line (GTX 600/700) after the 470 release.

Edit to add: who knows whether I'll be around much longer, nor do I know what will happen to the bug.

But I copied my local stuff to github and I'll continue to clean up the xwayland ebuild (if nothing else, for me)
https://github.com/droc12345/local/tree/master/portage/gui-apps/xwayland
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
MrZammler
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jun 2003
Posts: 128
Location: The Island of Crete

PostPosted: Sun Jun 20, 2021 4:20 pm    Post subject: Reply with quote

Hey!

Saw this ebuild and thought to try it, since on wayfire xwayland (from xorg) crashes for me when I turn off/on my monitor.... (we had this discussion in another thread)...

I can do export WLR_XWAYLAND="/usr/bin/Xwayland", and I see it running, however any X apps, still complain about missing DISPLAY. Anything else to do besides installing it and setting this env variable?

Thanks!
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Sun Jun 20, 2021 5:01 pm    Post subject: Reply with quote

What version of wlroots?

when you see xwayland running what does "ps axf -o pid,tty,args" show for the command line for Xwayland.

Mine shows
Code:
Xwayland :0 -rootless -terminate -core -listenfd 20 -listenfd 21 -wm 24



and the DISPLAY's that are automatically set.
Code:
$ set|grep DISP
DISPLAY=:0
WAYLAND_DISPLAY=wayland-1


And what does "ls -la /tmp" show
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
MrZammler
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jun 2003
Posts: 128
Location: The Island of Crete

PostPosted: Mon Jun 21, 2021 6:14 am    Post subject: Reply with quote

Hi!

I'm running the git version of wlroots (with USE -X, -x11-backend). ps shows just:

Code:
/usr/bin/Xwayland


and nothing else....

Code:
$ set|grep DISP
WAYLAND_DISPLAY=wayland-1
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Mon Jun 21, 2021 9:13 am    Post subject: Reply with quote

Code:
wlroots reads these environment variables

# wlroots specific

* *WLR_BACKENDS*: comma-separated list of backends to use (available backends:
  libinput, drm, wayland, x11, headless, noop)


You might try setting the variable without x11 in it and see what it does.

The problem is wlroots tries to start Xwayland (which it finds in /usr/bin, probably put there by xorg-server)
even if you point it to something that doesn't exist it will find /usr/bin/Xwayland

Having said that, you can make an empty executable shell script and point WLR_XWAYLAND to it.

in my case
Code:
export WLR_XWAYLAND="/home/don/bin/Xwayland.sh"

which does some things for me then fires off the new Xwayland.

something like the following might work

create a file wherever you want and put this in it and point the WLR_XWAYLAND variable to it.
Code:
#!/bin/sh

exit 0


Edit to add: if you try the above and it doesn't work, then I have a couple more questions.
How do you start wayland, dm? cmdline? Which compositor sway/wayfire/kde's/gnome's ?
I thought about what you posted, and if you see xwayland with no cmdline then it might not be being launched by wlroots.
Just some more thoughts.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland


Last edited by Anon-E-moose on Mon Jun 21, 2021 6:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jimmy Jazz
Guru
Guru


Joined: 04 Oct 2004
Posts: 331
Location: Strasbourg

PostPosted: Mon Jun 21, 2021 1:50 pm    Post subject: Reply with quote

Anon-E-moose wrote:
[...]
in my case
Code:
export WLR_XWAYLAND="/home/don/bin/Xwayland.sh"

which does some things for me then fires off the new Xwayland.

something like the following might work

create a file wherever you want and put this in it and point the WLR_XWAYLAND variable to it.
Code:
#!/bin/sh

exit 0


what about
Code:
 export WLR_XWAYLAND=true
?
_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 25, 2021 11:12 am    Post subject: Reply with quote

There is a new standalone x11-base/xwayland in portage

One can have xorg-server installed, but they shouldn't have the wayland flag enabled for xorg-server.

In my ebuild, I originally had it in gui-apps, but I've moved it to x11-base to match gentoo (though I still think gui-app or a gui-base is more appropriate)
though if gui-base comes alone to match x11-base, I would suggest moving all wayland related stuff in dev-libs to it).

There are some changes between mine and the gentoo one

1. gentoo says xorg-server is fine as long as not below a certain rev
in mine, I've changed that to say that xorg-server[wayland] is not allowed with xwayland pkg (B blocking in portage)
and the reason for this is that I think it best to only have one xwayland down at a time (for normal users, devs can always easily bypass this)
2. I have a few differences in USE flags, but mine match the meson build more correctly.
3. I removed a bunch of -D defines that were redundant in the ebuild, as they were set that way by meson (defaults) to simplify the ebuild.
4. gentoo uses /usr/libexec/Xwayland with a symlink to /usr/bin/, I originally did that but when I put the block on xorg's xwayland, I moved mine to /usr/bin directly.

So, the latest version of mine is https://github.com/droc12345/local/blob/master/portage/x11-base/xwayland/xwayland-21.1.1.ebuild
Enjoy

Edit to add: I've been using wayland/xwayland for about a month now, I like it better than X11, in many ways.
I've even removed xorg-server and stuff that only runs X11 not xwayland.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland


Last edited by Anon-E-moose on Fri Jun 25, 2021 12:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2732

PostPosted: Fri Jun 25, 2021 12:52 pm    Post subject: Reply with quote

The <=xorg-server-1.20.11 block is because 1.20.11-r1[wayland] does _not_ provide xwayland anymore (Edit: but rather depend on xwayland to provide it), so they can co-exist. Ultimately the USE will likely be removed and packages depend on xwayland directly (it's a transition period).

The /usr/bin/Xwayland is meant to be temporary I think, many packages still insist on using that one right now (not all of them use pkg-config too).

eglstream will be added later (it hasn't been forgotten, but needs masks because egl-wayland is only available on amd64 and potentially aarch64 later -- also needs testing), will likely use VIDEO_CARDS=nvidia rather than set USE=eglstream though.

Edit: wrt category, I think x11-base is fine, xwayland is still a X11 server.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 25, 2021 1:08 pm    Post subject: Reply with quote

Ionen wrote:
The <=xorg-server-1.20.11 block is because 1.20.11-r1[wayland] does _not_ provide xwayland anymore, so they can co-exist. Ultimately the USE will likely be removed and packages depend on xwayland directly (it's a transition period).


I knew it was transition, but I set it up the way I did so that if they had an older xorg (whatever the reason) they could run with the newer Xwayland.
Or keep xorg-server as a backup (as I've done for the last month or so).

Quote:
The /usr/bin/Xwayland is meant to be temporary I think, many packages still insist on using that one right now.

Yeah, they should start using xwayland.pc since it's being offered now, that would put everyone on the same page. I'm sure it will work out eventually.

Quote:
eglstream will be added later (it hasn't been forgotten, but needs masks because egl-wayland is only available on amd64 and x86), will likely use VIDEO_CARDS=nvidia rather than set USE=eglstream though.


The egl stuff is being merged with gbm (inside wayland gbm/glamor will use egl) so it might be necessary for egl enabled speedups.
It's not just for nvidia, though they were the ones pushing egl all along.

From the meson build
Code:
eglstream_option = get_option('xwayland_eglstream')
if build_xwayland and build_glamor
    eglstream_dep = dependency('wayland-eglstream-protocols', required:false)
    if eglstream_option == 'auto'
        build_eglstream = eglstream_dep.found()
    else
        build_eglstream = eglstream_option == 'true'
        if build_eglstream and not eglstream_dep.found()
            error('glamor EGLStream support requested, but wayland-eglstream-protocols not found')
        endif
    endif
else
    build_eglstream = false
endif

And from the messages I see in the log, when I run it, it's enabled, except for the part of talking to an egl device ie.nvidia card.

Personally I don't care what flags get named to what, I named them on whims of the moment :lol: to be somewhat descriptive.

As far as the category, I don't really care either, but xwayland is not an xserver per se, it's a wayland application, that provides some of the services of xorg-server.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2732

PostPosted: Fri Jun 25, 2021 1:21 pm    Post subject: Reply with quote

Hrm, good point...

I wish the mesa stuff was released so could know where it's going for sure, right now it's still largely a nvidia-only thing.
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2732

PostPosted: Fri Jun 25, 2021 1:29 pm    Post subject: Reply with quote

Anon-E-moose wrote:
As far as the category, I don't really care either, but xwayland is not an xserver per se, it's a wayland application, that provides some of the services of xorg-server.
It is a X server that you communicate with using X11 libraries, much like how Xvfb is a X11 server as well (despite no input/output)
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 25, 2021 1:38 pm    Post subject: Reply with quote

Keep in mind that egl gets built (in mesa) even with my radeon card and no nvidia.

From my understanding, wayland is using some of the functions of the mesa egl code with glamor and gbm so that they can stop using the software renderer (and it's associated slowness)

If wayland sees an nvidia card it uses even more of the egl code, but it uses it either way.

When people complain about slowness, it'll probably be that.

From https://docs.mesa3d.org/egl.html
Quote:
The Mesa’s implementation of EGL uses a driver architecture. The main library (libEGL) is window system neutral. It provides the EGL API entry points and helper functions for use by the drivers. Drivers are dynamically loaded by the main library and most of the EGL API calls are directly dispatched to the drivers.


And from freedesktop org (talking about weston but it's the same with everything wayland related nowadays)
Quote:
Mesa EGL and Mesa Vulkan stacks support Wayland. Weston's hardware acceleration (GL-renderer) depends on EGL GBM platform. Many Wayland applications, including some Weston demos, depend on EGL Wayland platform.

For building Mesa, refer to the upstream build instructions. When configuring Mesa to make the most out of Weston, make sure that OpenGL ES 2 and GBM are enabled, and that EGL platforms includes wayland.

_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 25, 2021 1:41 pm    Post subject: Reply with quote

Ionen wrote:
Anon-E-moose wrote:
As far as the category, I don't really care either, but xwayland is not an xserver per se, it's a wayland application, that provides some of the services of xorg-server.
It is a X server that you communicate with using X11 libraries, much like how Xvfb is a X11 server as well (despite no input/output)


You can try running xwayland without wayland, but I don't think it will work too well. :)
It's truly a bridge that translates X calls to wayland calls, which is why I look at it the way I do.

But this is all just philosophical to me. :)
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Perfect Gentleman
Veteran
Veteran


Joined: 18 May 2014
Posts: 1252

PostPosted: Fri Jun 25, 2021 2:54 pm    Post subject: Reply with quote

With newer xorg-server-1.20.11-r1 & xwayland-21.1.1-r1 I got
Quote:
KWin Window Manager: Xwayland has crashed
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 25, 2021 3:14 pm    Post subject: Reply with quote

Perfect Gentleman wrote:
With newer xorg-server-1.20.11-r1 & xwayland-21.1.1-r1 I got
Quote:
KWin Window Manager: Xwayland has crashed


I do not think that Xwayland with kde will work right now. They use their own modified xwayland server, kwayland server.

I'm also not sure gnome/mutter will work with it either.

That's because both kde and gnome, have taken independent paths. I hear they are working closely with the various wayland people to find a middle ground.
I expect that both kde and gnome will start using Xwayland in the future.

Xwayland isn't that old.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Perfect Gentleman
Veteran
Veteran


Joined: 18 May 2014
Posts: 1252

PostPosted: Fri Jun 25, 2021 3:18 pm    Post subject: Reply with quote

XWayland from xorg-server-1.20.11 works fine with KDE/Plasma/KWin.
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2732

PostPosted: Fri Jun 25, 2021 3:26 pm    Post subject: Reply with quote

Anon-E-moose wrote:
I'm also not sure gnome/mutter will work with it either.
I'll be trying mutter soon'ish given I also want to enable eglstream on it, there's still that in the ebuild (from back when egl-wayland wasn't in the tree):
Code:
-Degl_device=false # This should be dependent on wayland,video_drivers_nvidia, once eglstream support is there
-Dwayland_eglstream=false # requires packages egl-wayland for wayland-eglstream-protocols.pc
Still debating between USE=eglstream or VIDEO_CARDS=nvidia as well for it, gnome project's lead seem to prefer VIDEO_CARDS right now. Can always change it later if it becomes relevant I guess, probably no need to rush for widespread support until it's released and tested if just for a potential small improvement (while for nvidia it's either it works or it doesn't).

For kwin it seems to enable it without using egl-wayland, haven't looked at what it's doing exactly yet.
Edit: haven't tried it with split xwayland yet either, so I can't help with that
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 25, 2021 3:42 pm    Post subject: Reply with quote

Perfect Gentleman wrote:
XWayland from xorg-server-1.20.11 works fine with KDE/Plasma/KWin.


I wonder if it's the way it's called, they changed a few "listen" parameters, but not sure.
The old way is depreciated, but not sure what gets returned from it.

When it's run from 1.20.11, can you do a ps axf -o pid,tty,args and see what cmdline args to xwayland are?

Edit to add: I did a simple test and it's not the listen parms, it does output some verbiage, but it started in my test.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Perfect Gentleman
Veteran
Veteran


Joined: 18 May 2014
Posts: 1252

PostPosted: Fri Jun 25, 2021 3:48 pm    Post subject: Reply with quote

Split Xwayland -
Code:
/usr/bin/Xwayland :0 -displayfd 84 -rootless -wm 94 -auth /run/user/1000/xauth_FxNjio -listenfd 52 -listenfd 60

or
Code:
 ~ $ ps axf -o pid,tty,args | grep -i xwa
32185 tty1                      \_ /usr/bin/kwin_wayland_wrapper --xwayland /usr/lib64/libexec/startplasma-waylandsession
32186 tty1                          \_ kwin_wayland --wayland_fd 4 --xwayland /usr/lib64/libexec/startplasma-waylandsession
 1626 tty1                              \_ /usr/bin/Xwayland :0 -displayfd 101 -rootless -wm 112 -auth /run/user/1000/xauth_FxNjio -listenfd 85 -listenfd 95
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 25, 2021 3:53 pm    Post subject: Reply with quote

Ionen wrote:
Still debating between USE=eglstream or VIDEO_CARDS=nvidia as well for it, gnome project's lead seem to prefer VIDEO_CARDS right now.


If you go with nvidia, then you'll either have to just install the egl stuff or use another USE flag.
Personally, since glamor is pretty useless without the egl speedups, I'd just install them, and worry about nvidia separately.

If I had an nvidia device (and it was supported by nvidia drivers), glamor would see it and send output to it, Xwayland would use it automatically.
Xwayland does have an eglstream parm but that may be old and not used or used to override auto detection. *shrugs*
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Fri Jun 25, 2021 3:59 pm    Post subject: Reply with quote

Perfect Gentleman wrote:
Split Xwayland -
Code:
/usr/bin/Xwayland :0 -displayfd 84 -rootless -wm 94 -auth /run/user/1000/xauth_FxNjio -listenfd 52 -listenfd 60


The parms look good, it doesn't seem to be an improper call to Xwayland.

Something else going on, possibly the way it's built. Which gcc are you using?

Edit to add: when you build xorg-server did you disable the wayland flag?
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum