doc:appunti:hardware:raspberrypi_micromediahub
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
doc:appunti:hardware:raspberrypi_micromediahub [2017/12/22 09:30] – [Rapberry Pi Micro Media-Hub] niccolo | doc:appunti:hardware:raspberrypi_micromediahub [2019/11/03 17:32] – [Kodi] niccolo | ||
---|---|---|---|
Line 18: | Line 18: | ||
* kodi-peripheral-joystick | * kodi-peripheral-joystick | ||
- | Kodi will not start automatically at boot, just execute **kodi** from the command line. | + | Kodi will not start automatically at boot, just execute **kodi-standalone** from the command line. |
- | **NOTICE**: Raspbian | + | **NOTICE**: Raspbian |
- | FIXME: How to start Kodi at boot. How to run Kodi as unpriviliged | + | * **[[http:// |
+ | * **[[http:// | ||
+ | |||
+ | The first repository provides **Kodi 17.1** as per Debian Stretch. The second repository provided **Kodi version 17.6** on December 2017, but it was upgraded | ||
+ | |||
+ | Our current installation uses these versions: | ||
+ | |||
+ | ^ kodi | 2: | ||
+ | ^ kodi-bin | ||
+ | ^ kodi-eventclients-common | ||
+ | ^ kodi-eventclients-kodi-send | ||
+ | ^ kodi-peripheral-joystick | ||
+ | ^ libkodiplatform17: | ||
+ | |||
+ | To activate a joypad you have to go through **// | ||
+ | ===== Starting | ||
+ | |||
+ | There are several recipes on the internet to start Kodi on boot; we searched one with the following features: | ||
+ | |||
+ | * **Does not require xserver.xorg**, as we have installed Raspbian Stretch Lite. | ||
+ | * Run Kodi as **unprivileged** user. | ||
+ | * **Run as a service**, do not use autologin and autostart tricks. | ||
+ | * Should be compliant with the underlying init system, which is **systemd** in Raspbian Stretch. | ||
+ | * Can perform **reboot** and **poweroff** from Kodi menu. | ||
+ | |||
+ | So we want to execute **kodi-standalone** as **kodi** user. Create that user first, and assign him to the required groups: | ||
+ | |||
+ | < | ||
+ | adduser --disabled-password --gecos " | ||
+ | adduser kodi audio | ||
+ | adduser kodi video | ||
+ | adduser kodi plugdev | ||
+ | adduser kodi input | ||
+ | </ | ||
+ | |||
+ | Then we created a **systemd** unit file **/ | ||
+ | |||
+ | < | ||
+ | [Unit] | ||
+ | Description = Kodi Media Center | ||
+ | |||
+ | # if you don't need the MySQL DB backend, this should be sufficient | ||
+ | After = systemd-user-sessions.service network.target sound.target | ||
+ | |||
+ | # if you need the MySQL DB backend, use this block instead of the previous | ||
+ | # After = systemd-user-sessions.service network.target sound.target mysql.service | ||
+ | # Wants = mysql.service | ||
+ | |||
+ | [Service] | ||
+ | User = kodi | ||
+ | Group = kodi | ||
+ | Type = simple | ||
+ | ExecStart = / | ||
+ | Restart = always | ||
+ | RestartSec = 15 | ||
+ | |||
+ | [Install] | ||
+ | WantedBy = multi-user.target | ||
+ | </ | ||
+ | |||
+ | To actually enable and start the service, run: | ||
+ | |||
+ | < | ||
+ | systemctl daemon-reload | ||
+ | systemctl enable kodi.service | ||
+ | systemctl start kodi.service | ||
+ | </ | ||
+ | |||
+ | Now we have to solve a problem: the unprivileged Kodi user cannot perform reboot and poweroff actions: as you can se the exit menu of Kodi shows only the **Exit** item. We need a piece of software: **policykit-1**. This package contains the framework which handles the authorizations, | ||
+ | |||
+ | < | ||
+ | apt-get install policykit-1 | ||
+ | </ | ||
+ | |||
+ | We created the file **/ | ||
+ | |||
+ | < | ||
+ | [Actions for kodi user] | ||
+ | Identity=unix-group: | ||
+ | Action=org.freedesktop.upower.*; | ||
+ | ResultActive=yes | ||
+ | ResultAny=yes | ||
+ | ResultInactive=no | ||
+ | </ | ||
+ | |||
+ | ===== Problem Decoding Webm (VP8 Encoded) Videos ===== | ||
+ | |||
+ | We got a severe problem trying to play some **.webm** video files: the audio starts but it freeze shortly, the video does not start at all. After that, all the Kodi interface was frozen and we need to reboot (ssh access still working). Into kodi.log we get the following error: | ||
+ | |||
+ | < | ||
+ | CMMALVideo:: | ||
+ | input port vc.ril.video_decode: | ||
+ | </ | ||
+ | |||
+ | To confirm that the video codec is VP8, we installed the **mediainfo** package an run the tool against the video; which actually uses the VP8 codec. The official **[[http:// | ||
+ | |||
+ | **[[https:// | ||
+ | |||
+ | < | ||
+ | start_x=1 | ||
+ | </ | ||
+ | |||
+ | See also the page **[[https:// | ||
+ | ===== Starting Kodi only if USB hard disk is present ===== | ||
+ | |||
+ | We keep all our media files (video, images, etc.) into an **USB hard disk**, connected through a powered USB hub. It can be possible that **the Raspberry Pi will be started without the disk attached**. In this case we want **no Kodi service** to be started. See **[[..: | ||
+ | |||
+ | ==== Web References ==== | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
====== USB 3.0 VIA Labs Hub Problems ====== | ====== USB 3.0 VIA Labs Hub Problems ====== |
doc/appunti/hardware/raspberrypi_micromediahub.txt · Last modified: 2020/09/28 18:45 by niccolo