Wayland

All Linux talk goes here. Technical talk. No Distro politics, please use the "General" forum for that
User avatar
Naib
Site Admin
Posts: 939
Joined: Sat Dec 19, 2020 2:20 am

Re: Wayland

Post by Naib »

A bit more tweaking. The NWG stuff looks really interesting but damn are the build-scripts non-portage friendly... I have settled for custom/foo on waybar for my common applications (terminal, browser, thunar, jupyter,kicad) and I use nwg-launchers for menu.

Image
The best argument against democracy is a five-minute conversation with the average voter

Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
User avatar
antae
Director of Sandbags
Posts: 445
Joined: Sat Dec 19, 2020 8:49 am

Re: Wayland

Post by antae »

I text to people in different languages, and I have to switch keyboard layout all the time I switch to another chat window.
That's really boring to press the kbd layout keybinding during all the day.
I asked a question on Wayfire issue tracker, and guys gave me a few hints regarding which signal to use and what thing handles the keyboard state.
I thought that creating a plugin for Wayfire is something difficult, but I wrote it in a half of a day.
For those who are interested in a such functionality or wants to start writing a plugin, I share the code here wayfire kbdd plugin.
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
User avatar
otw-refugee
Director of Sandbags
Posts: 571
Joined: Fri Dec 18, 2020 12:01 pm
Location: Dallas area

Re: Wayland

Post by otw-refugee »

Nice job on the plugin *two thumbs up*
Understanding is a three edged sword: your side, their side, and the truth.

Local portage repo, opentmpfiles copy
List of wayland apps/compositors
User avatar
Naib
Site Admin
Posts: 939
Joined: Sat Dec 19, 2020 2:20 am

Re: Wayland

Post by Naib »

So I have been using wayland (wayfire) as my daily driver for the last month and sure it "works" but it is still quite a WIP but definitely usable.

The typical reason I hear why people use it is "its faster, its smoother" ... as someone that used Openbox for like 10years, then AwesomeWM, I was already using a light WM to provide as much resource for my renders/simulations/games so I honestly cannot say whether Wayland or X11 is faster/Smooth. Sure if you are a GNOME user I can easily believe the wayland variant is faster.

AwesomeWM -> Sway+Waybar... it's a windowmanager and it's more down to their philosophy which is agnostic to the backend. I still REALLY miss the dynamic tiling nature of AwesomeWM so either sway-floating offers it or rivers will.

The biggests issues right now are

1) Nvidia - just don't, really... When the 470 series drivers came out, when Xwayland was updated, when mesa was as well it was touted to be "as good as". No it is not. Seriously no end of problems, ridiculous performance issues. I switched to AMD for other reasons and there is a night and day difference

2) Still buggy as hell. Wayland and dpms power off will cause libwayland-server.so to segfault
[ 2447.772315] sway[4177]: segfault at 8 ip 00007f78f042814b sp 00007ffe581797b8 error 6 in libwayland-server.so.0.1.0[7f78f0421000+8000]
. I might disable this aspect of swayidle to stop this from occurring. This occurs with wayfire, hakari and does not occur with X11...

3) Xwayland is a poor substitute. They went in with providing a X11 compatibility layer but then they insisted on the "security" mindset without considering how X11 applications work, which means launching say gvim once you su - does not work due to MIT-MAGIC-COOKIE-1. is it insecure? sure but i don't care when this is a single-seat machine. Likewise is it incomplete. FreeCAD, the appimage will not run, it segfaults when attempting to launch using Xwayland. FreeCAD dev's now have a milestone goal of Wayland native. If Xwayland is meant to be X11 under wayland, why is this a thing? Something fundamental is missing and sure for FOSS applications they can "port" but what about closed-source? If some large CAD software does not operate via Xwayland you can bet your bottom dollar they will refused to support a distro that defaults to Wayland or does anything stupid (EXACTLY what Ansys did with their suite, they pulled CentOS support) so if you need to use said software what are you going todo?
Right now I have not really tested many close-source outside of Games, Matlab, Ansys-Maxwell (yes this does work), Modelsim but there is bound to be something.
Then there is the entire xforwarding via ssh.. Yes there is a "WIP" for wayland as you cobble together other applications, but what about X11 applications?
What about FOSS software that just do not want to rewrite? gvim does not want to, awesomeWM do not want to and while gvim does work via Xwayland, awesomeWM does not and thus this project is going to enter into some form of caretaker mode at some point soon and then die (if wayland projections that x11 is dead come true). How many more FOSS applications are like this and all because Xwayland is not X11-on-wayland.

aside from that meh :) it works, as long as what you do is what wayland devs think you should do
The best argument against democracy is a five-minute conversation with the average voter

Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
User avatar
otw-refugee
Director of Sandbags
Posts: 571
Joined: Fri Dec 18, 2020 12:01 pm
Location: Dallas area

Re: Wayland

Post by otw-refugee »

Though I use wayfire, and it's fine (I've shut off almost all "animations") for my usage.
I did have problems with dpms and wayfire (and who knows, throw wlroots and wayland into the mix, not sure who to blame)
But many problems went away when I started using the git versions (wlroots, wayfire and Xwayland) sparsely.

Dpms problem, would turn off but not come back, you could tell the screen was "alive" but nothing was displayed ... then after awhile I found out it was the wallpaper app (using wf-shell at the time). Manually turning off the monitor and turning it back on worked fine. :roll: Go figure.

But what I'm waiting on for me, is an openbox clone labwc, I don't use it daily but it's coming along nicely though still a WIP. :lol:

Don't know what to say about nvidia, I expect that wayland and xwayland will need more work with Nvidia, before it gets better, but my nvidia cards are all on the shelf. ;)

I've added the -auth option to Xwayland to avoid the "doesn't work for su" crap.
Since it's wlroots that starts Xwayland, I found a way to add a few more options than they have, I expect that they will eventually have to have a way for the end user to pass the flags they need.
Anyway, the script I use to start wayland is just bash, so before I call the compositor, I set an env vars which last for the lifetime of the session.

Code: Select all

export WLR_XWAYLAND="/home/don/bin/Xwayland.sh"
which lets me tell it where to find the "xwayland binary" but in my case it's a shell script that then starts off Xwayland with modified parms.

Code: Select all

$ cat bin/Xwayland.sh 
#!/bin/sh

authfile=$HOME/.Xauthority 

exec /usr/bin/Xwayland -dpi 163 -auth $authfile "$@"
so I grab all the options being passed to "Xwayland" add my own and the push it out. Solves the security/auth problem.
I've successfully started X apps on my laptop running straight X, into an Xwayland session.

I know that wayland has it's teething problems, but there is no new development in the X world as far as I can tell.
Understanding is a three edged sword: your side, their side, and the truth.

Local portage repo, opentmpfiles copy
List of wayland apps/compositors
User avatar
Naib
Site Admin
Posts: 939
Joined: Sat Dec 19, 2020 2:20 am

Re: Wayland

Post by Naib »

I get they say "X is dead" but those declaring it is dead are the same ones that are choosing not to develop for it as they are choosing to develop Wayland only

Fact is, it isn't dead and will never be dead. It won't progress, won't be purely developed BUT it will be supported by Xwayland and that is where my biggest disappointment in their behaviour lies. Xwayland should be orders or magnitude better and their focus should have been on this

All x11 applications (short of those network access ones I guess) should Just work(TM) otherwise they have fail and FreeCAD is my poster boy of them failing. This isn't some closed source application, this is a really good actively developed mCAD FOSS application and it does not work and the git HEAD does not work.

I am waiting for labwc as it does sound a viable replacement but for now floating sway is good enough
The best argument against democracy is a five-minute conversation with the average voter

Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
User avatar
otw-refugee
Director of Sandbags
Posts: 571
Joined: Fri Dec 18, 2020 12:01 pm
Location: Dallas area

Re: Wayland

Post by otw-refugee »

Curious as to how you start freeCAD, and whether it is running as wayland or Xwayland.

If you start freecad as "QT_QPA_PLATFORM=xcb <freecad binary>" does it work then (this forces it into X mode)?

This option QT_QPA_PLATFORM=wayland will force to use wayland (native)

