alex-courtis / way-displays

way-displays: Auto Manage Your Wayland Displays
MIT License
241 stars 12 forks source link

application stuck in loop & 100% cpu #33

Closed 0x0013 closed 1 year ago

0x0013 commented 2 years ago

Hi, thanks for this application.

I am trying to get it working with a Framework laptop connected to two 1440p displays via Thunderbolt3 dock. It worked as expected at first. I played around with some scaling settings in cfg and so on. Then I connected the displays to the dock, one by one, and they also worked as expected, and closing the lid disabled the internal display.

However, then I tried to change the refresh rate. One display auto-selected ~144hz by default, and the other ~100hz, so I wanted to experiment and try 144 or 120hz on the other. Now, there might be some incompatibility between this high refresh rate through the dock, or maybe the HDMI connection, but i still wanted to experiment. Once I saved the config, the all system got very slow, fans spun up and from what I could tell, the CPU was 100% loaded. In logs I see that the program is failing to set some modes, and then falls back to the preferred mode, and reports (no mode) on this display, but at the same time reports that the mode is changed successfully. This happens many times per second.

Worth noting that during this, even though it reported (no mode), both external displays were still working, and I could successfully open terminals on either of them (though they were near unusable, as you would expect with an overloaded cpu). During this problem, I was able to change the cfg file to attempt removing the custom mode/refresh setting, but that did not help.

This went on until I unplugged the dock with the displays. A similar behaviour happened later when I powered off/on the dock (after clean PC restart), without playing with the config settings, but I did not save the log from that time.

While it's possible that this was caused by some incompatibility between dock/display, I think the program should not cause a never-ending cpu overloaded loop in any cases.\

Attaching partial log from when the issue started (full log is ~45k lines)

I [21:30:11] DP-5 Arrived:
I [21:30:11]   info:
I [21:30:11]     name:     'DP-5'
I [21:30:11]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
I [21:30:11]     width:    700mm
I [21:30:11]     height:   390mm
I [21:30:11]     dpi:      93.34 @ 2560x1440
I [21:30:11]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [21:30:11]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [21:30:11]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [21:30:11]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [21:30:11]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [21:30:11]     mode:     2560 x 1440 @ 144 Hz  143,999 mHz
I [21:30:11]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [21:30:11]     mode:     2560 x 1440 @ 100 Hz   99,946 mHz (preferred)
I [21:30:11]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [21:30:11]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [21:30:11]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [21:30:11]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [21:30:11]     mode:     1680 x 1050 @  60 Hz   59,883 mHz
I [21:30:11]     mode:     1600 x  900 @  60 Hz   60,000 mHz
I [21:30:11]     mode:     1280 x 1024 @  75 Hz   75,025 mHz
I [21:30:11]     mode:     1280 x 1024 @  60 Hz   60,020 mHz
I [21:30:11]     mode:     1280 x  800 @  60 Hz   59,910 mHz
I [21:30:11]     mode:     1280 x  720 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [21:30:11]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [21:30:11]     mode:     1024 x  768 @  75 Hz   75,029 mHz
I [21:30:11]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [21:30:11]     mode:      800 x  600 @  75 Hz   75,000 mHz
I [21:30:11]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [21:30:11]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [21:30:11]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [21:30:11]     mode:      640 x  480 @  75 Hz   75,000 mHz
I [21:30:11]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [21:30:11]   current:
I [21:30:11]     scale:    1.000
I [21:30:11]     position: 1504,0
I [21:30:11]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [21:30:11] 
I [21:30:11] eDP-1 Changing:
I [21:30:11]   from:
I [21:30:11]     scale:    1.500
I [21:30:11]     position: 0,0
I [21:30:11]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [21:30:11]   to:
I [21:30:11]     position: 0,437
I [21:30:13] 
I [21:30:13] DP-6 Arrived:
I [21:30:13]   info:
I [21:30:13]     name:     'DP-6'
I [21:30:13]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
I [21:30:13]     width:    700mm
I [21:30:13]     height:   390mm
I [21:30:13]     dpi:      93.34 @ 2560x1440
I [21:30:13]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [21:30:13]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [21:30:13]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [21:30:13]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [21:30:13]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [21:30:13]     mode:     2560 x 1440 @ 144 Hz  143,933 mHz (preferred)
I [21:30:13]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [21:30:13]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [21:30:13]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [21:30:13]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [21:30:13]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [21:30:13]     mode:     1280 x  720 @  60 Hz   60,000 mHz  59,940 mHz
I [21:30:13]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [21:30:13]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [21:30:13]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [21:30:13]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [21:30:13]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [21:30:13]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [21:30:13]   current:
I [21:30:13]     scale:    1.000
I [21:30:13]     position: 1504,0
I [21:30:13]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
W [21:30:13] 
W [21:30:13] WARNING: Changes cancelled, retrying
I [21:31:59] 
I [21:31:59] Lid closed
I [21:31:59] 
I [21:31:59] eDP-1 Changing:
I [21:31:59]   from:
I [21:31:59]     scale:    1.500
I [21:31:59]     position: 0,0
I [21:31:59]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [21:31:59]     (lid closed)
I [21:31:59]   to:
I [21:31:59]     (disabled)
I [21:31:59] 
I [21:31:59] DP-5 Changing:
I [21:31:59]   from:
I [21:31:59]     scale:    1.000
I [21:31:59]     position: 4064,0
I [21:31:59]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [21:31:59]   to:
I [21:31:59]     position: 0,0
I [21:31:59] 
I [21:31:59] DP-6 Changing:
I [21:31:59]   from:
I [21:31:59]     scale:    1.000
I [21:31:59]     position: 1504,0
I [21:31:59]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
I [21:31:59]   to:
I [21:31:59]     position: 2560,0
I [21:31:59] 
I [21:31:59] Changes successful
I [21:41:29] 
I [21:41:29] Reloading configuration file: /home/black/.config/way-displays/cfg.yaml
I [21:41:29]   Arrange in a ROW aligned at the BOTTOM
I [21:41:29]   Auto scale: ON
I [21:41:29]   Scale:
I [21:41:29]     eDP-1: 1.500
I [21:41:29]   Mode:
I [21:41:29]     Goldstar Company Ltd 27GL850 912NTLEBE528: 2560x1440
I [21:41:29] 
I [21:41:29] DP-5 Changing:
I [21:41:29]   from:
I [21:41:29]     scale:    1.000
I [21:41:29]     position: 0,0
I [21:41:29]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [21:41:29]   to:
I [21:41:29]     mode:     2560x1440@144Hz (143,999mHz) 
E [21:41:29] 
E [21:41:29] ERROR: Changes failed
E [21:41:29] ERROR:   DP-5:
E [21:41:29] ERROR:     mode:     2560x1440@144Hz (143,999mHz) 
I [21:41:29] 
I [21:41:29] DP-5 Changing:
I [21:41:29]   from:
I [21:41:29]     scale:    1.000
I [21:41:29]     position: 0,0
I [21:41:29]     (no mode)
I [21:41:29]   to:
I [21:41:29]     mode:     2560x1440@120Hz (119,998mHz) 
E [21:41:29] 
E [21:41:29] ERROR: Changes failed
E [21:41:29] ERROR:   DP-5:
E [21:41:29] ERROR:     mode:     2560x1440@120Hz (119,998mHz) 
I [21:41:29] 
I [21:41:29] DP-5 Changing:
I [21:41:29]   from:
I [21:41:29]     scale:    1.000
I [21:41:29]     position: 0,0
I [21:41:29]     (no mode)
I [21:41:29]   to:
I [21:41:29]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [21:41:29] 
I [21:41:29] Changes successful
I [21:41:29] 
I [21:41:29] DP-5 Changing:
I [21:41:29]   from:
I [21:41:29]     scale:    1.000
I [21:41:29]     position: 0,0
I [21:41:29]     (no mode)
I [21:41:29]   to:
I [21:41:29]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [21:41:29] 
I [21:41:29] Changes successful
I [21:41:29] 
I [21:41:29] DP-5 Changing:
I [21:41:29]   from:
I [21:41:29]     scale:    1.000
I [21:41:29]     position: 0,0
I [21:41:29]     (no mode)
I [21:41:29]   to:
I [21:41:29]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [21:41:30] 
I [21:41:30] Changes successful
[....] truncated
[....] end of log follows:
I [21:45:40] DP-5 Changing:
I [21:45:40]   from:
I [21:45:40]     scale:    1.000
I [21:45:40]     position: 0,0
I [21:45:40]     (no mode)
I [21:45:40]   to:
I [21:45:40]     mode:     3840x2160@60Hz (59,940mHz) 
E [21:45:40] 
E [21:45:40] ERROR: Changes failed
E [21:45:40] ERROR:   DP-5:
E [21:45:40] ERROR:     mode:     3840x2160@60Hz (59,940mHz) 
I [21:45:40] 
I [21:45:40] DP-5 Changing:
I [21:45:40]   from:
I [21:45:40]     scale:    1.000
I [21:45:40]     position: 0,0
I [21:45:40]     (no mode)
I [21:45:40]   to:
I [21:45:40]     mode:     3840x2160@50Hz (50,000mHz) 
I [21:45:51] 
I [21:45:51] DP-5 Departed:
I [21:45:51]     name:     'DP-5'
I [21:45:51]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
I [21:45:51] 
I [21:45:51] DP-6 Departed:
I [21:45:51]     name:     'DP-6'
I [21:45:51]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
wl_display@1: error 1: invalid arguments for zwlr_output_configuration_v1@3.enable_head
E [21:45:51] 
E [21:45:51] ERROR: wl_display_dispatch_pending failed at src/server.c:148, exiting: 22 Invalid argument
E [21:45:51] 
E [21:45:51] ERROR: Please raise an issue: https://github.com/alex-courtis/way-displays/issues
E [21:45:51] ERROR: Attach this log and describe the events that occurred before this failure.

