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

Custom video modes using wlr-randr don't work correctly #2379

Closed
vanfanel opened this issue Jun 15, 2024 · 11 comments · Fixed by #2383
Closed

Custom video modes using wlr-randr don't work correctly #2379

vanfanel opened this issue Jun 15, 2024 · 11 comments · Fixed by #2383
Labels
Milestone

Comments

@vanfanel
Copy link

vanfanel commented Jun 15, 2024

Describe the bug
In other wlroots-based compositors (Sway, Labwc), I can do for example:

wlr-randr --output HDMI-A-1 --custom-mode 1920x1080@70

...and a new ~70Hz video mode is created and used succesfully, which can be confirmed by simply looking at 70Hz content (DOS games in my case) and looking at subsequent wlr-randr runs where 1920x1080@70.0000 appears as the mode in use.

Even 40Hz, 54Hz, 58Hz... every custom refresh rate I want is correctly used on a custom video mode in these compositors.

However, this fails in Wayfire: apparently, wlr-randr succeeds, but then it's always using a 143.766006Hz mode.
It doesn't seem to matter if I try to create and use a 70Hz mode, a 40Hz mode... it always ends up using a 1920x1080@143.766006Hz mode, which is the second non-custom mode supported by my monitor.

That's not right: custom modes should be supported, no matter how crazy they are, because they are truly useful for legacy content.

To Reproduce
Steps to reproduce the behavior:

  1. Try to define a custom mode using wlr-randr. For example:
    wlr-randr --output HDMI-A-1 --custom-mode 1920x1080@70

  2. Run wlr-randr again without any parameters, and observe the mode in use does not match the mode we just tried to enforce, but one of the EDID-reported modes of the monitor is used instead.

Expected behavior
The custom mode should be in use.

Wayfire version
0.8.1 and git both show this behavior. Other WLRoots-based compositors (Sway, Labwc) work as expected in this regard.

@vanfanel vanfanel added the bug label Jun 15, 2024
@ammen99
Copy link
Member

ammen99 commented Jun 15, 2024

Have you tried configuring the custom mode in your config file?

@vanfanel
Copy link
Author

Have you tried configuring the custom mode in your config file?

Yes, latest GIT Wayfire it won't even try to set the video mode if it's a custom video mode.
(EDID-reported video modes are set normally, as soon as wayfire.ini is saved).

@soreau
Copy link
Member

soreau commented Jun 15, 2024

Have you tried configuring the custom mode in your config file?

Yes, latest GIT Wayfire it won't even try to set the video mode if it's a custom video mode. (EDID-reported video modes are set normally, as soon as wayfire.ini is saved).

Have you tried setting custom_mode_N or just mode?

@vanfanel
Copy link
Author

vanfanel commented Jun 15, 2024

@soreau Adding custom modelines on the .ini and then setting them on the same file works. Also, setting them via wlr-randr after having added them as custom modelines works.
But all my scripts rely on wlr-randr being able to set the video modes, and there are dozens of them too, so being able to use wlr-randr to add & set the video modes via the --custom-mode parameter (as in other wlroots-based compositors) is needed.

@ammen99

I added this in wayfire.ini:

[workarounds]

use_external_output_configuration = true

But still, something like wlr-randr --output HDMI-A-1 --custom-mode 1920x1080@70 doesn't work with Wayfire.

@soreau
Copy link
Member

soreau commented Jun 15, 2024

If you run wayfire with -d, do you see any interesting messages in wayfire log when you try to set the mode?

@vanfanel
Copy link
Author

vanfanel commented Jun 15, 2024

@soreau

If I do this:
wlr-randr --output HDMI-A-1 --custom-mode 1920x1080@70

I see this on the console that I used to launch wayfire -d:

II 15-06-24 23:01:19.052 - [backend/drm/drm.c:786] connector HDMI-A-1: Modesetting with 1920x1080 @ 60.000 Hz
EE 15-06-24 23:01:19.071 - [backend/drm/drm.c:799] connector HDMI-A-1: Failed to page-flip output: a page-flip is already pending
EE 15-06-24 23:01:19.071 - [src/output/render-manager.cpp:364] Output commit failed!

Everytime I run the aforementioned wlr-randr command with those parameters, the same messages appear.

@AgostinoA
Copy link

AgostinoA commented Jun 18, 2024

In my case with the latest GIT Wayfire setting wlr-randr --output eDP-1 --custom-mode 1920x1080@60, works.

Before
wlr-randr
eDP-1 "Samsung Display Corp. 0xA029 (eDP-1)"
Make: Samsung Display Corp.
Model: 0xA029
Serial: (null)
Physical size: 340x190 mm
Enabled: yes
Modes:
3840x2160 px, 60.000000 Hz (preferred, current)
Position: 0.0
Transform: normal
Scales: 2.000000
Adaptive Sync: disabled

After
wlr-randr
eDP-1 "Samsung Display Corp. 0xA029 (eDP-1)"
Make: Samsung Display Corp.
Model: 0xA029
Serial: (null)
Physical size: 340x190 mm
Enabled: yes
Modes:
3840x2160 px, 60.000000 Hz (preferred)
1920x1080 px, 60.000000 Hz (current)
Position: 0.0
Transform: normal
Scale: 1.000000
Adaptive Sync: disabled

@ammen99 ammen99 added this to the 0.10 milestone Jun 19, 2024
@vanfanel
Copy link
Author

In my case with the latest GIT Wayfire setting wlr-randr --output eDP-1 --custom-mode 1920x1080@60, works.

Before wlr-randr eDP-1 "Samsung Display Corp. 0xA029 (eDP-1)" Make: Samsung Display Corp. Model: 0xA029 Serial: (null) Physical size: 340x190 mm Enabled: yes Modes: 3840x2160 px, 60.000000 Hz (preferred, current) Position: 0.0 Transform: normal Scales: 2.000000 Adaptive Sync: disabled

After wlr-randr eDP-1 "Samsung Display Corp. 0xA029 (eDP-1)" Make: Samsung Display Corp. Model: 0xA029 Serial: (null) Physical size: 340x190 mm Enabled: yes Modes: 3840x2160 px, 60.000000 Hz (preferred) 1920x1080 px, 60.000000 Hz (current) Position: 0.0 Transform: normal Scale: 1.000000 Adaptive Sync: disabled

Does wlr-randr show 1920x1080@60 among the supported modes if you run it on a fresh boot without any parameters?

@ammen99
Copy link
Member

ammen99 commented Jun 19, 2024

@vanfanel Try #2383

@vanfanel
Copy link
Author

@vanfanel Try #2383

That works absolutely perfect, thus fixing this issue! :)

xiaohuirong added a commit to xiaohuirong/wayfire that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants