mowman
Posts: 9
Joined: Sat Jun 02, 2018 6:58 pm

Re: [Guide] Kodi on Raspbian Stretch

Tue Mar 19, 2019 10:18 pm

My Kodi directly autostarts shortly after boot with no desktop. I believe this is done by a service, which was part of the (official?) package from a few versions ago, but it was so long ago I don't recall the details. I imagine the service uses "kodi-standalone" since auto-mounting worked with Kodi 17? I'll try to see how the service works. This is all with FAT16/32.

Rascas
Posts: 512
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Stretch

Tue Mar 19, 2019 10:23 pm

mowman wrote:
Tue Mar 19, 2019 10:18 pm
My Kodi directly autostarts shortly after boot with no desktop. I believe this is done by a service, which was part of the (official?) package from a few versions ago, but it was so long ago I don't recall the details. I imagine the service uses "kodi-standalone" since auto-mounting worked with Kodi 17? I'll try to see how the service works. This is all with FAT16/32.
Check if it is running "kodi" or kodi-standalone". Also check /var/log/syslog for errors. If the disks get errors (can happen if they are not unmounted correctly or there is a power loss) connect them to a computer with Windows, check for errors, and try again.

mowman
Posts: 9
Joined: Sat Jun 02, 2018 6:58 pm

Re: [Guide] Kodi on Raspbian Stretch

Tue Mar 19, 2019 10:36 pm

Looks like the service executes the correct command:

Code: Select all

[email protected]:~ $ cat /etc/init.d/kodi
#! /bin/sh
### BEGIN INIT INFO
# Provides:          kodi
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: XBMC media centre
# Description:       Starts the XBMC media centre in standalone mode
### END INIT INFO

# Author: Michael Gorven <[email protected]>

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="media centre"
NAME=kodi
STARTAS=/usr/bin/kodi-standalone
DAEMON=/bin/sh
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
GEOMETRY=/var/run/kodi.fbset
...
And it looks like the kernel does attach the disk:

Code: Select all

Mar 19 15:31:19 RPi2 kernel: [63486.150030] usb 1-1.4: new high-speed USB device number 6 using dwc_otg
Mar 19 15:31:19 RPi2 kernel: [63486.282549] usb 1-1.4: New USB device found, idVendor=18a5, idProduct=0302
Mar 19 15:31:19 RPi2 kernel: [63486.282567] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 19 15:31:19 RPi2 kernel: [63486.282578] usb 1-1.4: Product: STORE N GO
Mar 19 15:31:19 RPi2 kernel: [63486.282589] usb 1-1.4: Manufacturer: Verbatim
Mar 19 15:31:19 RPi2 kernel: [63486.282600] usb 1-1.4: SerialNumber: XXXXXXXXXXXXXXX
Mar 19 15:31:19 RPi2 kernel: [63486.283864] usb-storage 1-1.4:1.0: USB Mass Storage device detected
Mar 19 15:31:19 RPi2 kernel: [63486.284546] scsi host0: usb-storage 1-1.4:1.0
Mar 19 15:31:19 RPi2 systemd-udevd[1806]: failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6': No such file or directory
Mar 19 15:31:19 RPi2 kernel: [63486.373739] usbcore: registered new interface driver uas
Mar 19 15:31:21 RPi2 kernel: [63487.714157] scsi 0:0:0:0: Direct-Access     Verbatim STORE N GO       1100 PQ: 0 ANSI: 4
Mar 19 15:31:21 RPi2 kernel: [63487.722463] sd 0:0:0:0: [sda] 30515200 512-byte logical blocks: (15.6 GB/14.6 GiB)
Mar 19 15:31:21 RPi2 kernel: [63487.724022] sd 0:0:0:0: [sda] Write Protect is off
Mar 19 15:31:21 RPi2 kernel: [63487.724046] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
Mar 19 15:31:21 RPi2 kernel: [63487.725506] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Mar 19 15:31:21 RPi2 kernel: [63487.738858]  sda: sda1
Mar 19 15:31:21 RPi2 kernel: [63487.739562] sd 0:0:0:0: Attached scsi generic sg0 type 0
Mar 19 15:31:21 RPi2 kernel: [63487.744665] sd 0:0:0:0: [sda] Attached SCSI removable disk