I will test some more tomorrow, let me know if any additional info is needed.

alex-courtis commented 2 years ago

Thanks for the detailed report.

Yes: monitors can be easily upset by HDMI extenders, docks, bad cables etc. way-displays should handle that, trying modes in descending order until a working one is found. Falling back to 2560x1440@100Hz (99,946mHz) is working as intended.

However... getting stuck in a loop after successfully making that change is definitely not working as intended. That will be fixed: cope with (no mode) being returned after a successful change.

The final ERROR is to be expected, as we are unplugging during one of the constant configuration changes. Under normal operating conditions that is extremely unlikely.

I will be grateful for your testing a fix; I have a finite amount of hardware available for testing.

alex-courtis commented 2 years ago

Possibly offtopic: what is the native resolution of your monitors? They report 2160p however you have said that they are 1440p. What happens when you attempt to use 2160p?

I have seen logs from a few other users with the same situation.

alex-courtis commented 2 years ago

FYI there is a command line client available for experimenting with changes before persisting them.

alex-courtis commented 2 years ago

Fix applied. I would be grateful if you could test:

git clone git@github.com:alex-courtis/way-displays.git
cd way-displays
git checkout 33-successful-modeset-infinite-loop
make
sudo make install

When you are done you can

sudo make uninstall
0x0013 commented 2 years ago

Tested the fix on my configuration, seems to be working, though way-displays did crash once.

First attempt - start with eDP-1 only, then plug in dock (with both displays attached) - logged warning but works - then attempt activating 144Hz. Program crashes, but displays stay working.

I [17:33:47] way-displays version 1.5.1-SNAPSHOT
I [17:33:47] 
I [17:33:47] Found configuration file: /home/black/.config/way-displays/cfg.yaml
I [17:33:47] 
I [17:33:47] Active configuration:
I [17:33:47]   Arrange in a ROW aligned at the BOTTOM
I [17:33:47]   Auto scale: OFF
I [17:33:47]   Scale:
I [17:33:47]     eDP-1: 1.250
I [17:33:47] 
I [17:33:47] Monitoring lid device: /dev/input/event0
I [17:33:47] 
I [17:33:47] Lid open
I [17:33:47] 
I [17:33:47] eDP-1 Arrived:
I [17:33:47]   info:
I [17:33:47]     name:     'eDP-1'
I [17:33:47]     desc:     'Unknown 0x095F 0x00000000 (eDP-1)'
I [17:33:47]     width:    280mm
I [17:33:47]     height:   190mm
I [17:33:47]     dpi:      202.86 @ 2256x1504
I [17:33:47]     mode:     2256 x 1504 @  60 Hz   59,999 mHz (preferred)
I [17:33:47]   current:
I [17:33:47]     scale:    2.000
I [17:33:47]     position: 0,0
I [17:33:47]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:33:47] 
I [17:33:47] eDP-1 Changing:
I [17:33:47]   from:
I [17:33:47]     scale:    2.000
I [17:33:47]     position: 0,0
I [17:33:47]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:33:47]   to:
I [17:33:47]     scale:    1.250
I [17:33:47] 
I [17:33:47] Changes successful
I [17:35:09] 
I [17:35:09] DP-5 Arrived:
I [17:35:09]   info:
I [17:35:09]     name:     'DP-5'
I [17:35:09]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
I [17:35:09]     width:    700mm
I [17:35:09]     height:   390mm
I [17:35:09]     dpi:      93.34 @ 2560x1440
I [17:35:09]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [17:35:09]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [17:35:09]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [17:35:09]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [17:35:09]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [17:35:09]     mode:     2560 x 1440 @ 144 Hz  143,999 mHz
I [17:35:09]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [17:35:09]     mode:     2560 x 1440 @ 100 Hz   99,946 mHz (preferred)
I [17:35:09]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [17:35:09]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [17:35:09]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:35:09]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [17:35:09]     mode:     1680 x 1050 @  60 Hz   59,883 mHz
I [17:35:09]     mode:     1600 x  900 @  60 Hz   60,000 mHz
I [17:35:09]     mode:     1280 x 1024 @  75 Hz   75,025 mHz
I [17:35:09]     mode:     1280 x 1024 @  60 Hz   60,020 mHz
I [17:35:09]     mode:     1280 x  800 @  60 Hz   59,910 mHz
I [17:35:09]     mode:     1280 x  720 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:35:09]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [17:35:09]     mode:     1024 x  768 @  75 Hz   75,029 mHz
I [17:35:09]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [17:35:09]     mode:      800 x  600 @  75 Hz   75,000 mHz
I [17:35:09]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [17:35:09]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [17:35:09]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [17:35:09]     mode:      640 x  480 @  75 Hz   75,000 mHz
I [17:35:09]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [17:35:09]   current:
I [17:35:09]     scale:    1.000
I [17:35:09]     position: 1804,0
I [17:35:09]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:35:09] 
I [17:35:09] eDP-1 Changing:
I [17:35:09]   from:
I [17:35:09]     scale:    1.250
I [17:35:09]     position: 0,0
I [17:35:09]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:35:09]   to:
I [17:35:09]     position: 0,237
I [17:35:09] 
I [17:35:09] DP-5 Changing:
I [17:35:09]   from:
I [17:35:09]     scale:    1.000
I [17:35:09]     position: 1804,0
I [17:35:09]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:35:09]   to:
I [17:35:09]     position: 1805,0
I [17:35:10] 
I [17:35:10] DP-6 Arrived:
I [17:35:10]   info:
I [17:35:10]     name:     'DP-6'
I [17:35:10]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
I [17:35:10]     width:    700mm
I [17:35:10]     height:   390mm
I [17:35:10]     dpi:      93.34 @ 2560x1440
I [17:35:10]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [17:35:10]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [17:35:10]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [17:35:10]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [17:35:10]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [17:35:10]     mode:     2560 x 1440 @ 144 Hz  143,933 mHz (preferred)
I [17:35:10]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [17:35:10]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [17:35:10]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [17:35:10]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:35:10]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [17:35:10]     mode:     1280 x  720 @  60 Hz   60,000 mHz  59,940 mHz
I [17:35:10]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [17:35:10]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [17:35:10]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [17:35:10]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [17:35:10]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [17:35:10]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [17:35:10]   current:
I [17:35:10]     scale:    1.000
I [17:35:10]     position: 4364,0
I [17:35:10]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
W [17:35:10] 
W [17:35:10] WARNING: Changes cancelled, retrying
I [17:38:20] 
I [17:38:20] Server received set request:
I [17:38:20] 
I [17:38:20] Active configuration:
I [17:38:20]   Mode:
I [17:38:20]     DP-5: 2560x1440@144Hz
I [17:38:20] 
I [17:38:20] Applying new configuration:
I [17:38:20] 
I [17:38:20] Active configuration:
I [17:38:20]   Arrange in a ROW aligned at the BOTTOM
I [17:38:20]   Auto scale: OFF
I [17:38:20]   Scale:
I [17:38:20]     eDP-1: 1.250
I [17:38:20]   Mode:
I [17:38:20]     DP-5: 2560x1440@144Hz
I [17:38:20] 
I [17:38:20] DP-5 Changing:
I [17:38:20]   from:
I [17:38:20]     scale:    1.000
I [17:38:20]     position: 1804,0
I [17:38:20]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:38:20]   to:
I [17:38:20]     mode:     2560x1440@144Hz (143,999mHz) 
E [17:38:20] 
E [17:38:20] ERROR: Changes failed
E [17:38:20] ERROR:   DP-5:
E [17:38:20] ERROR:     mode:     2560x1440@144Hz (143,999mHz) 
W [17:38:20] 
W [17:38:20] WARNING: DP-5: No available mode for 2560x1440@144Hz, falling back to preferred
I [17:38:20] 
I [17:38:20] DP-5 Changing:
I [17:38:20]   from:
I [17:38:20]     scale:    1.000
I [17:38:20]     position: 1804,0
I [17:38:20]     (no mode)
I [17:38:20]   to:
I [17:38:20]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:38:20] 
I [17:38:20] Changes successful
I [17:38:20] 
I [17:38:20] eDP-1 Changing:
I [17:38:20]   from:
I [17:38:20]     scale:    1.250
I [17:38:20]     position: 0,0
I [17:38:20]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:38:20]   to:
I [17:38:20]     position: 0,237
I [17:38:20] 
I [17:38:20] DP-5 Changing:
I [17:38:20]   from:
I [17:38:20]     scale:    1.000
I [17:38:20]     position: 1804,0
I [17:38:20]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:38:20]   to:
I [17:38:20]     position: 1805,0
I [17:38:20] 
I [17:38:20] DP-6 Changing:
I [17:38:20]   from:
I [17:38:20]     scale:    1.000
I [17:38:20]     position: 4364,0
I [17:38:20]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
I [17:38:20]   to:
I [17:38:20]     position: 4365,0
E [17:38:20] 
E [17:38:20] ERROR: Changes failed
E [17:38:20] 
E [17:38:20] ERROR: Please raise an issue: https://github.com/alex-courtis/way-displays/issues
E [17:38:20] ERROR: Attach this log and describe the events that occurred before this failure.

