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

Display's power status doesn't get detected properly #8293

Open
tibetiroka opened this issue Aug 14, 2024 · 4 comments
Open

Display's power status doesn't get detected properly #8293

tibetiroka opened this issue Aug 14, 2024 · 4 comments
Labels
bug Not working as intended

Comments

@tibetiroka
Copy link

tibetiroka commented Aug 14, 2024

  • Sway Version:

    • sway version 1.9
  • Debug Log:

  • Configuration File:

    • I'm not sure what the default configuration is, but this config definitely works:
    input type:keyboard xkb_layout "hu"
    exec xfce4-terminal
    
  • Description:

    • Have two displays plugged in; an HDMI display and a DVI-D display.
    • Turn the DVI-D display OFF, and the HDMI display ON.
    • Start sway.
    • Run swaymsg -t get_outputs.
    • See that both displays are listed as powered on.

For this reproduction, and for the debug log seen above, the DVI-D display way turned off via the power button, and physically unpowered using the switch on the monitor's back.

Since the display is present and listed as powered on, I get some applications that open on it by default. The cursor can also move over to the unpowered display, and I can move windows and workplaces between the two displays.

  • System info:
    • GPU: Radeon RX 570
swaymsg -t get_outputs
[
{
  "id": 3,
  "type": "output",
  "orientation": "none",
  "percent": 0.59999999999999998,
  "urgent": false,
  "marks": [],
  "layout": "output",
  "border": "none",
  "current_border_width": 0,
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "deco_rect": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "window_rect": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "geometry": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "name": "HDMI-A-1",
  "window": null,
  "nodes": [],
  "floating_nodes": [],
  "focus": [
    4
  ],
  "fullscreen_mode": 0,
  "sticky": false,
  "primary": false,
  "make": "Philips Consumer Electronics Company",
  "model": "PHL 243V7",
  "serial": "0x00002BDD",
  "modes": [
    {
      "width": 1920,
      "height": 1080,
      "refresh": 60000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1920,
      "height": 1080,
      "refresh": 74973,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1920,
      "height": 1080,
      "refresh": 60000,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 1920,
      "height": 1080,
      "refresh": 59940,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 1920,
      "height": 1080,
      "refresh": 50000,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 1680,
      "height": 1050,
      "refresh": 59883,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 1024,
      "refresh": 75025,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 1024,
      "refresh": 60020,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1440,
      "height": 900,
      "refresh": 59901,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 960,
      "refresh": 60000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 800,
      "refresh": 60000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 720,
      "refresh": 60000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 720,
      "refresh": 60000,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 1280,
      "height": 720,
      "refresh": 59940,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 1280,
      "height": 720,
      "refresh": 50000,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 1024,
      "height": 768,
      "refresh": 75029,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1024,
      "height": 768,
      "refresh": 70069,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1024,
      "height": 768,
      "refresh": 60004,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 832,
      "height": 624,
      "refresh": 74551,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 800,
      "height": 600,
      "refresh": 75000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 800,
      "height": 600,
      "refresh": 72188,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 800,
      "height": 600,
      "refresh": 60317,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 800,
      "height": 600,
      "refresh": 56250,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 720,
      "height": 576,
      "refresh": 50000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 720,
      "height": 576,
      "refresh": 50000,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 720,
      "height": 576,
      "refresh": 50000,
      "picture_aspect_ratio": "4:3"
    },
    {
      "width": 720,
      "height": 480,
      "refresh": 60000,
      "picture_aspect_ratio": "4:3"
    },
    {
      "width": 720,
      "height": 480,
      "refresh": 60000,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 720,
      "height": 480,
      "refresh": 59940,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 720,
      "height": 480,
      "refresh": 59940,
      "picture_aspect_ratio": "16:9"
    },
    {
      "width": 720,
      "height": 480,
      "refresh": 59940,
      "picture_aspect_ratio": "4:3"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 75000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 72809,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 66667,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 60000,
      "picture_aspect_ratio": "4:3"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 59940,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 59940,
      "picture_aspect_ratio": "4:3"
    },
    {
      "width": 720,
      "height": 400,
      "refresh": 70082,
      "picture_aspect_ratio": "none"
    }
  ],
  "non_desktop": false,
  "active": true,
  "dpms": true,
  "power": true,
  "scale": 1.0,
  "scale_filter": "nearest",
  "transform": "normal",
  "adaptive_sync_status": "disabled",
  "current_workspace": "1",
  "current_mode": {
    "width": 1920,
    "height": 1080,
    "refresh": 60000,
    "picture_aspect_ratio": "none"
  },
  "max_render_time": 0,
  "focused": true,
  "subpixel_hinting": "unknown"
},
{
  "id": 5,
  "type": "output",
  "orientation": "none",
  "percent": 0.3792592592592593,
  "urgent": false,
  "marks": [],
  "layout": "output",
  "border": "none",
  "current_border_width": 0,
  "rect": {
    "x": 1920,
    "y": 0,
    "width": 1280,
    "height": 1024
  },
  "deco_rect": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "window_rect": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "geometry": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "name": "DVI-D-1",
  "window": null,
  "nodes": [],
  "floating_nodes": [],
  "focus": [
    6
  ],
  "fullscreen_mode": 0,
  "sticky": false,
  "primary": false,
  "make": "Samsung Electric Company",
  "model": "SyncMaster",
  "serial": "HSHL906055",
  "modes": [
    {
      "width": 1280,
      "height": 1024,
      "refresh": 60020,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 1024,
      "refresh": 75025,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 800,
      "refresh": 60020,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1152,
      "height": 864,
      "refresh": 75000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1280,
      "height": 720,
      "refresh": 60020,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1024,
      "height": 768,
      "refresh": 75029,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1024,
      "height": 768,
      "refresh": 70069,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 1024,
      "height": 768,
      "refresh": 60004,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 832,
      "height": 624,
      "refresh": 74551,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 800,
      "height": 600,
      "refresh": 75000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 800,
      "height": 600,
      "refresh": 72188,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 800,
      "height": 600,
      "refresh": 60317,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 800,
      "height": 600,
      "refresh": 56250,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 75000,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 72809,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 66667,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 640,
      "height": 480,
      "refresh": 59940,
      "picture_aspect_ratio": "none"
    },
    {
      "width": 720,
      "height": 400,
      "refresh": 70082,
      "picture_aspect_ratio": "none"
    }
  ],
  "non_desktop": false,
  "active": true,
  "dpms": true,
  "power": true,
  "scale": 1.0,
  "scale_filter": "nearest",
  "transform": "normal",
  "adaptive_sync_status": "disabled",
  "current_workspace": "2",
  "current_mode": {
    "width": 1280,
    "height": 1024,
    "refresh": 60020,
    "picture_aspect_ratio": "none"
  },
  "max_render_time": 0,
  "focused": false,
  "subpixel_hinting": "unknown"
}
]

