alex-courtis / way-displays

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

Bug: runaway log on lid close/open #172

Open olistrik opened 2 weeks ago

olistrik commented 2 weeks ago

I've been having some issues with way-displays (1.11.0) and Hyprland (0.40.0). If I close my laptop lid all is fine:

way-displays.log on lid close ``` I [09:51:32] Lid closed I [09:51:32] I [09:51:32] eDP-1 Changing: I [09:51:32] from: I [09:51:32] scale: 1.250 (1.660) I [09:51:32] size: 1536x864 I [09:51:32] position: 0,288 I [09:51:32] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [09:51:32] VRR: off I [09:51:32] (lid closed) I [09:51:32] to: I [09:51:32] (disabled) I [09:51:32] I [09:51:32] DP-2 Changing: I [09:51:32] from: I [09:51:32] scale: 1.000 (1.153) I [09:51:32] size: 3440x1440 I [09:51:32] position: 1536,0 I [09:51:32] mode: 3440x1440@60Hz (59,999mHz) (preferred) I [09:51:32] VRR: off I [09:51:32] to: I [09:51:32] position: 0,0 I [09:51:34] I [09:51:34] Changes successful I [09:51:34] I [09:51:34] eDP-1 Changing: I [09:51:34] from: I [09:51:34] scale: 1.250 (1.660) I [09:51:34] position: 0,288 I [09:51:34] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [09:51:34] VRR: off I [09:51:34] (lid closed) I [09:51:34] to: I [09:51:34] (disabled) I [09:51:34] I [09:51:34] Changes successful ```

When I re-open it the laptop display never re-enables and way-display log infinitely prints the following at a rate of ~400 "Changes successful" per second:

way-displays.log on lid open ``` I [09:57:05] Changes successful I [09:57:05] I [09:57:05] eDP-1 Changing: I [09:57:05] from: I [09:57:05] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [09:57:05] VRR: on I [09:57:05] (disabled) I [09:57:05] to: I [09:57:05] scale: 1.250 I [09:57:05] position: 0,288 I [09:57:05] transform: none I [09:57:05] (enabled) I [09:57:05] I [09:57:05] Changes successful I [09:57:05] I [09:57:05] eDP-1 Changing: I [09:57:05] from: I [09:57:05] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [09:57:05] VRR: on I [09:57:05] (disabled) I [09:57:05] to: I [09:57:05] scale: 1.250 I [09:57:05] position: 0,288 I [09:57:05] transform: none I [09:57:05] (enabled) I [09:57:05] I [09:57:05] Changes successful I [09:57:05] I [09:57:05] eDP-1 Changing: I [09:57:05] from: I [09:57:05] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [09:57:05] VRR: on I [09:57:05] (disabled) I [09:57:05] to: I [09:57:05] scale: 1.250 I [09:57:05] position: 0,288 I [09:57:05] transform: none I [09:57:05] (enabled) I [09:57:05] I [09:57:05] Changes successful I [09:57:05] I [09:57:05] eDP-1 Changing: I [09:57:05] from: I [09:57:05] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [09:57:05] VRR: on I [09:57:05] (disabled) I [09:57:05] to: I [09:57:05] scale: 1.250 I [09:57:05] position: 0,288 I [09:57:05] transform: none I [09:57:05] (enabled) I [09:57:05] I [09:57:05] Changes successful I [09:57:05] I [09:57:05] eDP-1 Changing: I [09:57:05] from: I [09:57:05] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [09:57:05] VRR: on I [09:57:05] (disabled) I [09:57:05] to: I [09:57:05] scale: 1.250 I [09:57:05] position: 0,288 I [09:57:05] transform: none I [09:57:05] (enabled) I [09:57:05] I [09:57:05] Changes successful I [09:57:05] I [09:57:05] eDP-1 Changing: I [09:57:05] from: I [09:57:05] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [09:57:05] VRR: on I [09:57:05] (disabled) I [09:57:05] to: I [09:57:05] scale: 1.250 I [09:57:05] position: 0,288 I [09:57:05] transform: none I [09:57:05] (enabled) ... ```

If I kill and restart way-displays, it continues immediately printing as before. This is the log from hyprland when I do that:

hyprland.log on restart of way-displays ``` [LOG] [OutputManagement] New OutputManager registered [LOG] [OutputManagement] | sending output head for eDP-1 [LOG] [OutputManagement] | sending mode 1920x1080@60020mHz, pref: true [LOG] [OutputManagement] | sending mode 1920x1080@47997mHz, pref: false [LOG] [OutputManagement] | sending output head for DP-2 [LOG] [OutputManagement] | sending mode 3440x1440@59999mHz, pref: true [LOG] [OutputManagement] | sending mode 720x400@70082mHz, pref: false [LOG] [OutputManagement] | sending current mode for DP-2: 3440x1440@59999 [LOG] [OutputManagement] Creating new configuration [LOG] [OutputManagement] enableHead on eDP-1. For now, doing nothing. Waiting for apply(). [LOG] [OutputManagement] | configHead for eDP-1: set mode to 1920x1080@60020 [LOG] [OutputManagement] Applying configuration [LOG] [OutputManagement] Applying config for monitor eDP-1 [LOG] [OutputManagement] Applied configuration [LOG] [OutputManagement] Creating new configuration [LOG] [OutputManagement] enableHead on DP-2. For now, doing nothing. Waiting for apply(). [LOG] [OutputManagement] | configHead for DP-2: set adaptiveSync to 1 [LOG] [OutputManagement] Applying configuration [LOG] [OutputManagement] Applying config for monitor DP-2 [LOG] [OutputManagement] Applied configuration [LOG] [OutputManagement] Creating new configuration [LOG] [OutputManagement] enableHead on eDP-1. For now, doing nothing. Waiting for apply(). [LOG] [OutputManagement] | configHead for eDP-1: set scale to 1.25 [LOG] [OutputManagement] | configHead for eDP-1: set pos to 0, 288 [LOG] [OutputManagement] | configHead for eDP-1: set transform to 0 [LOG] [OutputManagement] Applying configuration [LOG] [OutputManagement] Applying config for monitor eDP-1 [LOG] [OutputManagement] Applied configuration [LOG] Applying monitor rule for eDP-1 [LOG] Applying monitor rule for DP-2 [LOG] Setting preferred mode for DP-2 [LOG] output DP-2 succeeded basic test on format DRM_FORMAT_XRGB8888 [LOG] arrangeMonitors: 1 to arrange [LOG] arrangeMonitors: DP-2 explicit [1536, 0] [LOG] arrangeMonitors: DP-2 xwayland [0, 0] [LOG] Monitor DP-2 data dump: res 3440x1440@60.00Hz, scale 1.00, transform 0, pos 1536x0, 10b 0 [LOG] [OutputManagement] | sending current mode for DP-2: 3440x1440@59999 [wlr] [backend/drm/drm.c:875] connector DP-2: Failed to page-flip output: a page-flip is already pending [LOG] [OutputManagement] Creating new configuration [LOG] [OutputManagement] enableHead on eDP-1. For now, doing nothing. Waiting for apply(). [LOG] [OutputManagement] | configHead for eDP-1: set scale to 1.25 [LOG] [OutputManagement] | configHead for eDP-1: set pos to 0, 288 [LOG] [OutputManagement] | configHead for eDP-1: set transform to 0 [LOG] [OutputManagement] Applying configuration [LOG] [OutputManagement] Applying config for monitor eDP-1 [LOG] [OutputManagement] Applied configuration [LOG] Applying monitor rule for eDP-1 [LOG] Applying monitor rule for DP-2 [LOG] Setting preferred mode for DP-2 [LOG] output DP-2 succeeded basic test on format DRM_FORMAT_XRGB8888 [LOG] arrangeMonitors: 1 to arrange [LOG] arrangeMonitors: DP-2 explicit [1536, 0] [LOG] arrangeMonitors: DP-2 xwayland [0, 0] [LOG] Monitor DP-2 data dump: res 3440x1440@60.00Hz, scale 1.00, transform 0, pos 1536x0, 10b 0 [LOG] [OutputManagement] | sending current mode for DP-2: 3440x1440@59999 [wlr] [backend/drm/drm.c:875] connector DP-2: Failed to page-flip output: a page-flip is already pending [LOG] [OutputManagement] Creating new configuration [LOG] [OutputManagement] enableHead on eDP-1. For now, doing nothing. Waiting for apply(). [LOG] [OutputManagement] | configHead for eDP-1: set scale to 1.25 [LOG] [OutputManagement] | configHead for eDP-1: set pos to 0, 288 [LOG] [OutputManagement] | configHead for eDP-1: set transform to 0 [LOG] [OutputManagement] Applying configuration [LOG] [OutputManagement] Applying config for monitor eDP-1 [LOG] [OutputManagement] Applied configuration ```

