Code Monkey home page Code Monkey logo

Comments (8)

graysky2 avatar graysky2 commented on August 17, 2024

Ah, I see cage seems to require a user runtime_dir whereas xorg does not. I need to dig into the manual for cage but we can pass this environment variable to the service just pointing to /tmp for now it seems. Can you try this on your setup and let me know if everything (audio, video, etc.) is working?

As root add the following line under the [Service] section of /usr/lib/systemd/system/kodi-wayland.service

Environment="XDG_RUNTIME_DIR=/tmp"

from kodi-standalone-service.

alanorth avatar alanorth commented on August 17, 2024

Now kodi-wayland starts and sound works fine, but there is this message in the journal:

Dec 16 18:18:26 redacted systemd[1]: Started Kodi standalone (Wayland).
Dec 16 18:18:26 redacted cage[511]: 00:00:00.000 [ERROR] [backend/session/logind.c:665] User has no sessions
Dec 16 18:18:26 redacted cage[511]: 00:00:00.000 [ERROR] [backend/session/logind.c:724] Couldn't find an active session or a greeter session
Dec 16 18:18:29 redacted cage[535]: XDG_RUNTIME_DIR (/tmp) is not owned by us (uid 974), but by uid 0! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
Dec 16 18:18:29 redacted cage[535]: Connection failure: Connection refused
Dec 16 18:18:29 redacted cage[535]: pa_context_connect() failed: Connection refused
Dec 16 18:18:31 redacted cage[543]: XDG_RUNTIME_DIR (/tmp) is not owned by us (uid 974), but by uid 0! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)

Edit: I just switched to pipewire-pulse on my home theater PC where Kodi runs and sound works fine. Now the journal spam is reduced to:

Dec 16 18:22:41 redacted systemd[1]: Started Kodi standalone (Wayland).
Dec 16 18:22:41 redacted cage[511]: 00:00:00.000 [ERROR] [backend/session/logind.c:665] User has no sessions
Dec 16 18:22:41 redacted cage[511]: 00:00:00.000 [ERROR] [backend/session/logind.c:724] Couldn't find an active session or a greeter session
Dec 16 18:22:47 redacted cage[542]: XDG_RUNTIME_DIR (/tmp) is not owned by us (uid 974), but by uid 0! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)

from kodi-standalone-service.

graysky2 avatar graysky2 commented on August 17, 2024

I am not a wayland user. Can you explain the pipewire-pulse comment? As to the journalctl spam, this mess is due to the fact that the service is no longer running as a user process. If it does, when you shutdown your system (different from stopping kodi-wayland.service, systemd kills the processes without letting kodi write out configuration changes you may have made. It also kills them before kodi can update the systemtotaluptime in /var/lib/kodi/.kodi/userdata/guisettings.xml which is also lame.

See my recent commit comments for more but that in a nutshell is why I changed it. kodi-x11.service has a similar quirk. I am looking into a two service solution that might clean things up for x11 and wayland (gbm is fine as-is). See: https://bbs.archlinux.org/viewtopic.php?id=261763

from kodi-standalone-service.

alanorth avatar alanorth commented on August 17, 2024

I understand about the unclean shutdown, I've been following the updates. Thanks for the work you're doing on that. Also, I don't mind the journal spam. As to the issue reported here it seems to be enough to add the XDG_RUNTIME_DIR variable to the systemd service so this is solved. The warning about /tmp being owned by a different user is only a warning, though I wonder if there is something more systemd-y that we can do for the service. Perhaps PrivateTmp=yes?

Regarding the pipewire-pulse comment: pipewire is a new multimedia server that has reached maturity and it is able to completely replace pulseaudio with little to no changes in applications that were already using Pulseaudio. Sorry, I assumed you were following that because you're a pretty prolific Linux user. :P

from kodi-standalone-service.

graysky2 avatar graysky2 commented on August 17, 2024

I don't think the PrivateTmp matters, it still spams the journal. I will commit this as a temp fix. Thanks for reporting.

from kodi-standalone-service.

Ram-Z avatar Ram-Z commented on August 17, 2024

Could also use this, it'll handle creating a runtime dir with the correct permissions.

RuntimeDirectory=kodi
Environment=XDG_RUNTIME_DIR=%t/kodi

It should clean up after the unit is destroyed.

from kodi-standalone-service.

graysky2 avatar graysky2 commented on August 17, 2024

@Ram-Z - Is that in addition or in place of what is currently present?

from kodi-standalone-service.

Ram-Z avatar Ram-Z commented on August 17, 2024

A bit of both. ;)

Would need to add the RuntimeDirectory and replace the existing
Environment=XDG_RUNTIME_DIR=/tmp to point at %t/kodi.

from kodi-standalone-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.