tuxedocomputers / tuxedo-control-center

A tool to help you control performance, energy, fan and comfort settings on TUXEDO laptops.
GNU General Public License v3.0
519 stars 68 forks source link

"Set refresh rate on profile activation" option not available in Wayland #384

Open gabriel-eladi opened 6 months ago

gabriel-eladi commented 6 months ago

System Information:

Operating System: TUXEDO OS 3 KDE Plasma Version: 6.0.4 KDE Frameworks Version: 6.1.0 Qt Version: 6.7.0 Kernel Version: 6.5.0-10036-tuxedo (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 7840HS w/ Radeon 780M Graphics Memory: 25.2 GiB of RAM Graphics Processor: AMD Radeon Graphics Manufacturer: TUXEDO Product Name: TUXEDO Pulse 14 Gen3 System Version: Version 1.0

Issue:

I recently upgraded to Plasma 6 on my TuxedoOS and switched to Wayland. I noticed that the "Set refresh rate on profile activation" option on TCC profiles is not available in Wayland. I checked to see if this is a Wayland issue or Plasma 6 issue, and it appears to be a Wayland issue as the option is present and works fine on X11 with Plasma 6.

It was a great feature to have that helped with battery life, and I miss it on Wayland. I wish to know if this is a bug/unimplemented feature with the current version of TCC, or just a limitation of Wayland (it would be a shame if it's the latter).

tl;dr: can't set custom refresh rate on TCC profile activation on Wayland but can on X11.

tuxedoder commented 6 months ago

This is intentional since xrandr does only work in x11. There currently is no refresh rate option for wayland. Not sure if and when support will be added.

gabriel-eladi commented 6 months ago

That is unfortunate. Thanks for the answer.

gabriel-eladi commented 6 months ago

After some reading I found that Plasma has a utility called kscreen-doctor that implements some of the features of xrandr, most notably for this context, it can change the display refresh rate using a command.

I managed to change my display's refresh rate to 120Hz with kscreen-doctor output.eDP-1.mode.0 (mode.0 being 2880x1800@120) and back to 60Hz with kscreen-doctor output.eDP-1.mode.1 (mode.1 being 2880x1800@60).

It's also possible to read the information about all available modes with kscreen-doctor --json, to change the refresh rate for other resolutions as well, which seems like just what is needed for this missing feature.

Apparently wl-roots and GNOME also have similar tools with wlr-randr and gnome-randr respectively (reference) but I haven't checked what they can do yet.

If you deem this feature feasible to implement on Wayland, I can reopen this issue as a feature request (or add a new issue as a feature request).

tuxedoder commented 6 months ago

I would need to do more research, but the problem seems that it maybe would require a different approach for different desktop environments. It would also be good if all approaches would also work on all the linux distributions we support. Having more dependencies is also something I try to avoid. These requirements add quite the complexity. I will just leave this issue open for now, but it would be easier to support this feature if there would exist an all in one solution that works everywhere like xrandr was.