Attempt starting program on the same sway session, program immediately crashes:

I [17:44:23] way-displays version 1.5.1-SNAPSHOT
I [17:44:23] 
I [17:44:23] Found configuration file: /home/black/.config/way-displays/cfg.yaml
I [17:44:23] 
I [17:44:23] Active configuration:
I [17:44:23]   Arrange in a ROW aligned at the BOTTOM
I [17:44:23]   Auto scale: OFF
I [17:44:23]   Scale:
I [17:44:23]     eDP-1: 1.250
I [17:44:24] 
I [17:44:24] Monitoring lid device: /dev/input/event0
I [17:44:24] 
I [17:44:24] Lid open
I [17:44:24] 
I [17:44:24] DP-6 Arrived:
I [17:44:24]   info:
I [17:44:24]     name:     'DP-6'
I [17:44:24]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
I [17:44:24]     width:    700mm
I [17:44:24]     height:   390mm
I [17:44:24]     dpi:      93.34 @ 2560x1440
I [17:44:24]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [17:44:24]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [17:44:24]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [17:44:24]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [17:44:24]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [17:44:24]     mode:     2560 x 1440 @ 144 Hz  143,933 mHz (preferred)
I [17:44:24]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [17:44:24]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [17:44:24]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [17:44:24]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:44:24]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [17:44:24]     mode:     1280 x  720 @  60 Hz   60,000 mHz  59,940 mHz
I [17:44:24]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [17:44:24]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [17:44:24]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [17:44:24]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [17:44:24]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [17:44:24]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [17:44:24]   current:
I [17:44:24]     scale:    1.000
I [17:44:24]     position: 0,0
I [17:44:24]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
I [17:44:24] 
I [17:44:24] DP-5 Arrived:
I [17:44:24]   info:
I [17:44:24]     name:     'DP-5'
I [17:44:24]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
I [17:44:24]     width:    700mm
I [17:44:24]     height:   390mm
I [17:44:24]     dpi:      93.34 @ 2560x1440
I [17:44:24]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [17:44:24]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [17:44:24]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [17:44:24]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [17:44:24]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [17:44:24]     mode:     2560 x 1440 @ 144 Hz  143,999 mHz
I [17:44:24]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [17:44:24]     mode:     2560 x 1440 @ 100 Hz   99,946 mHz (preferred)
I [17:44:24]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [17:44:24]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [17:44:24]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:44:24]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [17:44:24]     mode:     1680 x 1050 @  60 Hz   59,883 mHz
I [17:44:24]     mode:     1600 x  900 @  60 Hz   60,000 mHz
I [17:44:24]     mode:     1280 x 1024 @  75 Hz   75,025 mHz
I [17:44:24]     mode:     1280 x 1024 @  60 Hz   60,020 mHz
I [17:44:24]     mode:     1280 x  800 @  60 Hz   59,910 mHz
I [17:44:24]     mode:     1280 x  720 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:44:24]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [17:44:24]     mode:     1024 x  768 @  75 Hz   75,029 mHz
I [17:44:24]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [17:44:24]     mode:      800 x  600 @  75 Hz   75,000 mHz
I [17:44:24]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [17:44:24]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [17:44:24]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [17:44:24]     mode:      640 x  480 @  75 Hz   75,000 mHz
I [17:44:24]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [17:44:24]   current:
I [17:44:24]     scale:    1.000
I [17:44:24]     position: 1804,0
I [17:44:24]     mode:     2560x1440@144Hz (143,999mHz) 
I [17:44:24] 
I [17:44:24] eDP-1 Arrived:
I [17:44:24]   info:
I [17:44:24]     name:     'eDP-1'
I [17:44:24]     desc:     'Unknown 0x095F 0x00000000 (eDP-1)'
I [17:44:24]     width:    280mm
I [17:44:24]     height:   190mm
I [17:44:24]     dpi:      202.86 @ 2256x1504
I [17:44:24]     mode:     2256 x 1504 @  60 Hz   59,999 mHz (preferred)
I [17:44:24]   current:
I [17:44:24]     scale:    1.250
I [17:44:24]     position: 5120,237
I [17:44:24]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:44:24] 
I [17:44:24] DP-5 Changing:
I [17:44:24]   from:
I [17:44:24]     scale:    1.000
I [17:44:24]     position: 1804,0
I [17:44:24]     mode:     2560x1440@144Hz (143,999mHz) 
I [17:44:24]   to:
I [17:44:24]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:44:24] 
I [17:44:24] Changes successful
I [17:44:24] 
I [17:44:24] DP-5 Changing:
I [17:44:24]   from:
I [17:44:24]     scale:    1.000
I [17:44:24]     position: 1804,0
I [17:44:24]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:44:24]   to:
I [17:44:24]     position: 2560,0

Unfortunately tee seems to have cut off the final logged error, I don't have it saved, but I think the error was same as the first time. Then restarted sway session, attempt to choose a lower resolution than native (works), then attempt higher refresh at native again. Successfully falls back to preferred, program does not crash.