What version of QT are you using?

Note: as an aside, running a 4k monitor I've had to provide several env vars to make qt look ... um, nicer. :roll:
# -------------- QT
export QT_QPA_PLATFORM=wayland
export QT_QPA_PLATFORMTHEME=qt5ct
# export QT_QPA_PLATFORM=xcb
export QT_AUTO_SCREEN_SCALE_FACTOR=0
# export QT_SCALE_FACTOR=1
# export QT_SCREEN_SCALE_FACTORS
#export QT_FONT_DPI=163
export QT_FONT_DPI=200
export QT_AUTO_SCREEN_SET_FACTOR=0

don't get me started on gnome's crap ~le sigh~

Edit to add: I don't use freecad, so just googling, but the 19 version is relatively new (mar 2021), and there are reports of it not working with the latest ubuntu and straight wayland under plasma. But hard to say where the problem lies, it might not be freecad per se, but the underlying libs, etc.
Understanding is a three edged sword: your side, their side, and the truth.

Local portage repo, opentmpfiles copy
List of wayland apps/compositors
User avatar
Naib
Site Admin
Posts: 939
Joined: Sat Dec 19, 2020 2:20 am

Re: Wayland

Post by Naib »

you are right is it a dependency of FreeCAD rather than freeCAD itself and the main problem is Coin3D. Qt was the other big one but that was resolved with 5.12.
Coin3D needs to be hacked to make it work in Wayland and this is partially why "official" wayland support is slated for 0.20.
The reason the 0.19 isn't working on Ubuntu is partially down to the OCC library, this is causing havok for Kicad (5.1.10 and nightly) and there is always complaints on the forum/irc/discord about this... one benefit of Gentoo :)

Presently I use the appimage (the 0.20 weekly build) but this doesn't have the needed fixes and this makes sense as it is an upstream issue. I presently can't build Freecad on Gentoo due to OpenSCAD not building, this is one of those -m32 issues I mentioned in the other thread (GEM really have fked up here...)

I have a workaround for FreeCAD, either use my work win10 machine or launch Xorg+AwesomeWM, this was just a casepoint that if Xwayland really did provide X11 over wayland such hacking would not be needed.
The best argument against democracy is a five-minute conversation with the average voter

Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
saellaven
Bride Kidnapping Expert
Posts: 339
Joined: Fri Dec 18, 2020 10:15 pm

Re: Wayland

Post by saellaven »

otw-refugee wrote: Mon Oct 11, 2021 11:52 pm I know that wayland has it's teething problems, but there is no new development in the X world as far as I can tell.
X is still getting minor enhancements... and I have yet to run into any issues with X being too old. Maybe X is just mature software and doesn't need much other than bug fixes.

Wayland is fundamentally broken until it can do network forwarding, at least in my case. So, it's broken out of the box and it's pointless to even try it, specifically because they foolishly built it without network transparency in mind. If they want to dislodge X, they need to provide something better, not something that doesn't even have feature parity.

The "X is dead" people are the same people that shout that "non-systemd is dead." They're apostles and advocates, not realists.
Leonardo.b
Sanitation Engineer
Posts: 29
Joined: Mon Mar 29, 2021 2:24 pm

Re: Wayland

Post by Leonardo.b »

Out of curiosity, can a Wayland compositor upgrade itself in-place?
User avatar
antae
Director of Sandbags
Posts: 445
Joined: Sat Dec 19, 2020 8:49 am

Re: Wayland

Post by antae »

Leonardo.b wrote: Wed Oct 13, 2021 12:23 pmOut of curiosity, can a Wayland compositor upgrade itself in-place?
If I understand correctly, the question can be paraphrased to "Can a linux process upgrade itself inplace?", which IMO is a question of implementation.
I know Fluxbox (x11 thing) has a restart option in menu, and windows do not disappear if pressed, AFAIK sway (wayland thing) has a reload option but it is better if sway users tell here. Wayfire can enable\disable plugins (most of the new functionality is provided via plugins) on the fly.
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
User avatar
Naib
Site Admin
Posts: 939
Joined: Sat Dec 19, 2020 2:20 am

