User Tools

Site Tools


doc:appunti:hardware:raspberrypi_micromediahub

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:hardware:raspberrypi_micromediahub [2017/12/24 07:59] – [Starting Kodi at Boot] niccolodoc:appunti:hardware:raspberrypi_micromediahub [2020/09/28 20:45] (current) – [Kodi] niccolo
Line 9: Line 9:
   * Joystick controller   * Joystick controller
   * LCD display 16x2 charaters   * LCD display 16x2 charaters
 +
 +====== Current consumption ======
 +
 +See **[[https://www.raspberrypi.org/documentation/faqs/#powerReqs|FAQS PowerReqs]]**.
 +
 +  * **Raspberry Pi 3 Model B**
 +    * 1GB RAM
 +    * Typical bare-board active current consumption: 400mA
 +    * Maximum total USB peripheral current draw: 1.2A
 +    * Recommended PSU current capacity: 2.5A
 +  * **Raspberry Pi 3 Model A+**
 +    * 512MB LPDDR2 SDRAM
 +    * Typical bare-board active current consumption: 350mA
 +    * Maximum total USB peripheral current draw: Limited by PSU, board, and connector ratings only.
 +  * **Toshiba Canvio Basics 1Tb**
 +    * USB bus power (max. 900mA)
  
 ====== Kodi ====== ====== Kodi ======
Line 20: Line 36:
 Kodi will not start automatically at boot, just execute **kodi-standalone** from the command line. Kodi will not start automatically at boot, just execute **kodi-standalone** from the command line.
  
-**NOTICE**: Raspbian includes **Kodi version 17.6** whereas Debian Stretch has Kodi 17.1so beware of what packages you are installing and respect the right dependencies.+**NOTICE**: Raspbian based on **Debian Stretch 9.11** uses two repositories: 
 + 
 +  * **[[http://raspbian.raspberrypi.org/raspbian/]]** (by file /etc/apt/sources.list) 
 +  * **[[http://archive.raspberrypi.org/debian/]]** (by file /etc/apt/sources.list.d/raspi.list) 
 + 
 +The first repository provides **Kodi 17.1** as per Debian Stretch. The second repository provided **Kodi version 17.6** on December 2017but it was upgraded to **Kodi version 18** on february 2019. So beware of what packages you are installingrespect the right dependencies and be carefull with upgrades. 
 + 
 +Our current installation uses these versions: 
 + 
 +^ kodi                         | 2:17.6-2~stretch 
 +^ kodi-bin                     | 2:17.6-2~stretch 
 +^ kodi-eventclients-common     | 2:18.1-1~stretch 
 +^ kodi-eventclients-kodi-send  | 2:18.1-1~stretch 
 +^ kodi-peripheral-joystick     | 1.3.4-1~stretch   | 
 +^ libkodiplatform17:armhf      | 17.4.0~stretch    |
  
 +To activate a joypad you have to go through **//Settings//** => //System settings// => //Input// => **//Configure attacched controllers//**.
 ===== Starting Kodi at Boot ===== ===== Starting Kodi at Boot =====
  
Line 32: Line 63:
   * Can perform **reboot** and **poweroff** from Kodi menu.   * 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:+So we want to execute **kodi-standalone** as **kodi** user. Create that user firstand assign him to the required groups:
  
 <code> <code>
Line 75: Line 106:
 </code> </code>
  
-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 show only the **Exit** item. We need two piece of software: **policykit-1** and **consolekit**. The first package contains the framework which handles the authorizations, accordinf to the Freedesktop.org guidelines. The second one is required to allow some actions even if the running process does not have a console terminal allocated to it.+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 piece of software: **policykit-1**. This package contains the framework which handles the authorizations, according to the Freedesktop.org guidelines.
  
 <code> <code>
-apt-get install policykit-1 consolekit+apt-get install policykit-1
 </code> </code>
  
-Finally we create two files. The first one **/etc/polkit-1/localauthority/50-local.d/50-kodi.pkla** allows the Kodi user to execute some privileged actions:+We created the file **/etc/polkit-1/localauthority/50-local.d/50-kodi.pkla**, which  allows the Kodi user to execute some privileged actions:
  
 <file> <file>
 [Actions for kodi user] [Actions for kodi user]
 Identity=unix-group:kodi Identity=unix-group:kodi
-Action=Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*+Action=org.freedesktop.upower.*;org.freedesktop.udisks.*;org.freedesktop.login1*
 ResultActive=yes ResultActive=yes
 ResultAny=yes ResultAny=yes
Line 92: Line 123:
 </file> </file>
  
-The second one **/etc/polkit-1/localauthority/50-local.d/power.pkla**, allows all the users belonging to the **plugdev** group to perform what? FIXME:+===== Problem Decoding Webm (VP8 Encoded) Videos =====
  
-<file> +We got a severe problem trying to play some **.webm** video filesthe audio starts but it freeze shortly, the video does not start at allAfter that, all the Kodi interface was frozen and we need to reboot (ssh access still working)Into kodi.log we get the following error:
-[Allow consolekit] +
-Identity=unix-group:plugdev +
-Action=org.freedesktop.consolekit* +
-ResultAny=yes +
-ResultInactive=no +
-ResultActive=yes+
  
-[Allow login1] +<code> 
-Identity=unix-group:plugdev +CMMALVideo::Open Failed to commit format for decoder 
-Action=org.freedesktop.login1* +    input port vc.ril.video_decode:in:0(VP8 ) (status=3 EINVAL) 
-ResultAny=yes +</code>
-ResultInactive=no +
-ResultActive=yes+
  
-[Allow Upower+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://kodi.wiki/view/Raspberry_Pi_FAQ|Kodi Wiki]]** says that VP8 is supported on the Raspberry Pi architecture, so we are searching for the problem somewhere else. 
-Identity=unix-group:plugdev + 
-Action=org.freedesktop.upower+**[[https://forum.kodi.tv/showthread.php?tid=204239|This post]]** says that VP8 hardware (GPU) decoding is supported only if firmware **start_x.elf** is loaded//Note that GPU accelerated software codecs (and camera) are only available from start_x.elf. Add start_x=1 to config.txt (or use raspi-config and enable camera)//This means that we have to add the following line in **/boot/config.txt** (The required file is already in the ''/boot'' directory): 
-ResultAny=yes + 
-ResultInactive=no +<file> 
-ResultActive=yes+start_x=1
 </file> </file>
  
-Missing the **consolekit** part of the recipe - in our experienece - resulted into the kodi user to be authorized to the //power// actions **only if he was logged into a text conole** (actually logging-in as root, executing ''su'' to kodi and launching ''kodi-standalone'')To gain the //power// privileges even if starting ''kodi-standalone'' from a systemd service or from a remote login, you need the **consolekit** recipe above.+See also the page **[[https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md|Boot options in config.txt]]**. We have also **gpu_mem=128** in the same config file. 
 +===== 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 **[[..:linux:sa:systemd#starting_a_service_when_a_filesystem_is_available_an_mounted|this paragrph]]** on how to configure systemd unit for that purpose. 
 + 
 +==== Web References ==== 
 + 
 +  * [[https://www.raspberrypi.org/forums/viewtopic.php?t=108209|Kodi 14.2 Shutdown Functions not available - Raspian]] 
 +  [[https://www.raspberrypi.org/forums/viewtopic.php?t=131647|Autostart Kodi in Raspbian Jessie]] 
 +  [[https://gist.github.com/Cyberek/33af1b92c071791a71aa8bccf87b8a3a|Starting Kodi automatically on Raspbian Jessie and Stretch]] 
 +  [[https://unix.stackexchange.com/questions/395914/kodi-standalone-no-possibilty-for-poweroff-and-reboot|kodi-standalone no possibilty for poweroff and reboot]] 
 +  * [[https://forum.kodi.tv/showthread.php?tid=313432|Shutdown does not work when Kodi autoboots with the Pi]] 
 +  * [[http://kodi.wiki/view/HOW-TO:Autostart_Kodi_for_Linux#Add_a_new_systemd_script|Archive:HOW-TO:Autostart Kodi for Linux]] 
 ====== USB 3.0 VIA Labs Hub Problems ====== ====== USB 3.0 VIA Labs Hub Problems ======
  
doc/appunti/hardware/raspberrypi_micromediahub.1514098792.txt.gz · Last modified: 2017/12/24 07:59 by niccolo