I [17:45:26] way-displays version 1.5.1-SNAPSHOT
I [17:45:26] 
I [17:45:26] Found configuration file: /home/black/.config/way-displays/cfg.yaml
I [17:45:26] 
I [17:45:26] Active configuration:
I [17:45:26]   Arrange in a ROW aligned at the BOTTOM
I [17:45:26]   Auto scale: OFF
I [17:45:26]   Scale:
I [17:45:26]     eDP-1: 1.250
I [17:45:27] 
I [17:45:27] Monitoring lid device: /dev/input/event0
I [17:45:27] 
I [17:45:27] Lid open
I [17:45:27] 
I [17:45:27] DP-6 Arrived:
I [17:45:27]   info:
I [17:45:27]     name:     'DP-6'
I [17:45:27]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
I [17:45:27]     width:    700mm
I [17:45:27]     height:   390mm
I [17:45:27]     dpi:      93.34 @ 2560x1440
I [17:45:27]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [17:45:27]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [17:45:27]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [17:45:27]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [17:45:27]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [17:45:27]     mode:     2560 x 1440 @ 144 Hz  143,933 mHz (preferred)
I [17:45:27]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [17:45:27]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [17:45:27]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [17:45:27]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:45:27]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [17:45:27]     mode:     1280 x  720 @  60 Hz   60,000 mHz  59,940 mHz
I [17:45:27]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [17:45:27]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [17:45:27]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [17:45:27]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [17:45:27]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [17:45:27]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [17:45:27]   current:
I [17:45:27]     scale:    1.000
I [17:45:27]     position: 3688,0
I [17:45:27]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
I [17:45:27] 
I [17:45:27] DP-5 Arrived:
I [17:45:27]   info:
I [17:45:27]     name:     'DP-5'
I [17:45:27]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
I [17:45:27]     width:    700mm
I [17:45:27]     height:   390mm
I [17:45:27]     dpi:      93.34 @ 2560x1440
I [17:45:27]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [17:45:27]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [17:45:27]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [17:45:27]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [17:45:27]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [17:45:27]     mode:     2560 x 1440 @ 144 Hz  143,999 mHz
I [17:45:27]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [17:45:27]     mode:     2560 x 1440 @ 100 Hz   99,946 mHz (preferred)
I [17:45:27]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [17:45:27]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [17:45:27]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:45:27]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [17:45:27]     mode:     1680 x 1050 @  60 Hz   59,883 mHz
I [17:45:27]     mode:     1600 x  900 @  60 Hz   60,000 mHz
I [17:45:27]     mode:     1280 x 1024 @  75 Hz   75,025 mHz
I [17:45:27]     mode:     1280 x 1024 @  60 Hz   60,020 mHz
I [17:45:27]     mode:     1280 x  800 @  60 Hz   59,910 mHz
I [17:45:27]     mode:     1280 x  720 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:45:27]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [17:45:27]     mode:     1024 x  768 @  75 Hz   75,029 mHz
I [17:45:27]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [17:45:27]     mode:      800 x  600 @  75 Hz   75,000 mHz
I [17:45:27]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [17:45:27]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [17:45:27]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [17:45:27]     mode:      640 x  480 @  75 Hz   75,000 mHz
I [17:45:27]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [17:45:27]   current:
I [17:45:27]     scale:    1.000
I [17:45:27]     position: 1128,0
I [17:45:27]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:45:27] 
I [17:45:27] eDP-1 Arrived:
I [17:45:27]   info:
I [17:45:27]     name:     'eDP-1'
I [17:45:27]     desc:     'Unknown 0x095F 0x00000000 (eDP-1)'
I [17:45:27]     width:    280mm
I [17:45:27]     height:   190mm
I [17:45:27]     dpi:      202.86 @ 2256x1504
I [17:45:27]     mode:     2256 x 1504 @  60 Hz   59,999 mHz (preferred)
I [17:45:27]   current:
I [17:45:27]     scale:    2.000
I [17:45:27]     position: 0,0
I [17:45:27]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:45:27] 
I [17:45:27] DP-6 Changing:
I [17:45:27]   from:
I [17:45:27]     scale:    1.000
I [17:45:27]     position: 3688,0
I [17:45:27]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
I [17:45:27]   to:
I [17:45:27]     position: 0,0
I [17:45:27] 
I [17:45:27] DP-5 Changing:
I [17:45:27]   from:
I [17:45:27]     scale:    1.000
I [17:45:27]     position: 1128,0
I [17:45:27]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:45:27]   to:
I [17:45:27]     position: 2560,0
I [17:45:27] 
I [17:45:27] eDP-1 Changing:
I [17:45:27]   from:
I [17:45:27]     scale:    2.000
I [17:45:27]     position: 0,0
I [17:45:27]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:45:27]   to:
I [17:45:27]     scale:    1.250
I [17:45:27]     position: 5120,237
I [17:45:27] 
I [17:45:27] Changes successful
I [17:46:16] 
I [17:46:16] Lid closed
I [17:46:16] 
I [17:46:16] eDP-1 Changing:
I [17:46:16]   from:
I [17:46:16]     scale:    1.250
I [17:46:16]     position: 5120,237
I [17:46:16]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:46:16]     (lid closed)
I [17:46:16]   to:
I [17:46:16]     (disabled)
I [17:46:16] 
I [17:46:16] Changes successful
I [17:46:33] 
I [17:46:33] Lid open
I [17:46:33] 
I [17:46:33] eDP-1 Changing:
I [17:46:33]   from:
I [17:46:33]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:46:33]     (disabled)
I [17:46:33]   to:
I [17:46:33]     scale:    1.250
I [17:46:33]     position: 5120,237
I [17:46:33]     (enabled)
I [17:46:34] 
I [17:46:34] Changes successful
I [17:46:57] 
I [17:46:57] Server received get request:
I [17:46:57] 
I [17:46:57] Active configuration:
I [17:46:57]   Arrange in a ROW aligned at the BOTTOM
I [17:46:57]   Auto scale: OFF
I [17:46:57]   Scale:
I [17:46:57]     eDP-1: 1.250
I [17:46:57] 
I [17:46:57] DP-6:
I [17:46:57]   info:
I [17:46:57]     name:     'DP-6'
I [17:46:57]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
I [17:46:57]     width:    700mm
I [17:46:57]     height:   390mm
I [17:46:57]     dpi:      93.34 @ 2560x1440
I [17:46:57]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [17:46:57]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [17:46:57]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [17:46:57]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [17:46:57]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [17:46:57]     mode:     2560 x 1440 @ 144 Hz  143,933 mHz (preferred)
I [17:46:57]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [17:46:57]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [17:46:57]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [17:46:57]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:46:57]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [17:46:57]     mode:     1280 x  720 @  60 Hz   60,000 mHz  59,940 mHz
I [17:46:57]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [17:46:57]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [17:46:57]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [17:46:57]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [17:46:57]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [17:46:57]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [17:46:57]   current:
I [17:46:57]     scale:    1.000
I [17:46:57]     position: 0,0
I [17:46:57]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
I [17:46:57] 
I [17:46:57] DP-5:
I [17:46:57]   info:
I [17:46:57]     name:     'DP-5'
I [17:46:57]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
I [17:46:57]     width:    700mm
I [17:46:57]     height:   390mm
I [17:46:57]     dpi:      93.34 @ 2560x1440
I [17:46:57]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
I [17:46:57]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
I [17:46:57]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
I [17:46:57]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
I [17:46:57]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
I [17:46:57]     mode:     2560 x 1440 @ 144 Hz  143,999 mHz
I [17:46:57]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
I [17:46:57]     mode:     2560 x 1440 @ 100 Hz   99,946 mHz (preferred)
I [17:46:57]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
I [17:46:57]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
I [17:46:57]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:46:57]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
I [17:46:57]     mode:     1680 x 1050 @  60 Hz   59,883 mHz
I [17:46:57]     mode:     1600 x  900 @  60 Hz   60,000 mHz
I [17:46:57]     mode:     1280 x 1024 @  75 Hz   75,025 mHz
I [17:46:57]     mode:     1280 x 1024 @  60 Hz   60,020 mHz
I [17:46:57]     mode:     1280 x  800 @  60 Hz   59,910 mHz
I [17:46:57]     mode:     1280 x  720 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
I [17:46:57]     mode:     1280 x  720 @  50 Hz   50,000 mHz
I [17:46:57]     mode:     1024 x  768 @  75 Hz   75,029 mHz
I [17:46:57]     mode:     1024 x  768 @  60 Hz   60,004 mHz
I [17:46:57]     mode:      800 x  600 @  75 Hz   75,000 mHz
I [17:46:57]     mode:      800 x  600 @  60 Hz   60,317 mHz
I [17:46:57]     mode:      720 x  576 @  50 Hz   50,000 mHz
I [17:46:57]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
I [17:46:57]     mode:      640 x  480 @  75 Hz   75,000 mHz
I [17:46:57]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
I [17:46:57]   current:
I [17:46:57]     scale:    1.000
I [17:46:57]     position: 2560,0
I [17:46:57]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:46:57] 
I [17:46:57] eDP-1:
I [17:46:57]   info:
I [17:46:57]     name:     'eDP-1'
I [17:46:57]     desc:     'Unknown 0x095F 0x00000000 (eDP-1)'
I [17:46:57]     width:    280mm
I [17:46:57]     height:   190mm
I [17:46:57]     dpi:      202.86 @ 2256x1504
I [17:46:57]     mode:     2256 x 1504 @  60 Hz   59,999 mHz (preferred)
I [17:46:57]   current:
I [17:46:57]     scale:    1.250
I [17:46:57]     position: 5120,237
I [17:46:57]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:48:03] 
I [17:48:03] Server received set request:
I [17:48:03] 
I [17:48:03] Active configuration:
I [17:48:03]   Mode:
I [17:48:03]     DP-5: 1920x1080@60Hz
I [17:48:03] 
I [17:48:03] Applying new configuration:
I [17:48:03] 
I [17:48:03] Active configuration:
I [17:48:03]   Arrange in a ROW aligned at the BOTTOM
I [17:48:03]   Auto scale: OFF
I [17:48:03]   Scale:
I [17:48:03]     eDP-1: 1.250
I [17:48:03]   Mode:
I [17:48:03]     DP-5: 1920x1080@60Hz
I [17:48:03] 
I [17:48:03] DP-5 Changing:
I [17:48:03]   from:
I [17:48:03]     scale:    1.000
I [17:48:03]     position: 2560,0
I [17:48:03]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:48:03]   to:
I [17:48:03]     mode:     1920x1080@60Hz (60,000mHz) 
I [17:48:04] 
I [17:48:04] Changes successful
I [17:48:04] 
I [17:48:04] DP-5 Changing:
I [17:48:04]   from:
I [17:48:04]     scale:    1.000
I [17:48:04]     position: 2560,0
I [17:48:04]     mode:     1920x1080@60Hz (60,000mHz) 
I [17:48:04]   to:
I [17:48:04]     position: 2560,360
I [17:48:04] 
I [17:48:04] eDP-1 Changing:
I [17:48:04]   from:
I [17:48:04]     scale:    1.250
I [17:48:04]     position: 5120,237
I [17:48:04]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:48:04]   to:
I [17:48:04]     position: 4480,237
I [17:48:04] 
I [17:48:04] Changes successful
I [17:49:23] 
I [17:49:23] Server received set request:
I [17:49:23] 
I [17:49:23] Active configuration:
I [17:49:23]   Mode:
I [17:49:23]     DP-5: 2560x1440@120Hz
I [17:49:23] 
I [17:49:23] Applying new configuration:
I [17:49:23] 
I [17:49:23] Active configuration:
I [17:49:23]   Arrange in a ROW aligned at the BOTTOM
I [17:49:23]   Auto scale: OFF
I [17:49:23]   Scale:
I [17:49:23]     eDP-1: 1.250
I [17:49:23]   Mode:
I [17:49:23]     DP-5: 2560x1440@120Hz
I [17:49:23] 
I [17:49:23] DP-5 Changing:
I [17:49:23]   from:
I [17:49:23]     scale:    1.000
I [17:49:23]     position: 2560,360
I [17:49:23]     mode:     1920x1080@60Hz (60,000mHz) 
I [17:49:23]   to:
I [17:49:23]     mode:     2560x1440@120Hz (119,998mHz) 
E [17:49:23] 
E [17:49:23] ERROR: Changes failed
E [17:49:23] ERROR:   DP-5:
E [17:49:23] ERROR:     mode:     2560x1440@120Hz (119,998mHz) 
W [17:49:23] 
W [17:49:23] WARNING: DP-5: No available mode for 2560x1440@120Hz, falling back to preferred
I [17:49:23] 
I [17:49:23] DP-5 Changing:
I [17:49:23]   from:
I [17:49:23]     scale:    1.000
I [17:49:23]     position: 2560,360
I [17:49:23]     (no mode)
I [17:49:23]   to:
I [17:49:23]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:49:24] 
I [17:49:24] Changes successful
I [17:49:24] 
I [17:49:24] DP-5 Changing:
I [17:49:24]   from:
I [17:49:24]     scale:    1.000
I [17:49:24]     position: 2560,360
I [17:49:24]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
I [17:49:24]   to:
I [17:49:24]     position: 2560,0
I [17:49:24] 
I [17:49:24] eDP-1 Changing:
I [17:49:24]   from:
I [17:49:24]     scale:    1.250
I [17:49:24]     position: 4480,237
I [17:49:24]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [17:49:24]   to:
I [17:49:24]     position: 5120,237
I [17:49:24] 
I [17:49:24] Changes successful
0x0013 commented 2 years ago

