[GUIDE] Kodi on Volumio 2.x -> Install on a nonvolumio image

EDIT: Original title -> Install volumio on a non-volumio image

Hi all,

As many have tried before and will try after me, I wanted to combine Volumio with Kodi.

Installing Kodi on the volumio image worked okay-ish, relative small HD files could be played without choppy video, but movies were just not watchable. I used the following script to install Kodi on Volumio 1.55 (using an rPi2B). Note: just tried this on the Volumio 2 image, it needs some more packages, still working on this…

EDIT 19-08-2016: updated the rules creation lines

[code]# Add repository
echo deb http://pipplware.pplware.pt/pipplware/dists/jessie/main/binary / | sudo tee -a /etc/apt/sources.list.d/pipplware_jessie.list
wget -O - http://pipplware.pplware.pt/pipplware/key.asc | sudo apt-key add -
sudo apt-get update

sudo apt-get install kodi --yes
#sudo apt-get install kodi-pvr-iptvsimple --yes

Add user Pi to groups

sudo adduser pi
sudo adduser pi sudo
sudo addgroup --system input
sudo usermod -aG audio,video,input,dialout,plugdev,tty pi

echo "SUBSYSTEM==“input”, GROUP=“input”, MODE=“0660”
KERNEL==“tty[0-9]*”, GROUP=“tty”, MODE=“0660"” | sudo tee -a /etc/udev/rules.d/99-input.rules

echo "# input
KERNEL==“mouse*|mice|event*”, MODE=“0660”, GROUP=“input”
KERNEL==“ts[0-9]|uinput", MODE=“0660”, GROUP=“input”
KERNEL=="js[0-9]
”, MODE=“0660”, GROUP=“input”

tty

KERNEL==“tty[0-9]*”, MODE=“0666”

vchiq

SUBSYSTEM==“vchiq”, GROUP=“video”, MODE=“0660"” | sudo tee -a /etc/udev/rules.d/10-permissions.rules

Enable AirPlay

sudo apt-get install avahi-daemon[/code]

Then I decided to go at it the other way around, using the OSMC image, installing Volumio on top of something else.
This seemed to work alot better, but I do have some issues regarding rights. For example I cannot have the Volumio GUI edit the /boot/config.txt or the /etc/spopd.conf files. There are probably alot of other right issues that have not yet surfaced on my setup. Also I have not been able to manage SMB shares on the OSMC image, but that problem doesn’t have priority at this point I suppose.

Maybe someone can point me in the right direction regarding this issue?

The installation script for Volumio:

[code]#!/bin/sh

Source: http://typingoutloud.org/raspberry-pi-installing-volumio-pibang/

Test date: 2016-05-10 (on latest OSMC image: OSMC_TGT_rbp1_20160403.img)

Remember if you edit the script, set line breaks to UNIX format!

echo “Starting volumio setup…”

Install dependencies

apt-get update
apt-get -y install git-core alsa-utils mpd mpc nginx sqlite3 php5-fpm php5-curl php5-sqlite php5-cli samba samba-common-bin

Create mountable directories

mkdir -p /mnt/NAS
mkdir -p /mnt/USB
mkdir -p /mnt/UPNP
mkdir -p /var/lib/mpd/music/WEBRADIO

Remove the www-directory (dummy html file exists) and all contents and recreate it

rm -rf /var/www
mkdir -p /var/www

Clone volumio into the /var/www directory

git clone https://github.com/volumio/Volumio-WebUI.git /var/www

Edit the rights for the config files

chmod 775 /var/www/_OS_SETTINGS/etc/rc.local
chmod 755 /var/www/_OS_SETTINGS/etc/php5/mods-available/apc.ini
chmod -R 777 /var/www/command/
chmod -R 777 /var/www/db/
chmod -R 777 /var/www/inc/

Copy the system files

cp -var /var/www/_OS_SETTINGS/etc /

Create symbolic links for the shares in mpd

ln -s /mnt/NAS /var/lib/mpd/music/NAS
ln -s /mnt/USB /var/lib/mpd/music/USB
ln -s /mnt/UPNP /var/lib/mpd/music/UPNP

Reboot the rPi afterwards

Update the library to show the webradio folder[/code]

Then if you really want spop (Spotify support) you need to build/compile it yourselved. I used the following script and apart from not being able to edit the /etc/spopd.conf file it works just fine. It loads a little more playlists than the default, but that’s cool with me.

Spop installation script:

[code]#!/bin/sh

Spop installation script for OSMC

Add Spotify repository

echo “Setting up source list…”
wget -q -O - http://apt.mopidy.com/mopidy.gpg | sudo apt-key add -
echo “deb http://apt.mopidy.com/ stable main contrib non-free\ndeb-src http://apt.mopidy.com/ stable main contrib non-free” | sudo tee /etc/apt/sources.list.d/mopidy.list

Update repository and install

echo “Updating repositories and installing dependencies…”
apt-get update
apt-get -y install cmake make git telnet build-essential libjson-glib-dev libao-dev libdbus-glib-1-dev libnotify-dev libsoup2.4-dev libsox-dev libspotify-dev

Create the directory to build into and clone the git

echo “Fetching spop-client from github…”
mkdir -p /home/osmc/gitrepos
cd /home/osmc/gitrepos
git clone git://github.com/Schnouki/spop.git

Copy the configuration into a new config

echo “Preparing to compile and build…”
mkdir -p ~/.config/spop

The default config file contains too many variables, causing volumio to be unable to set it up

cp spop/spopd.conf.sample /etc/spopd.conf

Try to build spop

cd /home/osmc/gitrepos/spop
cmake -DCMAKE_INSTALL_PREFIX=/usr
make
make install

Make sure you edit the /etc/spopd.conf file, username/password and remove any unused functionality. Otherwise spop will not start correctly[/code]

Obviously any tips and/or corrections are more than welcome, but keep 'em nice aye? :slight_smile: It’s my first how-to on linux, so I might be forgetting alot :blush:

Update, when installing Volumio on an OSMC image any Kodi controlling app loses connection once playback starts in Kodi. Volumio however is still controlable and shows no sign of connectivity problems.

Hi,
I just installed XBMC on a Volumio 2 image.
I followed the [GUIDE] Install xbmc on Volumio 1.5 with minor modifications.
I used the following repo deb http://archive.mene.za.net/raspbian jessie contrib instead of deb http://archive.mene.za.net/raspbian wheezy contrib because of some missing package in the repo.
After installation, got eror on first run because libEGL was not found so I add a file called 00-vmcs.conf (this file is missing in the volumio image) in the /etc/ld.so.conf.d

echo '/opt/lib/vc' > /etc/ld.so.conf.d/00-vmcs.conf

The GPU needs at least 96M of RAM in order for XBMC to run. To configure this add or change this line in /boot/config.txt

gpu_mem=196 .
I overclock slightly my RPi because I only got a B+

I added my run-as XBMC user (kodi) into the audio,video, input, dialout, plugdev,tty groups but everytime I ran XBMC, I got a “failed to open vchiq instance”.
My kodi user belongs to video group, i add a udev rules ( SUBSYSTEM==vchiq, GROUP=video, MODE=0660" | sudo tee -a /etc/udev/rules.d/10-permissions.rules) .
I don’t knwon why i had to I “chmod 777 /dev/vchiq” to be able to run XBMC as kodi user.

Finally, i test some HD videos without any problems … Both Volumio and XBMC are running :sunglasses: :sunglasses:

Thanks for the Guide.

Is it possible to upgrade an old Volumio image (1.5) to 2? I installed other applications on the image, and I really don’t want reinstall everything on a fresh image :slight_smile:

Nope, there is no upgrade path from 1.55 to 2. Volumio 2 is a complete rewrite.

Hi, thanks for your reply. Is it possible to De-install 1.55, and install 2 with a script?

The answer is also no, because you can only get Volumo 2 as a prepared starter image.
Have a look at the Volumio 2 build scripts on http://github.com/volumio/Build and you will see a number of reasons why it is not going to work.

Hi all,

I know why the vchiq problem occurred, my sudo tee command was missing some double quotes! Will fix that in the weekend :wink: EDIT: fixed

I couldn’t get your fix for the libs working though, so I symlinked all needed libs to /usr/lib. Will try to figure out why it isn’t working with the 00-vcms.conf file. Also there was a typo in your command, the correct folder is

echo '/opt/vc/lib' > /etc/ld.so.conf.d/00-vmcs.conf

The rest was indeed working now, will see if I can get it done in one script, so you can install it unattended (since it takes some time).

Just a quick update, HD videos will play, but if the size exceeds 12GB it becomes very choppy. The cache is filling up rapidly and responsivity degrades. This is on a (non-overclocked) B, maybe a Pi2 (ordered another one for this project, it was waaaay cheaper than the 3 :wink: ) can handle this better.

Also, if we were to proceed, we need to read into the build script(s) to see if we can optimize the Pi (codecs and what not) for use with Kodi and Volumio.
But, this is chapter two, first I need to rebuild, 'cause I (again) broke the installation trying to update MPD :stuck_out_tongue:

So the roadmap is:

  • Get it all up and running using a single (configurable) script
  • Get it all up and running on a Pi2
  • Read into Kodi image build scripts to see if we can optimise some stuff without degrading Volumio’s performance (this is the highest priority)
  • Combine the above into a single script (if possible)

Hi Saiyato,
thanks for your share.
I installed Kodi on top of a fresh Volumio 2. It seems booting well.
But how can I access to Kodi?
I changed the value from 0 to 1 in the file “/etc/default/kodi” but nothing happened.
François

Hi François,

Since Kodi will require a screen I ran it using the “kodi” command in the prompt.
Have had it autostart in the past, but the Pi was delayed so I never posted back my new results.
It will be delivered this week… :unamused: (It was actually delivered, but I had to order another one because my dad needed a Pi :stuck_out_tongue: )

To be continued for sure! :wink:

François,

I have managed to get it working, will be testing performance in the next week.
I must say I abandoned the rPiB+ and used the rPi2B instead, mostly because of the need for RAM.

So what I did is the following:

  • Flash the 979-image
  • Added the repo, updated and installed Kodi
  • Set the permissions and rules
  • Changed the kodi user to volumio and added volumio to the groups as opposed to pi
  • Set enabled to 1 in de kodi settings
  • Set volumio to auto-login

Not sure if I can combine this all into 1 script, but it seems to be working…

If you could make a script, then we could add it as a plugin, which will result in a very easy install…

Hi everyone,

I too have tried to install kodi on top of Volumio with success on my RPi2, but using another repo :
deb pipplware.pplware.pt/pipplware/d … ain/binary /

Reading and gathering informations from https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=109088 and https://www.raspberrypi.org/forums/viewtopic.php?t=99866, i was able to make it work on Volumio 1.55 and now on Volumio 2.

As i’m not a linux expert, i can’t tell what are the differences between your way and mine (version of Kodi ?), but your way seems to me simplier.
I too experienced the /dev/vchiq rights problem, so i’ve make a script to change them at boot just before launching Kodi
I can just say that i have CEC working, autologin and auto start of kodi on boot, and i’m happy with it since about 2 months.

If necessary, i can post the steps i followed since i’ve make a text file for me to redo it if needed.

I now try to do the same on my ODROID C2, but with no success for now…

please be aware, that the Odroids are still headless, no framebuffer support yet, so you won’t get Kodi to work without installing mali and the display drivers.

Thanks youpilai and Saiyato :slight_smile:
I’ll give it a new try later this week.
But if I remember well, the Kodi install broke my Hifiberry output.
Did you succeed to use both Hdmi and Alsa output?

Yes please ,that would be very helpful!

yes, and primarily because i didn’t want to have conflict with volumio, so volumio use the dac and kodi use hdmi in my setup

yes, i’m aware of that, i tried to install kodi on ODROID following this thread:
http://forum.odroid.com/viewtopic.php?t=19433
with “kodi-odrobian-fbdev” and “mali-fbdev” from the “http://oph.mdrjr.net/odrobian/apt-sources/public/jessie-s905.list” branch, but with no success for now. My TV screen stays with the boot logo i’ve activated to check if hdmi output is working.

I don’t really know if everything is necessary or optimal, but it works :

***************************** INSTALL KODI

  #Add the pipplware main repository by editing /etc/apt/sources.list or add it to a new file like /etc/apt/sources.list.d/pipplware_jessie.list:

deb http://pipplware.pplware.pt/pipplware/dists/jessie/main/binary /
  
  #Than add the key:

wget -O - http://pipplware.pplware.pt/pipplware/key.asc | sudo apt-key add -
  

  #And update, upgrade and install Kodi:

sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install kodi
  
  
  #To have everything working nicely on Raspbian you also need to set the right permissions: 
  #You have to create the group "input" if it doesn't exist.
  
sudo nano /etc/udev/rules.d/99-input.rules

  #enter the following text and save it:

SUBSYSTEM==input, GROUP=input, MODE=0660
KERNEL==tty[0-9]*, GROUP=tty, MODE=0660

  #Create & edit the following file:

sudo nano /etc/udev/rules.d/10-permissions.rules
  
  #enter this text and save it:
  
# input
KERNEL=="mouse*|mice|event*",   MODE="0660", GROUP="input"
KERNEL=="ts[0-9]*|uinput",     MODE="0660", GROUP="input"
KERNEL==js[0-9]*,             MODE=0660, GROUP=input
# tty
KERNEL==tty[0-9]*,            MODE=0666
# vchiq
SUBSYSTEM==vchiq,  GROUP=video, MODE=0660


 #run the following commands for user volumio (if you haven't changed your user name):

sudo usermod -a -G audio volumio
sudo usermod -a -G video volumio
sudo usermod -a -G input volumio
sudo usermod -a -G dialout volumio
sudo usermod -a -G plugdev volumio
sudo usermod -a -G tty volumio


  #Recreate symlinks

sudo ln -fs /opt/vc/lib/libEGL.so /usr/lib/libEGL.so
sudo ln -fs /opt/vc/lib/libGLESv2.so /usr/lib/libGLESv2.so
sudo ln -fs /opt/vc/lib/libbcm_host.so /usr/lib/libbcm_host.so
sudo ln -fs /opt/vc/lib/libvcos.so /usr/lib/libvcos.so
sudo ln -fs /opt/vc/lib/libvchiq_arm.so /usr/lib/libvchiq_arm.so
sudo ln -fs /opt/vc/lib/libmmal.so /usr/lib/libmmal.so
sudo ln -fs /opt/vc/lib/libmmal_core.so /usr/lib/libmmal_core.so
sudo ln -fs /opt/vc/lib/libmmal_util.so /usr/lib/libmmal_util.so
sudo ln -fs /opt/vc/lib/libvcsm.so /usr/lib/libvcsm.so
sudo ln -fs /opt/vc/lib/libmmal_vc_client.so /usr/lib/libmmal_vc_client.so
sudo ln -fs /opt/vc/lib/libmmal_components.so /usr/lib/libmmal_components.so
sudo ln -fs /opt/vc/lib/libcontainers.so /usr/lib/libcontainers.so
sudo ln -fs /opt/vc/lib/libopenmaxil.so /usr/lib/libopenmaxil.so

  #Change rights to avoid sudo :
  #create file ./skodi.sh:
  
nano ./skodi.sh

  #copy:
  
sudo chmod a+rw /dev/vcio
sudo chmod a+rw /dev/vchiq
kodi-standalone

  #change rights: 
  
chmod +x ./skodi.sh

  #ajouter les droits sudo dans /etc/sudoers.d/kodi-sudoers:

sudo nano /etc/sudoers.d/kodi-sudoers

  #modify the line:
  
kodi,volumio ALL = (root) NOPASSWD: /bin/chvt,/bin/chmod a+rw /dev/vcio,/bin/chmod a+rw /dev/vchiq


  #Autologin and autostart kodi:

sudo mkdir -pv /etc/systemd/system/getty@tty1.service.d/
sudo nano /etc/systemd/system/getty@tty1.service.d/override.conf
  
  #copy:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin volumio --noclear %I 38400 linux

  #auto launch kodi:

nano /home/volumio/.profile

  #copy:

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec /home/volumio/skodi.sh

Hi youpilai,
it works really great!
You just forgot to add in the boot/config.txt

gpu_mem=196

Thanks again for your effort (and cheers to Saiyato)