Re: Wayland

Post by Naib »

Exactly.
Even if aspects of it were to implement some in-place upgrade, there will be a part that can't.

This is equivalent to asking "can a running kernel be upgraded in-place". For a very long time the answer was NO ... an in-use process that is required for continued operation cannot replace itself without destroying itself and thus bringing down the system

These days the answer is "NO, except" ... parts of the kernel can be upgraded in-place via Ksplice.


Same goes for Wayland... right now the answer is NO. Maybe some compositor will enable in-place partial update but who knows
The best argument against democracy is a five-minute conversation with the average voter

Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
User avatar
otw-refugee
Director of Sandbags
Posts: 571
Joined: Fri Dec 18, 2020 12:01 pm
Location: Dallas area

Re: Wayland

Post by otw-refugee »

Not exactly hard to hit quit and then restart :lol:
Understanding is a three edged sword: your side, their side, and the truth.

Local portage repo, opentmpfiles copy
List of wayland apps/compositors
Leonardo.b
Sanitation Engineer
Posts: 29
Joined: Mon Mar 29, 2021 2:24 pm

Re: Wayland

Post by Leonardo.b »

Ok, thanks for the info.

Yep, I doubt it would be an useful feature.
User avatar
antae
Director of Sandbags
Posts: 445
Joined: Sat Dec 19, 2020 8:49 am

Re: Wayland

Post by antae »

Today tested that my NVIDIA Optimus card works in Wayfire.
x11-drivers/nvidia-drivers-470.63.01
Works good, with one problem: if laptop felt into sleep, it will be stuck on resume, the screen is bright, it shows wallpaper, but nothing happens there, and keyboard does not work at all, all keyboard LEDs are frozen. Hard reset helps. No idea how to debug this yet.

A bit of setup details:
media-libs/libglvnd is installed
Add nvidia into make.conf/VIDEO_CARDS
emerge -uDN @world
Run __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo – it will show NVIDIA card.
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
User avatar
otw-refugee
Director of Sandbags
Posts: 571
Joined: Fri Dec 18, 2020 12:01 pm
Location: Dallas area

Re: Wayland

Post by otw-refugee »

are you running systemd with the nvidia?
Understanding is a three edged sword: your side, their side, and the truth.

Local portage repo, opentmpfiles copy
List of wayland apps/compositors
User avatar
antae
Director of Sandbags
Posts: 445
Joined: Sat Dec 19, 2020 8:49 am

Re: Wayland

Post by antae »

otw-refugee wrote: Mon Oct 18, 2021 2:52 pmare you running systemd with the nvidia?
OpenRC.
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
User avatar
otw-refugee
Director of Sandbags
Posts: 571
Joined: Fri Dec 18, 2020 12:01 pm
Location: Dallas area

Re: Wayland

Post by otw-refugee »

It looks like nvidia provides a sleep module that might be behind this. Not sure what is laid down by nvidia drivers these days.
Mostly I saw systemd/elogind having problems but there was one mention from an openrc person.

I googled "nvidia 470 wayland suspend problem openrc" and found several responses.
Understanding is a three edged sword: your side, their side, and the truth.

Local portage repo, opentmpfiles copy
List of wayland apps/compositors
User avatar
antae
Director of Sandbags
Posts: 445
Joined: Sat Dec 19, 2020 8:49 am

Re: Wayland

Post by antae »

Thanks, googling gave me an idea that unit files may contain some additional thing.
In NVIDIA-Linux-x86_64-470.63.01/systemd/nvidia-sleep.sh I see they juggle with /proc/driver/nvidia/suspend
Will try to test it later.
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
User avatar
marcih
Pornography Historian
Posts: 77
Joined: Fri Feb 12, 2021 12:54 pm
Location: I have no idea what location is or does, sorry.

Re: Wayland

Post by marcih »

Remind me to report back in 2023/2024 when Debian 12 Bookworm releases with versions of XWayland and nvidia-drivers that have working hardware acceleration. Maybe it'll be useable by then? Year Of The Wayland Desktop.
Bones McCracker wrote:It wouldn't be so bad, if it didn't suck.
Post Reply