tuxedocomputers / tuxedo-control-center

A tool to help you control performance, energy, fan and comfort settings on TUXEDO laptops.
GNU General Public License v3.0
486 stars 63 forks source link

tccd "Can't open display --current" errors on Tuxedo Sirius 16 Gen 1 on Fedora KDE Wayland, eventually leading to display crash #380

Open akien-mga opened 2 months ago

akien-mga commented 2 months ago

In recent days I've experienced 3 seemingly random display crashes (everything turns black and I need to hard reboot the laptop) on my Tuxedo Sirius 16 Gen 1, running Fedora 39 with tuxedo-control-center and tuxedo-drivers from your Fedora repository.

Looking at the journalctl output today after such an event, I see a lot of those errors for a long time until the ultimate "crash" of the display:

Apr 16 09:47:30 fedora tccd[1623]: Can't open display --current
Apr 16 09:47:30 fedora tccd[1623]: Failed executing onWork() => Error: Command failed: export XAUTHORITY= && xrandr -q -display  --current
Apr 16 09:47:30 fedora tccd[1623]: Can't open display --current

This seems to repeat every 5 s, all the way until:

Apr 16 10:44:38 fedora tccd[1623]: Can't open display --current
Apr 16 10:44:38 fedora tccd[1623]: Failed executing onWork() => Error: Command failed: export XAUTHORITY= && xrandr -q -display  --current
Apr 16 10:44:38 fedora tccd[1623]: Can't open display --current

when the log stops. I assume that's when I hard rebooted the laptop a few seconds after the display crashes, but I don't see any obvious kernel messages in the log that would refer to that "crash".

Here's the full journalctl -b -1 for that boot: journalctl-sirius16-gen1-fedora39-tccd-errors.log

I can't say for sure that those errors are linked to the "crash" I experience, but it sounds plausible.

Let me know if there are other logs I could provide with more info.

I can confirm that running the command tccd tries to run fails even while the system is working as expected:

$ export XAUTHORITY= && xrandr -q -display  --current
Can't open display --current
$ xrandr -q -display  --current
Can't open display --current

I'm not sure xrandr works at all on Wayland?


Worth noting, I'm running Fedora 39 KDE Wayland, with its vanilla kernel 6.8.5-201.fc39 patched with one Sirius 16 specific patch I found in the Tuxedo kernel, see https://www.reddit.com/r/tuxedocomputers/comments/1c33qbc/fedora_kernel_with_tuxedo_patches_on_fedora_copr/ for details.

I was using the same on top of Fedora 39's kernel 6.7.x series, so it may be that the few display "crashes" I experienced in recent days coincide with moving to the 6.8.x branch.

tuxedoder commented 1 month ago

I doubt that running xrandr in wayland will produce a crash since I never managed to do it myself, but this looks like a bug indeed. The command is supposed to be export XAUTHORITY=${this.xAuthorityFile} && xrandr -q -display ${this.displayEnvVariable} --current and the variables seem empty. Not sure how to reproduce this issue and why this is happening yet. xrandr isn't even supposed to run while wayland is active. Did you somehow switch between x11 and wayland? This does happen in the middle of the log and not after tccd starts.

akien-mga commented 1 month ago

Not sure how to reproduce this issue and why this is happening yet. xrandr isn't even supposed to run while wayland is active. Did you somehow switch between x11 and wayland? This does happen in the middle of the log and not after tccd starts.

Hm that's a good question. Fedora 39's KDE build defaults to X11, and I changed the session to Wayland, but I believe SDDM doesn't follow the same setting and would still be X11. IIRC I tried and failed to properly switch SDDM to Wayland, which might be why the logs show that it's changing session type.

I'm now upgraded to Fedora 40 which defaults to Wayland for the KDE spin, so I believe both SDDM and KDE itself are in sync. I haven't re-experienced the above issue after upgrading, so that might have helped. (I had other crashes and power/GPU issues, but I think they're a separate problem or a different scope at least.)