BlitterStudio / amiberry

Optimized Amiga emulator for Linux/macOS
https://amiberry.com
GNU General Public License v3.0
663 stars 90 forks source link

XDG_RUNTIME_DIR not set in the environment error #1072

Closed MrV2K closed 1 year ago

MrV2K commented 1 year ago

Describe the bug When I run Amiberry 5.6 in Diepi I get the following error when ever Amiberry starts or has to create a new window due to a resolution change. This causes the Amiberry screen to flicker and make the emulated Amiga stutter momentarily.

XDG_RUNTIME_DIR not set in the environment

To Reproduce Run the service or boot into Amiberry on DietPi. It happens on startup and when workbench or games/demos change resolution. A good example is Spaceballs - State of the Art.

Is there a simple fix?

Desktop (please complete the following information):

midwan commented 1 year ago

This is not an Amiberry error itself, but something coming from older versions of MESA if I remember correctly. It's harmless and can be ignored, however.

MichaIng commented 1 year ago

@MrV2K Are you still facing this? I think it is two dedicated issues:

  1. For XDG_RUNTIME_DIR to be set, systemd-logind needs to run:
    systemctl unmask systemd-logind
    apt install dbus
    systemctl start systemd-logind

    However, as midwan said, this should not cause any issues, and could be ignored.

  2. But you mean that the error (respectively any console output) is shown above the Amiberry GUI? If so, on which SBC does this happen? There are quite some reasons why Amiberry (or SDL or whatever) can produce output on the console, but this was never visible above the Amiberry GUI. What does make sense, and this is probably what you mean: While the resolution changes, the plain console is visual, hence whatever output is there, is then visible, until Amiberry pops up above it again. To solve this ultimately, any console output would need to be suppressed. I just don't like it, as it means that any possibly relevant error output is then lost as well, making debugging any real issues difficult.
MrV2K commented 1 year ago

@midwan midwan closed this as completed Apr 10, 2023

Thanks for the reply. Unfortunately the commands above didn't fix the problem. I'm now running Dietpi v8.24.1 and Amiberry v5.6.4 and it's still the same. You only see the output when Amiberry switches between RTG and normal Amiga resolutions and it's only for a fraction of a second. I was just hoping it could be got rid of.

MichaIng commented 1 year ago

Okay, I am pretty sure then it is just that you (expectedly) see the underlying console for a blink while the resolution switches. I played around a little to see whether we can avoid that somehow, but STDIN and STDOUT must both be attached to the active console for input and output (GUI) to work.

So we'd need to mute this error. Strange that logind does not help. The default XDG runtime dir for the root user is /run/user/0. Does that exist on your system? If not, does logind run?

journalctl -u systemd-logind

Generally we can also just create a custom dir and set this as XDG_RUNTIME_DIR from the systemd service. This would make us independent of logind. I'll also try to replicate this when I find time and test setting it manually.