- Driver info:
glxinfo -B
name of display: :1
display: :1  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: AMD (0x1002)
    Device: AMD Radeon RX 570 Series (radeonsi, polaris10, LLVM 18.1.8, DRM 3.57, 6.10.4-arch2-1) (0x67df)
    Version: 24.1.5
    Accelerated: yes
    Video memory: 8192MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 2048 MB, largest block: 2048 MB
    VBO free aux. memory - total: 15229 MB, largest block: 15229 MB
    Texture free memory - total: 2048 MB, largest block: 2048 MB
    Texture free aux. memory - total: 15229 MB, largest block: 15229 MB
    Renderbuffer free memory - total: 2048 MB, largest block: 2048 MB
    Renderbuffer free aux. memory - total: 15229 MB, largest block: 15229 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 8192 MB
    Total available memory: 24195 MB
    Currently available dedicated video memory: 2048 MB
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon RX 570 Series (radeonsi, polaris10, LLVM 18.1.8, DRM 3.57, 6.10.4-arch2-1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.1.5-arch1.2
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.1.5-arch1.2
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.1.5-arch1.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
@tibetiroka tibetiroka added the bug Not working as intended label Aug 14, 2024
@sahinf
Copy link
Contributor

sahinf commented Sep 30, 2024

Before you launch sway, what's the output of drm_info | grep 'Status: c' -C 5?
Your log reports that wlr sees a valid connection coming from its backend, libdrm.

@tibetiroka
Copy link
Author

tibetiroka commented Oct 2, 2024

drm_info | grep 'Status: c' -C 5:

│ │ ├───"vrr_capable" (immutable): range [0, 1] = 0
│ │ └───"subconnector" (immutable): enum {Unknown, VGA, DVI-D, HDMI, DP, Wireless, Native} = Unknown
│ ├───Connector 1
│ │ ├───Object ID: 83
│ │ ├───Type: HDMI-A
│ │ ├───Status: connected
│ │ ├───Physical size: 530×300 mm
│ │ ├───Subpixel: unknown
│ │ ├───Encoders: {1}
│ │ ├───Modes
│ │ │ ├───1920×[email protected] preferred driver phsync pvsync
--
│ │ ├───"HDR_OUTPUT_METADATA": blob = 0
│ │ └───"vrr_capable" (immutable): range [0, 1] = 0
│ ├───Connector 2
│ │ ├───Object ID: 90
│ │ ├───Type: DVI-D
│ │ ├───Status: connected
│ │ ├───Physical size: 380×300 mm
│ │ ├───Subpixel: unknown
│ │ ├───Encoders: {2}
│ │ ├───Modes
│ │ │ ├───1280×[email protected] preferred driver phsync pvsync

The DVI-D display is turned off, the power switch on the back is turned off and the power cord is disconnected. The DVI cable is still plugged in, though. (It's an ancient Samsung SyncMaster 913TM, if that helps.)

IMG_20241002_193107.jpg

@sahinf
Copy link
Contributor

sahinf commented Oct 3, 2024

My monitors exhibit the same behavior and my testing led to even more confusion.
I connected a monitor to an hdmi port and turned it off, but drm reports that it's enabled. Only ddcutil correctly identified the monitor as off but I think that uses its own mechanism through the IC2 protocol. I can't find any straightforward answers on how to reliably check for power status.

Tests on my 100% turned off monitor

$ cd /sys/class/drm/card1-HDMI-A-1
$ cat dpms
On
$ cat enabled
enabled
$ cat status
connected
$ cat power/control
auto
$ cat power/runtime_status
unsupported

Maybe someone with more knowledge could chime in please.

@sahinf
Copy link
Contributor

sahinf commented Oct 3, 2024

If ddcutil capabilities reports

   Feature: D6 (Power mode)
      Values:
         01: DPM: On,  DPMS: Off
         04: DPM: Off, DPMS: Off
         05: Write only value to turn off display

ddcutil setvcp D6 01 can successfully turn off the monitor for good and sway will treat it as disconnected. So you won't have a workspace / plane in the powered off monitor.

But turning the monitor back on after launching sway doesn't update sway. The monitor is stuck showing the last frame (linux console before monitor turned off).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

2 participants