mowman
Posts: 9
Joined: Sat Jun 02, 2018 6:58 pm

Re: [Guide] Kodi on Raspbian Stretch

Tue Apr 09, 2019 4:08 pm

Kodi mounts my USB drives fine if I exit Kodi and then launch it with 'kodi-standalone' from a command shell.

In an attempt to get USB drives working after Kodi is autolaunched at boot, I changed my deprecated launch service to systemd, essentially as described in this comment, except I run Kodi as User pi.

Code: Select all

[email protected]:~ $ systemctl status kodi
● kodi.service - Kodi Media Center
   Loaded: loaded (/etc/systemd/system/kodi.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-04-08 17:18:06 PDT; 6min ago
 Main PID: 604 (kodi-standalone)
   CGroup: /system.slice/kodi.service
           ├─604 /bin/sh /usr/bin/kodi-standalone
           ├─608 /bin/sh /usr/bin/kodi --standalone
           └─639 /usr/lib/arm-linux-gnueabihf/kodi/kodi-rbpi_v7 --lircdev /var/run/lirc/lircd --standalone
[email protected]:~ $ id pi
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),101(input),108(netdev),999(spi),998(i2c),997(gpio)
But Kodi autolaunched by systemd behaves the same way without USB drives mounting.

Does anyone have any ideas where to go from here? Can anyone replicate an issue with Kodi mounting inserted USB drives when Kodi itself is launched at boot by a service?

Rascas
Posts: 512
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Stretch

Tue Apr 09, 2019 4:50 pm

mowman wrote:
Tue Apr 09, 2019 4:08 pm
Kodi mounts my USB drives fine if I exit Kodi and then launch it with 'kodi-standalone' from a command shell.

In an attempt to get USB drives working after Kodi is autolaunched at boot, I changed my deprecated launch service to systemd, essentially as described in this comment, except I run Kodi as User pi.

Code: Select all

[email protected]:~ $ systemctl status kodi
● kodi.service - Kodi Media Center
   Loaded: loaded (/etc/systemd/system/kodi.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-04-08 17:18:06 PDT; 6min ago
 Main PID: 604 (kodi-standalone)
   CGroup: /system.slice/kodi.service
           ├─604 /bin/sh /usr/bin/kodi-standalone
           ├─608 /bin/sh /usr/bin/kodi --standalone
           └─639 /usr/lib/arm-linux-gnueabihf/kodi/kodi-rbpi_v7 --lircdev /var/run/lirc/lircd --standalone
[email protected]:~ $ id pi
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),101(input),108(netdev),999(spi),998(i2c),997(gpio)
But Kodi autolaunched by systemd behaves the same way without USB drives mounting.

Does anyone have any ideas where to go from here? Can anyone replicate an issue with Kodi mounting inserted USB drives when Kodi itself is launched at boot by a service?
Check this:
viewtopic.php?f=66&t=192499&p=1240007#p1240007

mowman
Posts: 9
Joined: Sat Jun 02, 2018 6:58 pm

Re: [Guide] Kodi on Raspbian Stretch

Tue Apr 09, 2019 5:48 pm

Yay! Adding the polkit rule by creating /etc/polkit-1/localauthority/50-local.d/automount.pkla as detailed in your link restores USB mounting. I'm not sure why Krypton didn't need this configuration. Thanks Rascas!

Edit: considering adding instructions to the AUTO-STARTING KODI AT BOOT: Option 1 (without desktop) section of the first post?

Rascas
Posts: 512
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Stretch

Tue May 07, 2019 4:56 pm

Kodi 18.2 is now available.

More info here:
https://kodi.tv/article/kodi-leia-182-release

Raspbian specific changes:
-Fixed audiodecoder/encoder binary addons

Rascas
Posts: 512
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: [Guide] Kodi on Raspbian Stretch

Sat May 18, 2019 1:48 am

First post updated with more information.

Return to “Raspbian”