Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland support #27

Open
DavidLapous opened this issue Sep 15, 2020 · 18 comments
Open

Wayland support #27

DavidLapous opened this issue Sep 15, 2020 · 18 comments

Comments

@DavidLapous
Copy link

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.

@nahla-nee
Copy link
Member

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.

@Scrumplex
Copy link
Member

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

@miermontoto
Copy link

miermontoto commented Jun 14, 2022

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.

@Scrumplex
Copy link
Member

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 Scrumplex reopened this Jun 14, 2022
@miermontoto
Copy link

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

@Scrumplex
Copy link
Member

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

@bunkbail
Copy link

bunkbail commented Jul 4, 2022

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
Copy link

bunkbail commented Jul 4, 2022

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.

@miermontoto
Copy link

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.

@xplosionmind
Copy link

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.

@Scrumplex
Copy link
Member

Scrumplex commented May 28, 2023

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.

@Tiagoquix
Copy link

Tiagoquix commented Mar 11, 2024

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

@Scrumplex
Copy link
Member

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

@Scrumplex
Copy link
Member

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 :(

@Tiagoquix
Copy link

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.

@Scrumplex
Copy link
Member

Scrumplex commented Mar 11, 2024

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

@Tiagoquix
Copy link

@Scrumplex
Copy link
Member

Scrumplex commented Mar 20, 2024

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants