retroarch-standalone-service/README.md

60 lines
3.6 KiB
Markdown
Raw Normal View History

2014-11-05 21:24:29 +01:00
# kodi-standalone-service
2020-05-14 12:54:22 +02:00
Systemd service units to run [Kodi](https://kodi.tv/) in standalone mode without the need for a DE. X11, Wayland, and GBM are supported.
Which one to choose?
2020-05-14 12:54:22 +02:00
In terms of functionality, X11 is probably the most mature and feature rich. Wayland is next in line and should be considered on-par with X11, however, a known limitation of Wayland is having the resolution and frame rate set in the compositor rather than in kodi's GUI. As well, Wayland currently does not support VT switching. GBM has some known features it lacks compared the X11 and Wayland. A complete list can be found in [Kodi issue 14876](https://github.com/xbmc/xbmc/issues/14876).
Another factor that may affect choice is the number of dependencies required to run which will vary distro-to-distro.
2014-11-05 21:24:29 +01:00
2017-03-09 20:52:05 +01:00
## Installation
### Arch Linux
2018-06-25 15:10:06 +02:00
Arch Linux users can find a PKGBUILD in the [AUR](https://aur.archlinux.org/packages/kodi-standalone-service) that will take care of everything. Simply install and use.
2020-05-14 12:54:22 +02:00
### ARM distros
2020-08-08 12:43:04 +02:00
Users of ARM distros such as Arch ARM, Raspberry Pi OS (formerly Raspbian), etc. should NOT use these files since their official corresponding kodi packages supply their own version of a service. If you are knowledgeable enough with your distro, feel free to use/modify.
2017-03-09 20:52:05 +01:00
2020-05-01 18:22:56 +02:00
### Ubuntu
For the kodi user to access devices on `/dev/ttyxxxx`, users will need to edit `init/sysusers.conf` and uncomment the line corresponding to enable membership in the dialout group.
### Other distros (manual installation)
Users of other distros should install the following files:
2017-03-09 20:52:05 +01:00
2020-05-14 12:54:22 +02:00
* `init/*.service` to `/usr/lib/systemd/system/`
* `init/sysusers.conf` to `/usr/lib/sysusers.d/`, then run `systemd-sysusers`
* `init/tmpfiles.conf` to `/usr/lib/tmpfiles.d/`, then run `systemd-tmpfiles --create`
2017-03-09 20:52:05 +01:00
2018-06-25 15:10:06 +02:00
Note that the kodi user's home directory is `/var/lib/kodi/` in this example, NOT `/home/kodi/` like a regular user.
2017-03-09 20:52:05 +01:00
## Usage
2020-05-14 12:54:22 +02:00
Simply [start/enable](https://wiki.archlinux.org/index.php/Systemd#Using_units) the requisite service.
2017-03-09 20:52:05 +01:00
2020-05-01 18:22:56 +02:00
## Dependencies
2020-05-14 12:54:22 +02:00
* kodi (x11 or wayland or gbm)
* libinput and cage (for running wayland)
2019-04-29 16:38:00 +02:00
* libinput (for running gbm)
* polkit
* xorg-server and xorg-xinit (for running x11)
2014-11-05 21:24:29 +01:00
## Passing environment variables to the service
Should the need arise, one can pass environment variables to the service by creating `/etc/conf.d/kodi-standalone` and populating it with the needed variables.
2018-06-25 15:10:06 +02:00
## Acknowledgments
Much of the credit for this service goes to the Arch Linux maintainers of the official kodi package. Note that they removed it upon the [1.16-1 release of Xorg](https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/xbmc&id=9763c6d32678f3a3f45c195bfae92eee209d504f).
## Tips and Tricks
### Service not starting
2018-01-12 14:38:37 +01:00
Most users should not need `/etc/X11/Xwrapper.config` since the created X server becomes the [controlling process](http://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardInput=) of the VT to which it is bound. Most users does not mean all users. There have been reports of some AMD users still requiring this file. As well, users of Xorg's native modesetting driver may also require it.
The recommendation is to first try starting `kodi-x11.service` without it, but if the service fails to start X, you may need to create `/etc/X11/Xwrapper.config` which should contain the following:
```
needs_root_rights = yes
```
2015-01-01 19:33:28 +01:00
2018-06-25 15:10:06 +02:00
### Running Kodi web service on a privileged port
Users wishing to run the kodi web service on a privileged port (i.e. <1024) can simply use a [systemd drop-in](https://wiki.archlinux.org/index.php/Systemd#Drop-in_files) modification as follows:
```
[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
```