vibrantLinux icon indicating copy to clipboard operation
vibrantLinux copied to clipboard

Wayland support

Open DavidLapous opened this issue 3 years ago • 18 comments

I don't know if vibrantLinux is supposed to work on wayland, but it is not working on my computer :/. Is wayland support possible or planned ? Thanks for your work.

DavidLapous avatar Sep 15 '20 12:09 DavidLapous

Unfortunately I don't think this is possible. Nvidia has no version of their api that supports Wayland and the other method used for AMD relies on X.

nahla-nee avatar Sep 23 '20 22:09 nahla-nee

After some research about the AMD part I think it's currently not possible, as there is no standard API for our use-case.

If anyone wants to continue research, first of all the code in question belongs to libvibrant. The X11 implementation of the AMD part utilizes (lib-) XRandR and can be found here.

As XRandR just exposes the Linux DRM properties CTM (from the CRT Controller/CTRC) to us, we just need a way to access those properties on various Wayland implementations. The closest "standard" API I could find was this implementation in (GNOME) Mutter. I couldn't find anything in Weston nor wlroots. I also could not find anything in KWin (though, that might be because I don't really know it's structure).

If anyone continues / wants to continue research, I would be happy to talk with you. You can find contact information on my website

Scrumplex avatar Dec 15 '20 19:12 Scrumplex

I'm sorry to necro this, but this is one of the first results that google returns when searching for "vibrance wayland".

In my case, if you use vibrantLinux on X11 and then log out and boot up Wayland, the saturation levels are somewhat mantained, so there must be a way to directly change the saturation on Wayland.

miermontoto avatar Jun 14 '22 06:06 miermontoto

I was playing around with this a few months ago and it might be possible, yes. Though it will probably require root privileges. I can look at this again. Maybe I can get this running

Scrumplex avatar Jun 14 '22 08:06 Scrumplex

Thanks. I lack the technical knowledge to but if I can be of any help hit me up.

miermontoto avatar Jun 14 '22 22:06 miermontoto

I just tried doing this, and it seems hard to do yet again. I am not sure if there will be a way to do this in the future, without compositor-specific support. Not sure if that's viable, but it might be possible to use something like gamescope to achieve something like this. I don't know much about gamescope's codebase though. But maybe someone else can take this idea as an opportunity to work on this

Scrumplex avatar Jun 15 '22 20:06 Scrumplex

In my case, if you use vibrantLinux on X11 and then log out and boot up Wayland, the saturation levels are somewhat mantained, so there must be a way to directly change the saturation on Wayland.

This doesn't work with AMD cards. I was hoping it to work since CSGO run way smoother on Wayland than on X11.

bunkbail avatar Jul 04 '22 03:07 bunkbail

Just leaving this as an idea: if your game can use Vulkan, you can use vkbasalt alongside a shader that does the same thing as vibrantLinux. CSGO can be used through zink to run it as Vulkan, but the performance still leaves much to be desired.

bunkbail avatar Jul 04 '22 03:07 bunkbail

This doesn't work with AMD cards.

I'm running a 6900XT.

if your game can use Vulkan

my problem is that my screen isn't properly tuned, so colors look really muted, it isn't game-specific.

miermontoto avatar Jul 07 '22 21:07 miermontoto

Hi! Almost a year has gone by, and maybe by now it is not too hard to implement this? Are there any updates? It would be wonderful.

xplosionmind avatar May 28 '23 12:05 xplosionmind

Since then I have implemented this for the Steam Deck using vibrantDeck. The only technical requirement for it is really only Gamescope with the DRM backend (i.e. it only works if you run Gamescope as your primary compositor, not as a nested compositor).

No other Wayland compositor has a similar interface to Gamescope's so even a year later, this is still not possible to do.

I personally use Sway so if there is enough interest I can try to implement some interface for Sway. Though I can't guarantee that it will be merged upstream.

Scrumplex avatar May 28 '23 12:05 Scrumplex

@Scrumplex Hello! Would it be possible to make something like a "vibrantscope", similar to vibrantDeck, to run games and apply the digital vibrance setting via Valve's gamescope on desktop Linux?

Forgive me for my possible lack of understanding, but from the looks of it, it's not possible to use vibrantDeck on the desktop easily.

Thanks in advance.

Tiagoquix avatar Mar 11 '24 08:03 Tiagoquix

vibrantDeck only works if gamescope is running as the primary compositor. It sadly will not work when it's running in nested mode

Scrumplex avatar Mar 11 '24 09:03 Scrumplex

I think it might be possible to use reshade to achieve what vibrantLinux does on a per-game basis. Gamescope also has a reshade interface now, so you might be able to get something working with it. But I don't know anything about writing shaders :(

Scrumplex avatar Mar 11 '24 09:03 Scrumplex

vibrantDeck only works if gamescope is running as the primary compositor. It sadly will not work when it's running in nested mode

So for vibrantDeck to work on desktop Linux basically it wouldn't be possible since the compositor is either X11 or Wayland, right?

Also, maybe there is a new way to implement vibrantDeck for the nested mode? Or maybe through XWayland?

I think it might be possible to use reshade to achieve what vibrantLinux does on a per-game basis. Gamescope also has a reshade interface now, so you might be able to get something working with it. But I don't know anything about writing shaders :(

That wouldn't be good since some anti-cheats (such as VAC) don't allow ReShade. Maybe vkBasalt could work, but I'm not sure. Either way, it would be a vibrance effect, and not really the digital vibrance.

Tiagoquix avatar Mar 11 '24 09:03 Tiagoquix

So for vibrantDeck to work on desktop Linux basically it wouldn't be possible since the compositor is either X11 or Wayland, right?

vibrantDeck won't work on X11, yes. Wayland is just a protocol, so it depends on the implementation here. Gamescope is a Wayland compositor that exposes some color management options that we make use of in vibrantDeck. I don't know about any other compositor that exposes these options.

Also, maybe there is a new way to implement vibrantDeck for the nested mode? Or maybe through XWayland?

Not really. Gamescope uses properties in the display driver using DRM. A nested window can not do that, as it's not the DRM master.

In other words, Gamescope can only set these values for a display output, not for a region on the screen.

Either way, it would be a vibrance effect, and not really the digital vibrance.

It's the same thing ^^

All the GPU driver does is transform the RGB values. Your display won't show you new colors with vibrantLinux/vibrantDeck. It's really just a color transformation and a (reshade) shader should be able to do the same thing, but on a graphics level instead of a driver level.

Edit: You might be able to run your game in Gamescope and use reshade in gamescope. That wouldn't really tamper with the game itself, so it should pass anti cheats. See gamescope#Reshade-support

Scrumplex avatar Mar 11 '24 09:03 Scrumplex

@Scrumplex Hey, what about this? https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1356

Tiagoquix avatar Mar 20 '24 17:03 Tiagoquix

Wayland color-management protocol is primarily intended for managing different color spaces on Wayland. You might be able to use this protocol to apply a custom color space using Gamescope, but I don't think this use-case is supported yet. Note that the protocol that was merged in Weston isn't merged into mainline wayland-protocols yet. https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/14/

Scrumplex avatar Mar 20 '24 20:03 Scrumplex