swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.72k stars 1.11k forks source link

Primary screen is black on Sway startup in a dual monitor setup #8424

Open maxigaz opened 2 weeks ago

maxigaz commented 2 weeks ago

Please fill out the following:

  1. Have both a VGA monitor and an A/V receiver (connected through HDMI) turned on.
  2. Start a Sway session.

Explanation: I have an old AMD graphics card (HD6670) with a VGA and an HDMI output. The VGA output is connected to a monitor while the HDMI output is connected to a Yahama A/V receiver. The latter is only used for audio, not video, although Sway recognizes it as a second monitor.

This used to be perfectly functional with Sway 1.9. With Sway 1.10 running on Arch Linux, when I log in, the monitor is completely black, and it stays that way no matter what I do with the mouse or keyboard.

A workaround to that is to switch channels on my A/V receiver (which Sway interprets as if the second monitor has been switched off, I assume). The result is that the blackness is gone and Sway works again as normal.

Another workaround is to switch to TTY2 and run pkill sway.

maxigaz commented 2 weeks ago

Here's another scenario, which is likely to be related:

  1. Have only the VGA monitor turned on.
  2. Start a Sway session.
  3. Turn on the A/V receiver or change its input to HDMI.

Result: Sway visually freezes while the rest of the system remains operational.

If I do the first workaround I mentioned in the OP, Sway unfreezes. (If I typed anything in a terminal window while Sway was frozen, it suddenly appears on the screen.)

egnappahz commented 2 weeks ago

The order of workspaces (monitors) has changed with the new sway version (other numbers), perhaps you need to redefine the outputs in the sway config?

maxigaz commented 2 weeks ago

The order of workspaces (monitors) has changed with the new sway version (other numbers), perhaps you need to redefine the outputs in the sway config?

If that's the case, I'm not sure what needs to be redefined. (If you have any specific hints, I could give them a try.)

What I do know is that when I first started using this setup (not having configured any outputs at the time), I definitely didn't experience any freezes or black screens. And now, as I mentioned in my first post, I'm experiencing the issue even with the default Sway configuration, which doesn't have any outputs defined.

egnappahz commented 2 weeks ago

There are a lot of problems going on at the same time in latest sway, for example

maxigaz commented 2 weeks ago

WLR_SCENE_DISABLE_DIRECT_SCANOUT=1

I've just tried running Sway with this set. It doesn't seem to make any difference. Thank you anyway!

emersion commented 14 hours ago

Sounds like a duplicate of https://github.com/swaywm/sway/issues/8442:

00:00:00.370 [ERROR] [wlr] [backend/drm/legacy.c:175] connector HDMI-A-1: drmModePageFlip failed: Device or resource busy
00:00:00.370 [ERROR] [sway/config/output.c:923] Backend commit failed