Possibly offtopic: what is the native resolution of your monitors? They report 2160p however you have said that they are 1440p. What happens when you attempt to use 2160p?

I have seen logs from a few other users with the same situation.

Native resolution is 1440p for both. The displays support 2160p input, in which case the full image gets downscaled to native resolution, effectively making items appear smaller and blurry. Not something one would want, I think it's maybe meant to handle media devices that only output in 4K.

alex-courtis commented 2 years ago

Thank you for the detailed testing. It looks like the original issue of the infinite loop is resolved.

Session 3:

Then restarted sway session, attempt to choose a lower resolution than native (works), then attempt higher refresh at native again. Successfully falls back to preferred, program does not crash.

It looks like everything is working as intended.

Session 1:

then attempt activating 144Hz. Program crashes, but displays stay working.

That failure is very concerning. The final three simple changes without mode should not be problematic.

The second set of changes not being retried after cancellation also indicates a problem. The positions were not correct after DP-6 arrival.

Session 2:

program immediately crashes

Definitely a problem. I am wondering if it might be a segfault, as it is unlikely that tee would not have received the line buffered stderr.

alex-courtis commented 2 years ago

The differentiating factor here appears to be the dock: displays are appearing almost immediately after each other. That's not something I've been able to test, and I'm glad you brought it to my attention.

I would be very grateful if you could test again, with some debug added.

Please:

git pull
make
sudo make install

Run with way-displays -L debug

Interesting tests:

alex-courtis commented 2 years ago

If you do experience an exit without a message, please check for a core dump via coredumpctl -1

0x0013 commented 2 years ago

I am wondering if it might be a segfault, as it is unlikely that tee would not have received the line buffered stderr.

Actually, on reconsideration, lack of error messages in that log is due to me only calling tee for the default stdout stream. I did not redirect the stderr stream, so it's expected that the second output where the program immediately crashes, contains no error log. The other logs include the error stream as those instances were started by Sway on startup, with stderr redirection.

I will make sure to save the error stream as well when I do the next tests.

0x0013 commented 2 years ago

