dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
693 stars 29 forks source link

Supersonic sometimes crashes when monitors turn off #412

Open sochotnicky opened 2 weeks ago

sochotnicky commented 2 weeks ago

I can't reproduce it easily but sometimes supersonic crashes as follows (usually when I leave my desktop and monitors shut off using DPMS):

$ result/bin/supersonic
2024/07/02 08:48:19 Starting supersonic...
2024/07/02 08:48:19 Using config dir: /home/w0rm/.config/supersonic
2024/07/02 08:48:19 Using cache dir: /home/w0rm/.cache/supersonic
2024/07/02 08:48:19 failed to load theme file "": open /home/w0rm/.config/supersonic/themes: no such file or directory
X Error of failed request:  BadRRCrtc (invalid Crtc parameter)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  20 (RRGetCrtcInfo)
  Crtc id in failed request: 0x45c
  Serial number of failed request:  7138
  Current serial number in output stream:  7138

This seems related to glfw. And there's some nice debugging in https://github.com/kovidgoyal/kitty/issues/1006

Based on related commit https://github.com/kovidgoyal/kitty/commit/ab7f3310c4f7982026a897155eabb097683658b2 I think a similar fix in go-glfw might be needed in https://github.com/go-gl/glfw/blob/037f3cc74f2ab0b249928c4fc4b61e0f13befdb8/v3.3/glfw/glfw/src/x11_monitor.c#L152 ?

Thoughs?

Filing this here since this is "user-facing".

dweymouth commented 2 weeks ago

Is this a new problem in 0.12.0 or something that has been going on for awhile? Also what OS are you using and is it using X11 directly or Wayland (with Supersonic running through XWayland)?

sochotnicky commented 1 week ago

So in order: