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

[Guide] Kodi on Raspbian Stretch [Recover]

Wed Sep 04, 2019 3:25 pm

1st NOTE:

This is a reproduction of the original topic which was accidentally deleted. For a copy of the original one see here:
https://web.archive.org/web/20190722103 ... 6&t=192499

Kodi on Raspbian Buster
For a temporary way to install Kodi 18.X on Raspbian Buster, only for Raspberry Pi 3 and below for now, see post #3 of this thread.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


INTRO:

After so many posts about people getting problems on installing Kodi on Raspbian, specially on the new Raspbian Stretch, this is a complete guide on how to do it, and an attempt to keep things together in the same place. You will see that after all, it is not so hard.

In the time of the first Raspbian Stretch image released by the RPi Foundation, there was only available the generic Debian Kodi version (17.1) which is compiled against OpenGL, so not optimal to run on the RPi (at least by this time), it runs very slow. But now, the latest stable version is available on the repos, compiled against OpenGLES, optimized for the RPi.


Latest stable version available on Raspbian:
Kodi 18.2 Leia


INSTALLATION:

To install it you first need to update/refresh packages, and then install the main package. This can be done in a virtual terminal by running the respective commands:

Code: Select all

sudo apt-get update

Code: Select all

sudo apt-get install kodi
Take note that Kodi on Raspbian, like most Debian based OSs, is divided into many packages, so you can install only what you really need. Besides the main package, you will find many "binary addons" packages which provide additional features to Kodi. For example, PVRs, Joystick support, Inputstreams, Visualizations, etc. You can easily search for aditional packages by running:

Code: Select all

apt-cache search kodi
And install what you want.
For example in this case, we will install the joystick support, IPTV Simple PVR and the inputstream addons:

Code: Select all

sudo apt-get install kodi-peripheral-joystick kodi-pvr-iptvsimple kodi-inputstream-adaptive kodi-inputstream-rtmp
After that, restart Kodi and check if the binary addons are enabled in Kodi interface, if not, enable them.

Here are some more recommend binary addons to install (only for Kodi 18 and above):
-kodi-vfs-libarchive - compressed files support
-kodi-vfs-nfs - NFS support
-kodi-vfs-sftp - SFTP support

Alternatively and easier, if you are running Raspbian with Desktop, you can just open the graphical package manager "Dont know the name of it" on the upper left corner menu, search for "Kodi" and install the packages you want.


TWEAKS:

This is very important!

-Kodi on Raspbian requires a minimum of 160 MB of RAM dedicated to the GPU to function properly! This can be done by running "raspi-config" -> "Advanced Options" -> "Memory Split" -> 160.

-If you have a RPi 2/3, the recommended is 256 MB of RAM for the GPU.

-Kodi 18 on the Raspberry Pi now supports 10bit video files (at least h264 and h265) but they are software decoded. The Pi 3B / 3B+ may do 720p 10bit and 1080p 10bit low bitrate only! For that you need at least 300MB of RAM for the GPU.

-Raspbian by default, doesn't play some video codecs like VP6, VP8, MJPEG, Theora, etc, so to be able to play this codecs, you need to go to "raspi-config" -> "Interfacing Options" -> "Camera" -> Enable,
or just add a new line in /boot/config.txt with:

Code: Select all

start_x=1
-If you have a RPi 0/1/2 and want to play h264 50 or 60fps videos, depending on the kernel/firmware version you are using, you may need to also add a new line in /boot/config.txt with:

Code: Select all

disable_auto_turbo=0

ADDITIONAL INFO:

This is very important also!

Kodi will only function if you are using the Broadcom drivers! This is the "Original non-GL desktop driver" on raspi-config, which is currently the default on the Raspbian images. If you select the open-source OpenGL driver, it won't work!

Kodi package includes both an ARMv6 and ARMv7 binary, which is autoselected accordindly to which version of the Raspberry Pi you have for best performance. Optimizations available in Open/LibreELEC like H265/HEVC NEON acceleration are also included and enabled automatically if you have a RPi 2/3. There is no visible performance improvement in compiling Kodi for ARMv8 currently (like native compile for the PI 3).

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


EXTRA INFO (not required for proper function):

RUNNING KODI WITH ANOTHER USER DIFFERENT FROM THE DEFAUL "PI":

If you want to run Kodi with a user different from the default "pi", that user needs to be part of the following groups, for everything to work fine:
audio, video, input, dialout, plugdev, netdev (needs confirmation), users, cdrom (only if you have cd/dvd drives) and tty (needs confirmation).
For that, run the following command:

Code: Select all

sudo usermod -a -G audio,video,input,dialout,plugdev,netdev,users,cdrom,tty "username"
Replace "username" by the desired user name. Depending on the use case of Kodi, not all this groups may be needed.


AUTO-STARTING KODI AT BOOT:

Option 1 (without desktop):
If you want to auto-start Kodi automatically at boot, go to rc-gui on Raspbian desktop or raspi-config on a virtual terminal, and choose the option to boot to CLI/console.
Then copy/paste the following to a virtual termianl to create a systemd service for auto start:

Code: Select all

sudo tee -a /lib/systemd/system/kodi.service <<_EOF_
[Unit]
Description = Kodi Media Center
After = remote-fs.target network-online.target
Wants = network-online.target

[Service]
User = pi
Group = pi
Type = simple
ExecStart = /usr/bin/kodi-standalone
Restart = on-abort
RestartSec = 5

[Install]
WantedBy = multi-user.target
_EOF_
Press Enter after paste. Then enable the service:

Code: Select all

sudo systemctl enable kodi.service
Then reboot. If you want to auto start Kodi at boot with a different user change the "User" and "Group" fields above accordingly.
In this case If you are unable to mount/access disks and also have the options to reboot and shutdown missing, check this:
https://www.raspberrypi.org/forums/view ... 0#p1240007

Option 2 (with desktop):

If you want autostart Kodi at boot but also keep the Desktop Environment on the background, just edit the file (with sudo) /etc/xdg/lxsession/LXDE-pi/autostart and add a line, preferably at the beginning of the file with:

Code: Select all

@kodi
This option is a bit more resource intensive because the DE is loaded on the background.


SOURCE CODE:

The source code of this packages/binaries are available here:
https://github.com/PIPplware/xbmc

Krypton (Kodi 17) branch used is "krypton_stable", for Leia (Kodi 18) it is "leia_stable", etc.
Each of this branches are the original Kodi respective branch + popcornmix Raspberry pi patches/fixes/tweaks + some litle patches/fixes/tweaks for Raspbian.

If you have any problem, please include your Kodi log. Information on how to do it here: http://kodi.wiki/view/Log_file
Last edited by Rascas on Wed Sep 04, 2019 3:50 pm, edited 2 times in total.

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

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Wed Sep 04, 2019 3:25 pm

[reserved]

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

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Wed Sep 04, 2019 3:26 pm

For a temporary way to install Kodi on Raspbian Buster, for only RPi 3 and below for now, open a terminal and do:

Code: Select all

sudo su
echo "deb http://pipplware.pplware.pt/pipplware/dists/buster/main/binary /" > /etc/apt/sources.list.d/pipplware.list
wget -q -O- http://pipplware.pplware.pt/pipplware/key.asc | apt-key add -
exit
sudo apt-get update && sudo apt-get dist-upgrade -y
This will add the PiPplware Repository which contains an optimized Kodi 18.X version for Raspbian Buster and all binary addons. Than just follow the instructions on the first post to install it.

kaminsky9444
Posts: 6
Joined: Tue Jul 23, 2019 6:52 am

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Sun Sep 08, 2019 11:58 am

Rascas wrote:
Fri Sep 06, 2019 8:41 pm
kaminsky9444 wrote:
Thu Sep 05, 2019 9:04 pm
https://kodi.tv/article/kodi-leia-184-release

kodi 18.4 is out, it would be possible to have the update?.

Thanks :geek:.
Yes, I will try to do it this weekend. Then I will make an update here:
https://www.raspberrypi.org/forums/view ... 6&t=250796
You have news?.

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

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Tue Sep 10, 2019 7:54 pm

kaminsky9444 wrote:
Sun Sep 08, 2019 11:58 am
Rascas wrote:
Fri Sep 06, 2019 8:41 pm
kaminsky9444 wrote:
Thu Sep 05, 2019 9:04 pm
https://kodi.tv/article/kodi-leia-184-release

kodi 18.4 is out, it would be possible to have the update?.

Thanks :geek:.
Yes, I will try to do it this weekend. Then I will make an update here:
https://www.raspberrypi.org/forums/view ... 6&t=250796
You have news?.
Kodi 18.4 for Raspbian Buster is now available in the PiPplware repo.
Just received my Pi 4 today, will now take a look on it and how to package it.

derders
Posts: 18
Joined: Sun Apr 02, 2017 5:26 pm

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Tue Sep 10, 2019 7:58 pm

Rascas wrote:
Tue Sep 10, 2019 7:54 pm
kaminsky9444 wrote:
Sun Sep 08, 2019 11:58 am
Rascas wrote:
Fri Sep 06, 2019 8:41 pm


Yes, I will try to do it this weekend. Then I will make an update here:
https://www.raspberrypi.org/forums/view ... 6&t=250796
You have news?.
Kodi 18.4 for Raspbian Buster is now available in the PiPplware repo.
Just received my Pi 4 today, will now take a look on it and how to package it.
great news :D thank you

bscphil
Posts: 20
Joined: Mon Jun 24, 2019 10:25 am

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Tue Sep 10, 2019 9:08 pm

Rascas wrote:
Tue Sep 10, 2019 7:54 pm
kaminsky9444 wrote:
Sun Sep 08, 2019 11:58 am
Rascas wrote:
Fri Sep 06, 2019 8:41 pm


Yes, I will try to do it this weekend. Then I will make an update here:
https://www.raspberrypi.org/forums/view ... 6&t=250796
You have news?.
Kodi 18.4 for Raspbian Buster is now available in the PiPplware repo.
Just received my Pi 4 today, will now take a look on it and how to package it.

Thanks for your effort. I assume the currently uploaded package won't work well if at all on the Pi 4?

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

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Tue Sep 10, 2019 9:23 pm

bscphil wrote:
Tue Sep 10, 2019 9:08 pm
Rascas wrote:
Tue Sep 10, 2019 7:54 pm
kaminsky9444 wrote:
Sun Sep 08, 2019 11:58 am


You have news?.
Kodi 18.4 for Raspbian Buster is now available in the PiPplware repo.
Just received my Pi 4 today, will now take a look on it and how to package it.

Thanks for your effort. I assume the currently uploaded package won't work well if at all on the Pi 4?
Nope, only RPi 3 and below for now.

kaminsky9444
Posts: 6
Joined: Tue Jul 23, 2019 6:52 am

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Wed Sep 11, 2019 1:28 am

Rascas wrote:
Tue Sep 10, 2019 7:54 pm
kaminsky9444 wrote:
Sun Sep 08, 2019 11:58 am
Rascas wrote:
Fri Sep 06, 2019 8:41 pm


Yes, I will try to do it this weekend. Then I will make an update here:
https://www.raspberrypi.org/forums/view ... 6&t=250796
You have news?.
Kodi 18.4 for Raspbian Buster is now available in the PiPplware repo.
Just received my Pi 4 today, will now take a look on it and how to package it.
it works perfectly on my Raspberry 3b +, thank you very much.

sgehdn
Posts: 16
Joined: Tue Jul 31, 2018 8:05 pm

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Tue Sep 17, 2019 9:07 pm

Hi, I am on Raspbain stretch. How can I upgrade from Kodi 18.2 to 18.4?

Thanks

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

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Tue Sep 17, 2019 9:09 pm

I am sorry but there won't be more updates to Kodi on Raspbian Stretch since everybody is moving to Buster. Kodi 18.2 is the last version from my part.

sgehdn
Posts: 16
Joined: Tue Jul 31, 2018 8:05 pm

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Wed Sep 18, 2019 7:34 am

ok, thanks. So , how can I update Stretch to Buster and then 18.2 to 18.4? Or is a full re-install the best option?

edit: OK I found a manual:
https://pimylifeup.com/upgrade-raspbian ... an-buster/

and afterwards I cann update to 18.4 from your download package?

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

Re: [Guide] Kodi on Raspbian Stretch [Recover]

Wed Sep 18, 2019 2:19 pm

sgehdn wrote:
Wed Sep 18, 2019 7:34 am
ok, thanks. So , how can I update Stretch to Buster and then 18.2 to 18.4? Or is a full re-install the best option?

edit: OK I found a manual:
https://pimylifeup.com/upgrade-raspbian ... an-buster/

and afterwards I cann update to 18.4 from your download package?
Yes, after updating to Buster, you can follow this to update Kodi:
https://www.raspberrypi.org/forums/view ... 6&t=251645

Return to “Raspbian”