Did a few more tests with the newest HEAD from the branch.

  1. Start program unplugged, lid open. Then connect dock (both displays running and waiting for input), then close the lid a little later. Everything works fine.

    I [14:05:59] way-displays version 1.5.1-SNAPSHOT
    I [14:05:59] 
    I [14:05:59] Found configuration file: /home/black/.config/way-displays/cfg.yaml
    I [14:05:59] 
    I [14:05:59] Active configuration:
    I [14:05:59]   Arrange in a ROW aligned at the MIDDLE
    I [14:05:59]   Order:
    I [14:05:59]     eDP-1
    I [14:05:59]     Goldstar Company Ltd 27GL850 912NTLEBE528
    I [14:05:59]     Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466
    I [14:05:59]   Auto scale: OFF
    I [14:05:59]   Scale:
    I [14:05:59]     eDP-1: 1.375
    I [14:05:59]   Mode:
    I [14:05:59]     DP-5: 2560x1440@100Hz
    I [14:05:59] 
    I [14:05:59] Monitoring lid device: /dev/input/event0
    I [14:05:59] 
    I [14:05:59] Lid open
    I [14:05:59] 
    I [14:05:59] eDP-1 Arrived:
    I [14:05:59]   info:
    I [14:05:59]     name:     'eDP-1'
    I [14:05:59]     desc:     'Unknown 0x095F 0x00000000 (eDP-1)'
    I [14:05:59]     width:    280mm
    I [14:05:59]     height:   190mm
    I [14:05:59]     dpi:      202.86 @ 2256x1504
    I [14:05:59]     mode:     2256 x 1504 @  60 Hz   59,999 mHz (preferred)
    I [14:05:59]   current:
    I [14:05:59]     scale:    1.375
    I [14:05:59]     position: 0,0
    I [14:05:59]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
    I [14:07:08] 
    I [14:07:08] DP-5 Arrived:
    I [14:07:08]   info:
    I [14:07:08]     name:     'DP-5'
    I [14:07:08]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
    I [14:07:08]     width:    700mm
    I [14:07:08]     height:   390mm
    I [14:07:08]     dpi:      93.34 @ 2560x1440
    I [14:07:08]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:07:08]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
    I [14:07:08]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
    I [14:07:08]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
    I [14:07:08]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
    I [14:07:08]     mode:     2560 x 1440 @ 100 Hz   99,946 mHz (preferred)
    I [14:07:08]     mode:     2560 x 1440 @  75 Hz   74,971 mHz
    I [14:07:08]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
    I [14:07:08]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
    I [14:07:08]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
    I [14:07:08]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
    I [14:07:08]     mode:     1680 x 1050 @  60 Hz   59,883 mHz
    I [14:07:08]     mode:     1600 x  900 @  60 Hz   60,000 mHz
    I [14:07:08]     mode:     1280 x 1024 @  75 Hz   75,025 mHz
    I [14:07:08]     mode:     1280 x 1024 @  60 Hz   60,020 mHz
    I [14:07:08]     mode:     1280 x  800 @  60 Hz   59,910 mHz
    I [14:07:08]     mode:     1280 x  720 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
    I [14:07:08]     mode:     1280 x  720 @  50 Hz   50,000 mHz
    I [14:07:08]     mode:     1024 x  768 @  75 Hz   75,029 mHz
    I [14:07:08]     mode:     1024 x  768 @  60 Hz   60,004 mHz
    I [14:07:08]     mode:      800 x  600 @  75 Hz   75,000 mHz
    I [14:07:08]     mode:      800 x  600 @  60 Hz   60,317 mHz
    I [14:07:08]     mode:      720 x  576 @  50 Hz   50,000 mHz
    I [14:07:08]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:07:08]     mode:      640 x  480 @  75 Hz   75,000 mHz
    I [14:07:08]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
    I [14:07:08]   current:
    I [14:07:08]     scale:    1.000
    I [14:07:08]     position: 1640,0
    I [14:07:08]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
    I [14:07:08] 
    I [14:07:08] eDP-1 Changing:
    I [14:07:08]   from:
    I [14:07:08]     scale:    1.375
    I [14:07:08]     position: 0,0
    I [14:07:08]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
    I [14:07:08]   to:
    I [14:07:08]     position: 0,173
    I [14:07:08] 
    I [14:07:08] DP-5 Changing:
    I [14:07:08]   from:
    I [14:07:08]     scale:    1.000
    I [14:07:08]     position: 1640,0
    I [14:07:08]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
    I [14:07:08]   to:
    I [14:07:08]     position: 1641,0
    I [14:07:09] 
    I [14:07:09] DP-6 Arrived:
    I [14:07:09]   info:
    I [14:07:09]     name:     'DP-6'
    I [14:07:09]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
    I [14:07:09]     width:    700mm
    I [14:07:09]     height:   390mm
    I [14:07:09]     dpi:      93.34 @ 2560x1440
    I [14:07:09]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:07:09]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
    I [14:07:09]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
    I [14:07:09]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
    I [14:07:09]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
    I [14:07:09]     mode:     2560 x 1440 @ 144 Hz  143,933 mHz (preferred)
    I [14:07:09]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
    I [14:07:09]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
    I [14:07:09]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
    I [14:07:09]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
    I [14:07:09]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
    I [14:07:09]     mode:     1280 x  720 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:07:09]     mode:     1280 x  720 @  50 Hz   50,000 mHz
    I [14:07:09]     mode:     1024 x  768 @  60 Hz   60,004 mHz
    I [14:07:09]     mode:      800 x  600 @  60 Hz   60,317 mHz
    I [14:07:09]     mode:      720 x  576 @  50 Hz   50,000 mHz
    I [14:07:09]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:07:09]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
    I [14:07:09]   current:
    I [14:07:09]     scale:    1.000
    I [14:07:09]     position: 4200,0
    I [14:07:09]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
    W [14:07:09] 
    W [14:07:09] WARNING: Changes cancelled, retrying
    I [14:07:41] 
    I [14:07:41] Lid closed
    I [14:07:41] 
    I [14:07:41] eDP-1 Changing:
    I [14:07:41]   from:
    I [14:07:41]     scale:    1.375
    I [14:07:41]     position: 0,0
    I [14:07:41]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
    I [14:07:41]     (lid closed)
    I [14:07:41]   to:
    I [14:07:41]     (disabled)
    I [14:07:41] 
    I [14:07:41] DP-5 Changing:
    I [14:07:41]   from:
    I [14:07:41]     scale:    1.000
    I [14:07:41]     position: 1640,0
    I [14:07:41]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
    I [14:07:41]   to:
    I [14:07:41]     position: 0,0
    I [14:07:41] 
    I [14:07:41] DP-6 Changing:
    I [14:07:41]   from:
    I [14:07:41]     scale:    1.000
    I [14:07:41]     position: 4200,0
    I [14:07:41]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
    I [14:07:41]   to:
    I [14:07:41]     position: 2560,0
    I [14:07:42] 
    I [14:07:42] Changes successful
  2. No dock. Run program and open => close => open => close the lid a few times. Observation: sometimes the display switches off immediately on closing the lid, sometimes it keeps running for more than a few seconds (I can see the display through a gap with the closed lid). Possibly there is some interaction with my systemd-logind config which has the HandleLidSwitch=suspend-then-hibernate setting.

There is a lid input error in the log, which was output at one of the "delayed" screen occurences, but I also observed the screen staying on at other times when no error appeared.

