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

My pleasure!

It takes KODI 1 minutes to release the card after usage, but then Volumio can use the card again, so it just takes patience. There is a setting in KODI (I think: settings > system > audio) where you can remove the timeout, it’s standard on 1 minute. Removing this however has some usability problems. Not while watching movies, but while using the interface, because of te ‘clicks’ it makes. I switched off the interface sounds of KODI at the same page, since they are annoying anyway.

#dtparam=audio=on

Commenting this out removes the driver for the onboard sound card of the Raspberry Pi I believe, I’m not sure why it is still loaded on Volumio 2 since I cannot think of any reason to use it if another card is present. The problem with this route is however, that it’ll break Volumio 2, since it for some reason expects the card to be card 1 (instead of card 0). I think it’s hardcoded somewhere, but I couldn’t find it anywhere. Maybe a developer can shine some light on this?

Did you setup a new systemd service to auto-start Kodi ?

No not yet, this is still on the roadmap, would this fix the problem at hand? If that’s the case I can move it forward in the planning…

Maybe a dumb question: how do i start Kodi?
It’s installed, but in plugins section it says inactive.

Hi Campino,

It should start automatically, please don’t mind the plugin status just yet. This has not yet been implemented.
If you plugin a HDMI cable you should be able to see Kodi. :slight_smile:

I’ve noticed that in some cases the autostart fails in the installation script, if you save the plugin settings (set autostart to true) it should work.

“A stop job is running for LSB: XBMC media centre” means that Kodi service is stuck and systemd is waiting for it to exit.
Perhaps a journalctl command can help you to see what happen …

If you set ENABLED to 0 in /etc/default/kodi, do you still have the problem ?

Adding a new system script can be useful if you want to control auto-start Kodi service by Volumio plugin
systemctl enable kodi will start Kodi service at boot
systemctl disable kodi will disable the Kodi service from starting automatically

Another dumb question, how do you control kodi?

No such thing mate, just information not yet found :wink: But I control Kodi using the Kore app (Android). You can also plugin a wireless keyboard (the input rules make sure you have sufficient rights) like the Logitech k400 or something like that. :wink:

I figured it’d do that, but will that also cause Volumio to tell systemd to stop Kodi upon restart, thus solving the LSB messages? I’ve noticed it takes ‘some’ time to close Kodi (even from Kodi itself), so it might very well be Kodi lagging because it is not closed properly…
I’ve tried debugging this, but the onRestart/onStop action results are destroyed (I used simple logging for that) since my (volumio.)log is refreshed every boot.

[code]ControllerKodi.prototype.onStop = function() {
var self = this;

self.logger.info("performing onStop action");	

return libQ.resolve();

};

ControllerKodi.prototype.stop = function()
{
// Kill process?
self.logger.info(“performing stop action”);

return libQ.resolve();

};

ControllerKodi.prototype.onRestart = function()
{
// Do nothing
self.logger.info(“performing onRestart action”);

var self = this;

};
[/code]

Must say that I haven’t had the time yet to tend to the systemd unit creation :unamused: hopefully I will get around it this weekend (hopefully not an empty promise again :blush: )

Hi all,

Creating a systemd unit solves the LSB-delay! This is obviously a great breakthrough :wink:
I’ve been experimenting using the volumio users as opposed to kodi, to no avail, but since it works I’m not putting too much effort in that.

Attached the latest version, the changes are:

  • No more autologin for the user Kodi
  • The ENABLED setting in the Kodi config is not used anymore
  • Kodi is started (and stopped) from the plugin menu using the systemd unit
  • The LSB-delay is solved! yay! :ugeek:
  • Removed the auto-start settings, because turning the service on and rebooting takes care of that

What have I tested?

  1. Plugin installation in Kodi works
  2. NFS/FTP sources can be used, I have not tested SMB though

What didn’t I test?

  1. Sound, I only tested visuals and read logs, the setup in my home office doesn’t support sound

What is still to be investigated?

  1. Using the soundcard in Kodi, the solution Sjoerd provided worked, but it seems a bit much to put into the settingspage… Still pondering about a neat workaround. Feel free to jump in :wink:

Also you need to quit the process once using the exit button in Kodi to get rid of the ‘first start help’ pop-ups… :wink: Plus a reboot after installation IS REQUIRED, I’m not forcing this because I can’t tell what else is happening.