I can fix it by running hyprctl keyword monitor eDP-1,1920x1080@60,0x0,1, this will immediately stop the loop, ending with:

way-displays.log after `hyprctl` ``` | [10:14:01] eDP-1 Changing: I [10:14:01] from: I [10:14:01] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [10:14:01] VRR: on I [10:14:01] (disabled) I [10:14:01] to: I [10:14:01] scale: 1.250 I [10:14:01] position: 0,288 I [10:14:01] transform: none I [10:14:01] (enabled) I [10:14:02] I [10:14:02] Changes successful I [10:14:02] I [10:14:02] eDP-1 Changing: I [10:14:02] from: I [10:14:02] scale: 1.000 (1.660) I [10:14:02] position: 0,0 I [10:14:02] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [10:14:02] VRR: off I [10:14:02] to: I [10:14:02] scale: 1.250 I [10:14:02] position: 0,288 I [10:14:02] I [10:14:02] Changes successful I [10:14:02] I [10:14:02] eDP-1 Changing: I [10:14:02] from: I [10:14:02] scale: 1.000 (1.660) I [10:14:02] size: 1920x1080 I [10:14:02] position: 0,0 I [10:14:02] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [10:14:02] VRR: off I [10:14:02] to: I [10:14:02] scale: 1.250 I [10:14:02] position: 0,288 I [10:14:02] I [10:14:02] Changes successful I [10:14:02] I [10:14:02] eDP-1 Changing: I [10:14:02] from: I [10:14:02] scale: 1.000 (1.660) I [10:14:02] size: 1920x1080 I [10:14:02] position: 0,0 I [10:14:02] mode: 1920x1080@60Hz (60,020mHz) (preferred) I [10:14:02] VRR: off I [10:14:02] to: I [10:14:02] scale: 1.250 I [10:14:02] position: 0,288 I [10:14:02] I [10:14:02] Changes successful ```
hyprland.log after `hyprctl` ``` [LOG] Hyprctl: keyword monitor : eDP-1,1920x1080@60,0x0,1 [LOG] Applying monitor rule for eDP-1 [LOG] Callback 341dab0 -> 341daa8, removed. [LOG] Callback 341db18 -> 341db10, removed. [LOG] Registered signal for owner 341d500: 3415818 -> 341da20 (owner: ) [LOG] Registered signal for owner 341d500: 34158a8 -> 341da88 (owner: ) [LOG] Registered signal for owner 341d500: 3415898 -> 341daf0 (owner: ) [LOG] Registered signal for owner 341d500: 3415828 -> 341db58 (owner: ) [LOG] Registered signal for owner 341d500: 3415838 -> 341dbc0 (owner: ) [LOG] Registered signal for owner 341d500: 3415858 -> 341dc28 (owner: ) [LOG] Registered signal for owner 341d500: 3415878 -> 341dc90 (owner: ) [LOG] Added new monitor with name eDP-1 at [0, 288] with size [1920, 1080], pointer 3415770 [LOG] New monitor: WORKSPACEID 4, exists: 0 [LOG] moveWorkspaceToMonitor: Moving 1 to monitor 0 [LOG] moveWorkspaceToMonitor: Moving 3 to monitor 0 [LOG] Monitor eDP-1 is disabled but is requested to be enabled [LOG] Monitor eDP-1: requested 1920x1080@60.000000, found available mode: 1920x1080@60020mHz, applying. [LOG] output eDP-1 succeeded basic test on format DRM_FORMAT_XRGB8888 [LOG] arrangeMonitors: 2 to arrange [LOG] arrangeMonitors: DP-2 explicit [1536, 0] [LOG] arrangeMonitors: eDP-1 explicit [0, 0] [LOG] arrangeMonitors: DP-2 xwayland [0, 0] [LOG] arrangeMonitors: eDP-1 xwayland [3440, 0] [LOG] Monitor eDP-1 data dump: res 1920x1080@60.02Hz, scale 1.00, transform 0, pos 0x0, 10b 0 [LOG] [OutputManagement] | sending current mode for eDP-1: 1920x1080@60020 [LOG] Applying monitor rule for eDP-1 [LOG] Not applying a new rule to eDP-1 because it's already applied! [LOG] Applying monitor rule for DP-2 [LOG] Setting preferred mode for DP-2 [LOG] output DP-2 succeeded basic test on format DRM_FORMAT_XRGB8888 [LOG] arrangeMonitors: 2 to arrange [LOG] arrangeMonitors: DP-2 explicit [1536, 0] [LOG] arrangeMonitors: eDP-1 explicit [0, 0] [LOG] arrangeMonitors: DP-2 xwayland [0, 0] [LOG] arrangeMonitors: eDP-1 xwayland [3440, 0] [LOG] Monitor DP-2 data dump: res 3440x1440@60.00Hz, scale 1.00, transform 0, pos 1536x0, 10b 0 [LOG] [OutputManagement] | sending current mode for DP-2: 3440x1440@59999 [wlr] [backend/drm/drm.c:875] connector DP-2: Failed to page-flip output: a page-flip is already pending [LOG] Registered signal for owner 6781020: 5c360c8 -> 6781028 (owner: CRenderbuffer) [LOG] [OutputManagement] Creating new configuration [LOG] [OutputManagement] enableHead on eDP-1. For now, doing nothing. Waiting for apply(). [LOG] [OutputManagement] | configHead for eDP-1: set scale to 1.25 [LOG] [OutputManagement] | configHead for eDP-1: set pos to 0, 288 [LOG] [OutputManagement] | configHead for eDP-1: set transform to 0 [LOG] [OutputManagement] Applying configuration [LOG] [OutputManagement] Applying config for monitor eDP-1 [LOG] [OutputManagement] Applied configuration [LOG] Registered signal for owner 2f8a210: 3374378 -> 2f8a860 (owner: layerSurface) [LOG] Registered signal for owner 2f8a210: 3f7dbf8 -> 2f8a728 (owner: layerSurface) [LOG] Registered signal for owner 2f8a210: 3374388 -> 2f8a790 (owner: layerSurface) [LOG] Registered signal for owner 2f8a210: 3374398 -> 2f8a7f8 (owner: layerSurface) [LOG] Registered signal for owner 2f2c5f0: 3f7dc08 -> 2f2c7d0 (owner: CPopup Head) [LOG] Registered signal for owner 2f8a4f0: 33743b8 -> 2f8a588 (owner: CWLSurface) [LOG] Registered signal for owner 2f8a4f0: 3374378 -> 2f8a5f0 (owner: CWLSurface) [LOG] CWLSurface 2f8a4f0 called init() [LOG] LayerSurface 3f7db30 (namespace hyprpaper layer 0) created on monitor eDP-1 [LOG] Registered signal for owner 33740a0: 33743b8 -> 73fe200 (owner: FractionalScale) [LOG] [OutputManagement] Creating new configuration [LOG] [OutputManagement] enableHead on eDP-1. For now, doing nothing. Waiting for apply(). [LOG] [OutputManagement] | configHead for eDP-1: set scale to 1.25 [LOG] [OutputManagement] | configHead for eDP-1: set pos to 0, 288 [LOG] [OutputManagement] | configHead for eDP-1: set transform to 0 [LOG] [OutputManagement] Applying configuration [LOG] [OutputManagement] Applying config for monitor eDP-1 [LOG] [OutputManagement] Applied configuration [LOG] Applying monitor rule for eDP-1 [LOG] Monitor eDP-1: requested 1920x1080@60.000000, found available mode: 1920x1080@60020mHz, applying. [LOG] output eDP-1 succeeded basic test on format DRM_FORMAT_XRGB8888 [LOG] arrangeMonitors: 2 to arrange [LOG] arrangeMonitors: DP-2 explicit [1536, 0] [LOG] arrangeMonitors: eDP-1 explicit [0, 288] [LOG] arrangeMonitors: DP-2 xwayland [0, 0] [LOG] arrangeMonitors: eDP-1 xwayland [3440, 0] [LOG] Monitor eDP-1 data dump: res 1920x1080@60.02Hz, scale 1.25, transform 0, pos 0x288, 10b 0 [LOG] [OutputManagement] | sending current mode for eDP-1: 1920x1080@60020 [LOG] Applying monitor rule for DP-2 [LOG] Setting preferred mode for DP-2 [LOG] output DP-2 succeeded basic test on format DRM_FORMAT_XRGB8888 [LOG] arrangeMonitors: 2 to arrange [LOG] arrangeMonitors: DP-2 explicit [1536, 0] [LOG] arrangeMonitors: eDP-1 explicit [0, 288] [LOG] arrangeMonitors: DP-2 xwayland [0, 0] [LOG] arrangeMonitors: eDP-1 xwayland [3440, 0] [LOG] Monitor DP-2 data dump: res 3440x1440@60.00Hz, scale 1.00, transform 0, pos 1536x0, 10b 0 [LOG] [OutputManagement] | sending current mode for DP-2: 3440x1440@59999 [LOG] Registered signal for owner 620dbb0: 6963278 -> 620dbb8 (owner: CRenderbuffer) [wlr] [backend/drm/drm.c:875] connector eDP-1: Failed to page-flip output: a page-flip is already pending [LOG] [OutputManagement] Creating new configuration [LOG] [OutputManagement] enableHead on eDP-1. For now, doing nothing. Waiting for apply(). [LOG] [OutputManagement] | configHead for eDP-1: set scale to 1.25 [LOG] [OutputManagement] | configHead for eDP-1: set pos to 0, 288 [LOG] [OutputManagement] | configHead for eDP-1: set transform to 0 [LOG] [OutputManagement] Applying configuration [LOG] [OutputManagement] Applying config for monitor eDP-1 [LOG] [OutputManagement] Applied configuration [LOG] Applying monitor rule for eDP-1 [LOG] Not applying a new rule to eDP-1 because it's already applied! [LOG] Applying monitor rule for DP-2 [LOG] Setting preferred mode for DP-2 [LOG] output DP-2 succeeded basic test on format DRM_FORMAT_XRGB8888 [LOG] arrangeMonitors: 2 to arrange [LOG] arrangeMonitors: DP-2 explicit [1536, 0] [LOG] arrangeMonitors: eDP-1 explicit [0, 288] [LOG] arrangeMonitors: DP-2 xwayland [0, 0] [LOG] arrangeMonitors: eDP-1 xwayland [3440, 0] [LOG] Monitor DP-2 data dump: res 3440x1440@60.00Hz, scale 1.00, transform 0, pos 1536x0, 10b 0 [LOG] [OutputManagement] | sending current mode for DP-2: 3440x1440@59999 [LOG] LayerSurface 3f7db30 mapped [LOG] Registered signal for owner 2dd9fb0: 3f22b88 -> 2dda600 (owner: layerSurface) [LOG] Registered signal for owner 2dd9fb0: 6c13f78 -> 2dda4c8 (owner: layerSurface) [LOG] Registered signal for owner 2dd9fb0: 3f22b98 -> 2dda530 (owner: layerSurface) [LOG] Registered signal for owner 2dd9fb0: 3f22ba8 -> 2dda598 (owner: layerSurface) [LOG] Registered signal for owner 3172010: 6c13f88 -> 31721f0 (owner: CPopup Head) [LOG] Registered signal for owner 2dda290: 3f22bc8 -> 2dda328 (owner: CWLSurface) [LOG] Registered signal for owner 2dda290: 3f22b88 -> 2dda390 (owner: CWLSurface) [LOG] CWLSurface 2dda290 called init() [LOG] LayerSurface 6c13eb0 (namespace waybar layer 2) created on monitor eDP-1 ```

I think it might happen in more situations, but I've only been able to reproduce it consistently by closing and reopening the lid.

This might be related to #167.

alex-courtis commented 2 weeks ago

Thanks for the detailed information. I'll attempt a reproduction and get back to you.

alex-courtis commented 1 week ago

Apologies, not sure why that closed, reopening.