I [14:12:16] way-displays version 1.5.1-SNAPSHOT
I [14:12:16] 
I [14:12:16] Found configuration file: /home/black/.config/way-displays/cfg.yaml
I [14:12:16] 
I [14:12:16] Active configuration:
I [14:12:16]   Arrange in a ROW aligned at the MIDDLE
I [14:12:16]   Order:
I [14:12:16]     eDP-1
I [14:12:16]     Goldstar Company Ltd 27GL850 912NTLEBE528
I [14:12:16]     Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466
I [14:12:16]   Auto scale: OFF
I [14:12:16]   Scale:
I [14:12:16]     eDP-1: 1.375
I [14:12:16]   Mode:
I [14:12:16]     DP-5: 2560x1440@100Hz
I [14:12:16] 
I [14:12:16] Monitoring lid device: /dev/input/event0
I [14:12:16] 
I [14:12:16] Lid open
I [14:12:16] 
I [14:12:16] eDP-1 Arrived:
I [14:12:16]   info:
I [14:12:16]     name:     'eDP-1'
I [14:12:16]     desc:     'Unknown 0x095F 0x00000000 (eDP-1)'
I [14:12:16]     width:    280mm
I [14:12:16]     height:   190mm
I [14:12:16]     dpi:      202.86 @ 2256x1504
I [14:12:16]     mode:     2256 x 1504 @  60 Hz   59,999 mHz (preferred)
I [14:12:16]   current:
I [14:12:16]     scale:    2.000
I [14:12:16]     position: 0,0
I [14:12:16]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [14:12:16] 
I [14:12:16] eDP-1 Changing:
I [14:12:16]   from:
I [14:12:16]     scale:    2.000
I [14:12:16]     position: 0,0
I [14:12:16]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
I [14:12:16]   to:
I [14:12:16]     scale:    1.375
I [14:12:16] 
I [14:12:16] Changes successful
I [14:13:33] 
I [14:13:33] Lid closed
I [14:13:35] 
I [14:13:35] Lid open
I [14:13:39] 
I [14:13:39] Lid closed
I [14:13:41] 
I [14:13:41] Lid open
I [14:13:48] 
I [14:13:48] Lid closed
I [14:14:02] 
I [14:14:02] Lid open
I [14:14:28] 
I [14:14:28] Lid closed
I [14:14:37] 
I [14:14:37] Lid open
I [14:14:48] 
I [14:14:48] Lid closed
libinput error: event0  - Lid Switch: client bug: event processing lagging behind by 968ms, your system is too slow
I [14:15:09] 
I [14:15:09] Lid open
I [14:15:26] 
I [14:15:26] Lid closed
I [14:15:48] 
I [14:15:48] Lid open
  1. This is something that doesn't work properly, and I'm not sure if it's something with way-displays or some other component. I start with the laptop docked, lid closed. Displays are configured as expected. Then, I unplug the dock while the lid is closed (thus disconnecting both displays and switching battery to discharging status). Then I open the lid a few seconds later. The laptop is on, but the screen is blank, and I cannot get it back working. Plugging the dock back in does not reactivate any displays. This happened 3 times I tried disconnecting laptop while closed. First 2 times I force-shutdown the laptop, even short-press on power-button does nothing (it is setup to hibernate on button press via systemd-logind config). Third time I was able to switch to a non-graphical console with ctrl+alt+F2 and kill sway process. After restarting sway it works again. The log is from this third occurence.
    I [14:25:47] way-displays version 1.5.1-SNAPSHOT
    I [14:25:47] 
    I [14:25:47] Found configuration file: /home/black/.config/way-displays/cfg.yaml
    I [14:25:47] 
    I [14:25:47] Active configuration:
    I [14:25:47]   Arrange in a ROW aligned at the MIDDLE
    I [14:25:47]   Order:
    I [14:25:47]     eDP-1
    I [14:25:47]     Goldstar Company Ltd 27GL850 912NTLEBE528
    I [14:25:47]     Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466
    I [14:25:47]   Auto scale: OFF
    I [14:25:47]   Scale:
    I [14:25:47]     eDP-1: 1.375
    I [14:25:47]   Mode:
    I [14:25:47]     DP-5: 2560x1440@100Hz
    I [14:25:48] 
    I [14:25:48] Monitoring lid device: /dev/input/event0
    I [14:25:48] 
    I [14:25:48] Lid closed
    I [14:25:48] 
    I [14:25:48] DP-6 Arrived:
    I [14:25:48]   info:
    I [14:25:48]     name:     'DP-6'
    I [14:25:48]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
    I [14:25:48]     width:    700mm
    I [14:25:48]     height:   390mm
    I [14:25:48]     dpi:      93.34 @ 2560x1440
    I [14:25:48]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:25:48]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
    I [14:25:48]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
    I [14:25:48]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
    I [14:25:48]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
    I [14:25:48]     mode:     2560 x 1440 @ 144 Hz  143,933 mHz (preferred)
    I [14:25:48]     mode:     2560 x 1440 @ 120 Hz  119,998 mHz
    I [14:25:48]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
    I [14:25:48]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
    I [14:25:48]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
    I [14:25:48]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
    I [14:25:48]     mode:     1280 x  720 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:25:48]     mode:     1280 x  720 @  50 Hz   50,000 mHz
    I [14:25:48]     mode:     1024 x  768 @  60 Hz   60,004 mHz
    I [14:25:48]     mode:      800 x  600 @  60 Hz   60,317 mHz
    I [14:25:48]     mode:      720 x  576 @  50 Hz   50,000 mHz
    I [14:25:48]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:25:48]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
    I [14:25:48]   current:
    I [14:25:48]     scale:    1.000
    I [14:25:48]     position: 2560,0
    I [14:25:48]     mode:     2560x1440@144Hz (143,933mHz) (preferred)
    I [14:25:48] 
    I [14:25:48] DP-5 Arrived:
    I [14:25:48]   info:
    I [14:25:48]     name:     'DP-5'
    I [14:25:48]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
    I [14:25:48]     width:    700mm
    I [14:25:48]     height:   390mm
    I [14:25:48]     dpi:      93.34 @ 2560x1440
    I [14:25:48]     mode:     3840 x 2160 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:25:48]     mode:     3840 x 2160 @  50 Hz   50,000 mHz
    I [14:25:48]     mode:     3840 x 2160 @  30 Hz   30,000 mHz  29,970 mHz
    I [14:25:48]     mode:     3840 x 2160 @  25 Hz   25,000 mHz
    I [14:25:48]     mode:     3840 x 2160 @  24 Hz   24,000 mHz  23,976 mHz
    I [14:25:48]     mode:     2560 x 1440 @ 100 Hz   99,946 mHz (preferred)
    I [14:25:48]     mode:     2560 x 1440 @  75 Hz   74,971 mHz
    I [14:25:48]     mode:     2560 x 1440 @  60 Hz   59,951 mHz
    I [14:25:48]     mode:     1920 x 1080 @ 120 Hz  120,000 mHz 119,880 mHz
    I [14:25:48]     mode:     1920 x 1080 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
    I [14:25:48]     mode:     1920 x 1080 @  50 Hz   50,000 mHz
    I [14:25:48]     mode:     1680 x 1050 @  60 Hz   59,883 mHz
    I [14:25:48]     mode:     1600 x  900 @  60 Hz   60,000 mHz
    I [14:25:48]     mode:     1280 x 1024 @  75 Hz   75,025 mHz
    I [14:25:48]     mode:     1280 x 1024 @  60 Hz   60,020 mHz
    I [14:25:48]     mode:     1280 x  800 @  60 Hz   59,910 mHz
    I [14:25:48]     mode:     1280 x  720 @  60 Hz   60,000 mHz  60,000 mHz  59,940 mHz
    I [14:25:48]     mode:     1280 x  720 @  50 Hz   50,000 mHz
    I [14:25:48]     mode:     1024 x  768 @  75 Hz   75,029 mHz
    I [14:25:48]     mode:     1024 x  768 @  60 Hz   60,004 mHz
    I [14:25:48]     mode:      800 x  600 @  75 Hz   75,000 mHz
    I [14:25:48]     mode:      800 x  600 @  60 Hz   60,317 mHz
    I [14:25:48]     mode:      720 x  576 @  50 Hz   50,000 mHz
    I [14:25:48]     mode:      720 x  480 @  60 Hz   60,000 mHz  59,940 mHz
    I [14:25:48]     mode:      640 x  480 @  75 Hz   75,000 mHz
    I [14:25:48]     mode:      640 x  480 @  60 Hz   60,000 mHz  59,940 mHz  59,940 mHz
    I [14:25:48]   current:
    I [14:25:48]     scale:    1.000
    I [14:25:48]     position: 0,0
    I [14:25:48]     mode:     2560x1440@100Hz (99,946mHz) (preferred)
    I [14:25:48] 
    I [14:25:48] eDP-1 Arrived:
    I [14:25:48]   info:
    I [14:25:48]     name:     'eDP-1'
    I [14:25:48]     desc:     'Unknown 0x095F 0x00000000 (eDP-1)'
    I [14:25:48]     width:    280mm
    I [14:25:48]     height:   190mm
    I [14:25:48]     dpi:      202.86 @ 2256x1504
    I [14:25:48]     mode:     2256 x 1504 @  60 Hz   59,999 mHz (preferred)
    I [14:25:48]   current:
    I [14:25:48]     (no mode)
    I [14:25:48]     (disabled)
    I [14:25:48]     (lid closed)
    I [14:26:15] 
    I [14:26:15] Lid open
    I [14:26:15] 
    I [14:26:15] eDP-1 Changing:
    I [14:26:15]   from:
    I [14:26:15]     (no mode)
    I [14:26:15]     (disabled)
    I [14:26:15]   to:
    I [14:26:15]     mode:     2256x1504@60Hz (59,999mHz) (preferred)
    I [14:26:15]     (enabled)
    I [14:26:26] 
    I [14:26:26] DP-5 Departed:
    I [14:26:26]     name:     'DP-5'
    I [14:26:26]     desc:     'Goldstar Company Ltd 27GL850 912NTLEBE528 (DP-5)'
    I [14:26:26] 
    I [14:26:26] DP-6 Departed:
    I [14:26:26]     name:     'DP-6'
    I [14:26:26]     desc:     'Goldstar Company Ltd LG ULTRAGEAR 110MADHLT466 (DP-6)'
    W [14:26:26] 
    W [14:26:26] WARNING: Changes cancelled, retrying
    I [14:30:01] 
    I [14:30:01] Wayland display terminated, exiting.

    The last line is probabyl from when I killed sway. Note that before that, the log indicates "Lid Open" action before external display departure, but in reality I opened the lid a few seconds after disconnecting the dock. Again I wonder if there is some misconfiguration on my part, and maybe the system is trying to go to sleep-then-hibernate mode when I disconnect power with the lid closed.

0x0013 commented 2 years ago

Did some more testing. I think maybe wayland or sway itself is finnicky with constant plugging/unplugging of displays. So far, if I dock the laptop, with lid open, displays are detected fine and are set up properly. Then, when undocking, it works fine as long as the lid is open (after a small delay of black, but illuminated, screen). But if I dock the laptop again the second time, the displays fail to change modes and I am left with the laptop screen only. Interestingly, the displays also usually arrive with different identifiers. But after that, I have been unable to get them to work properly again, until I exit sway and restart sway again - then it works again. During these plug/unplug sequences, I have observed way-displays both staying active (just unable to change modes with the WARNING: Changes cancelled, retrying), as well as once exiting.