Happy testing and please post back with results so I can patch 'em.
volumio-kodi-plugin_1.0.15.zip (206 KB)

Great news Saiyato,
Just one question…
When I installed Kodi on my Volumio distrib, I had to run chmod 777 /dev/vchiq to be able to run XBMC as kodi user.
Did you do that on your install.sh script ?

JedS

There should be no need for that, what is your setup?
The script should take care of that using the following code:

# Add input permissions echo "Adding input permissions" rm /etc/udev/rules.d/10-permissions.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

Especially the last line, setting vchiq to 666 for the video group (of which the kodi user is a member). Can you verify the rules are there and the kodi user is in the group?

PS: it could be caused by the fact that 2.041 says the plugin installation failed, but you just need to wait it out. Eventually it should succeed :wink: installing Kodi takes a while.

Hi,
I didn’t use your plugin yet as I already had a working solution with both Volumio and Kodi.
I post a guide ( 1st page of this thread I think) where I explain that I had to change the mode for /etc/vchiq. Without doing this, I couldn’t launch Kodi.
As I said in this guide, vchiq was set to 666 for the video group; as you did.
For now my setup is RpiB+, but I plan to change for a Rpi3

Great work!!

Not sure if I follow you comment here by the way? It’s very useful if you want your DAC as a sound output, which probably most people want to? Or is there some sort of complication?

I ran into another problem by the way: I bought the KALI reclocker (it’s so good, my Spotify starts to sound badly…). Anyways, this buffers the audio 0.7 seconds and thus there is a delay in the audio (and the subtitels). This is fixed by adding or changing the :

/home/kodi/.kodi/userdata/guisettings.xml

look for


        <audiodelay>0.700000</audiodelay>
        <subtitledelay>0.700000</subtitledelay>

Or by doing it manually once thru the OSD > Audio > Audio offset > save as default

Aye, I too presume people want to use their soundcard as output device, though I’ve been reading into the subject and pass-through should not degrade sound quality…
EDIT: Not so sure 'bout the quality anymore after more reading into it. Feel free to jump in if you have pre- or con-arguments :slight_smile:

Anyways, I’m trying to keep all options open, so I’m reading into the soundcard selection of Kodi, because editing the /usr/share/alsa/alsa.conf file is a bit dangerous to do automatically… I’m not sure I can always select the correct line in the file to update the value. :unamused:

So if I could change a setting in a smaller file, the selection of correct line is easier and more waterproof. :slight_smile:

The delay if the KALI reclocker is pretty easy to do, was also pondering about putting some repo-sources in the sources.xml file… saves people the time to dl plugins. Is the delay always the same? I mean for each source even if you re-install?

I think we can use the asound.conf solution as opposed to fiddling with the ALSA config, still have to read into it, but it looks promising… :slight_smile:
That way I only need to edit/write a small file, which eliminates the risk of breaking more stuff. To be continued.

Hi there! I’m not sure I follow your reasoning everywhere, so let me see if I understand it correctly first :wink:

But there is no need to use pass-through or is there? Kodi shares the soundcard with mpd, shairport or other services you throw at it. If the sound card is used by another program, kodi will fallback at another option (usual HDMI), which is annoying, but it doesn’t influence sound quality.

Great! The KALI buffers the audio for exactly 0.7 seconds to replace the clock data, to reduce jitter. So it’s always 0.7 no matter the source, since this delay is made by the hardware. I’m not really sure what you mean by ‘even if you re-install.’ You mean if you reinstall Volumio alltogether? It should, as long as the KALI is present.

Ideally you’d be able to do this indeed. I tried this, however, the asound.conf settings seem to be overridden by something. At least in my setup (RPI 2 > KALI > Piano DAC). I suspect /usr/share/alsa/alsa.conf overrides the asound.conf but I couldn’t find any documentation on it (and I didn’t dig thru the code yet).

Maybe someone else know this?

hi!
I had a look at your plugin. it works pretty well even if some adjustement are needed.
I had to change the port from 8080 to an other value (8082) in kodi to be able to remote it from kore kodi
I can’t select the dac as output. I think it is due to the fact that voluimio use it at boot time. I have to investigate…
Anyway, good job !

warning !!!
firts installation was fine on volumio 2.041
But I did it three time with last dev version and it kills the system : after installation and doesn’t boot anymore !