I'm attaching 2 files.

First is of repeatedly plugging and unplugging dock, way-displays stayed running. way-displays.test.dock-plug-unplug-repeat.log

Second is the same, but way-displays exited this time. way-displays.1.black.log

Don't be confused that one of displays sometimes reports 1440p@144Hz and @122Hz available, and sometimes doesn't even report them. I noticed that the higher refresh rates are only offered when adaptive-sync is disabled on the monitor. Since I have no need for that, on this display, I had it disabled, but now since the higher refresh rates don't work anyways on this configuration (but fall-back to preferred mode correctly since your fix), I decided to continue testing the plug-unplug sequence with adaptive sync enabled, so the higher refresh rate would not even be offered.

0x0013 commented 2 years ago

Maybe worth mentioning - at this point I haven't actually tested these behaviors with "static" sway configuration for the additional displays. I only got the docking station a few days ago, and decided to set up way-displays right away, as it seems to provide the features I would want for dynamic configuration of the additional displays.

alex-courtis commented 2 years ago

2 No dock. Observation: sometimes the display switches off immediately on closing the lid

That is by design, now documented: way-displays will not turn off there are no external displays connected. We rely on sleep/suspend handling to maybe turn it off. That has some delays, which is why we see it remain on for a few seconds.

The event processing lagging message is a result of libinput receiving a lid event, but falling asleep before it can process it. Nothing we can do about that except maybe squish that message.

3 Then I open the lid a few seconds later. The laptop is on, but the screen is blank, and I cannot get it back working.

That is very annoying. I have experienced that once. Created #36. #31 may be a solution.

No misconfiguration on your part. Sleep / hibernation should be handled.

Did some more testing. I think maybe wayland or sway itself is finnicky with constant plugging/unplugging of displays.

It's the displays that are finnicky. The will often disable/enable themselves after plug, depending on timing, whether they are sleeping/deep sleeping/powered off etc. That results in the arrive/depart/arrive.

way-displays.test.dock-plug-unplug-repeat.log way-displays.1.black.log

I think these cases demonstrate the root of the problem: repeated cancellations that are not successfully retried.

I would be very grateful if you could repeat those tests with debug enabled: start with exec way-displays -L debug > /tmp/way-displays.${XDG_VTNR}.${USER}.log 2>&1 or put LOG_THRESHOLD: DEBUG in your cfg.yaml. That will indicate what is happening after the cancellations, and will allow us to handle it.

The changes in identifier are odd, but should not be an issue, as they are not the "key" to identify displays.

alex-courtis commented 2 years ago

Maybe worth mentioning - at this point I haven't actually tested these behaviors with "static" sway configuration for the additional displays.

That would be a lot of work, however it would be useful and interesting. It is what I will likely do when diagnosing #36

0x0013 commented 2 years ago

I would be very grateful if you could repeat those tests with debug enabled: start with exec way-displays -L debug > /tmp/way-displays.${XDG_VTNR}.${USER}.log 2>&1 or put LOG_THRESHOLD: DEBUG in your cfg.yaml. That will indicate what is happening after the cancellations, and will allow us to handle it.

Ran program with debug flag, start state - laptop unplugged, lid open. Lid stays open throughout the test. Execute following actions:

  1. Connect dock. Both displays wake up and are set as expected (2160p).
  2. Unplug dock. Integrated display sets as expected. Deliberate pause after this step.
  3. Connect dock. Both displays connect, however, one of them has a resolution below the preferred (1080p), while other is at the preferred (2160p). Did not attempt to change it.
  4. Unplug dock. Works as expected. Pause.
  5. Connect dock. Sway crashes and throws me back to my greetd console login screen. Displays work fine after relaunching Sway (not reflected in the log, as that is another session)

Log attached. way-displays.debug.plug-unplug-repeat.log

0x0013 commented 2 years ago

I caught another endless loop while testing for #36 . I think this pertains to both issues, but I am attaching to this issue as it ended in a loop.

Start with laptop connected to dock with 2 displays, lid closed. Then unplug laptop, and open lid. I notice the power led is off and lights up as I open it, indicating the laptop had gone to s2idle suspend mode. Display stays off. Contrary to the previous attempt, I am unable to switch to console no matter how many times I try. I attempt to short-press the power button, which should send the machine to hibernate, with no result. I close and re-open the lid again, and again, the power light had gone off, indicating s2idle was active. Display stays off and laptop unresponsive. I connect the laptop to the dock and displays get detected and get powered on, however one external display gets stuck in lower resolution (1080p). From this point, program gets stuck in a loop and I receive many log entries per second.

way-displays.debug.unplug-closed-2.log

Eventually, I kill the running way-displays instance. I then attempt to start it again, and the loop continues. Next log is from the newly launched instance.

way-displays.debug.unplug-closed-3.log

alex-courtis commented 2 years ago

5. Connect dock. Sway crashes and throws me back to my greetd console login screen.

That is disappointing. Investigating with the other fatal failure: #39

alex-courtis commented 2 years ago

Then unplug laptop, and open lid. I notice the power led is off and lights up as I open it, indicating the laptop had gone to s2idle suspend mode. Display stays off.

That should be resolved by #36

I connect the laptop to the dock and displays get detected and get powered on, however one external display gets stuck in lower resolution (1080p). From this point, program gets stuck in a loop and I receive many log entries per second.

That's a great find. The final modeset of the original 1080p is reported as successful, however that display is also reported as disabled with no mode set.

This looping fix will require more hardening, with some sway diagnostics to see exactly what is being sent in the situation of the final modeset resulting in the original mode before the changes.

alex-courtis commented 2 years ago

Many thanks for all your hard work @0x0013 - you have uncovered a great many issues that I would never have found otherwise.

I have enough information to work with now and I would be grateful if you could test once I've fixed all of these issues.

I will commit a fix for #36 to this branch, however I don't expect you to test that; all of the fixes should be tested together.

0x0013 commented 2 years ago

Glad I can help.

Feel free to ping me when the fixes are ready, I will be glad to test them.

alex-courtis commented 2 years ago

@0x0013 I am still working on a proper fix, however I do have a workaround : Unusable Displays Following MODE for a sway bug that I have identified.

Could I possibly ask you to test the workaround with one of your test cases? Second is the same, but way-displays exited this time. would be very useful.

0x0013 commented 2 years ago

@alex-courtis I did test a few times with my previous sequence - plugging and unplugging several times, lid stays open across all attempts.

Unfortunately, I do not see much improvement with the env variable WLR_DRM_NO_MODIFIERS=1 present. Across my attempts, the first docking would settle on the correct configuration as expected.

On subsequent attempts, I would observe one of the following:

While testing, I would wait for the log output to settle before executing the next action. A few times I also left the laptop unplugged for several minutes after the first plug/unplug sequence, but this did not seem to change anything.

All times but one, the displays would always be correctly set on the first connection after starting up Sway. The one time they didn't, I suspect it was improper cable connection, as they did not get detected at all, but then they worked properly on reconnect (so still the first time they were detected by laptop)

As I mentioned before, some of the incorrect resolution issues could be purely due to the monitor/dock configuration, but I did not currently test manually setting my preferred resolution after the wrong one was set. Obviously, the biggest issue is Sway crashing altogether on 2nd or 3rd connection attempt.

That said, so far I did not observe way-displays exiting and Sway continuing to run, which did happen a few times before if my memory serves me right.

Attaching 3 logs - 2 with approximately similar behaviour, and one where they got stuck in "no mode" no matter how many times I tried to replug.

lidopen-plug-unplug-repeat.log lidopen-plug-unplug-repeat.no-mode.log lidopen-plug-unplug-repeat-2.log

alex-courtis commented 2 years ago

Thanks @0x0013 that's really helpful.

It seems that we are done with the catastrophic way-displays failures now, just the bad states remain. I will pursue this from the sway side and output manager interface side.

alex-courtis commented 2 years ago

Still working on this. I've experienced some reproducible errors when plugging / unplugging a dock with two displays.

alex-courtis commented 1 year ago

There have been extensive way-displays rewrites of mode setting (it's now atomic), along with success/fail/cancel case handling for sway and river.

There have also been many bug fixes and updates for wlroots, sway and river around display handling.

Closing this as I can no longer reproduce any such errors.

Many thanks for all your work @0x0013 - please do open a new issue if you encounter any further problems.