Saiyato / volumio-kodi-plugin

Installation and configuration of Kodi on Volumio 2 images
30 stars 6 forks source link

Hifiberry amp+ is not an option in kodi #9

Open riesch opened 7 years ago

riesch commented 7 years ago

After install of the plugin, playback options are hdmi, analog or both. In de settings of the plugin I selected the dac playback option.

Saiyato commented 7 years ago

Ok, I might just have found a fix to force Kodi to use ALSA, can you edit your systemd unit (/etc/systemd/system/kodi.service) to this:

# Kodi as-a-service
[Unit]
Description = Kodi Media Center

# if you don't need the MySQL DB backend, this should be sufficient
After = systemd-user-sessions.service network.target sound.target

# if you need the MySQL DB backend, use this block instead of the previous
#After = systemd-user-sessions.service network.target sound.target mysql.service
#Wants = mysql.service

[Service]
User = kodi
#Group = root
Type = simple
#PAMName = login # you might want to try this one, did not work on all systems
Environment="AE_SINK=ALSA"
ExecStart = /usr/bin/kodi-standalone -- :0 -nolisten tcp vt7
Restart = on-abort
RestartSec = 5

[Install]
WantedBy = multi-user.target

Note: I added the Environment parameter (AE_SINK), this should force Kodi to use ALSA output (your default card) as opposed to have Kodi decide which card is used.

SCiunczyk commented 7 years ago

Volumio sound is always working fine - via HiFiBerry Amp+ card (of course). The fix you suggest doesn't help. I have this same symptoms.

What is your plugin doing when we run stop then start operation in Volumio ?

Maybe automatic plugin start with Volumio startup after reset is performed to fast/early - before system stabilise and ALSA subsystem is available to Kodi ? Maybe Volumio is "somehow blocking" the ALSA driver for little time after start - e.g. initial welcome sound ?

One observation: when Volumio is playing something e.g. internet radio and I stop/start plugin then stop playing in Volumio and switch to Kodi - HiFiBerry Amp+ card is not available in Kodi.

Only if Volumio playback is paused/stopped - the operation of start/stop make HiFiBerry Amp+ card is available in Kodi.

Volumio: ++++++++-----------+++++++----
Plugin:  on.........off/on.............
                                         Kodi ->> ALSA available 

but in situation:

Volumio: +++++++++++++++++++++++-------
Plugin:  on.........off/on.............
                                         Kodi ->> ALSA not available 
Saiyato commented 7 years ago

Ok, one last test then, if you stop the Kodi plugin and then reboot. Then Kodi should not start automatically, if the UI is visible and you start Kodi; is everything ok?

This should confirm a timing issue.

balbuze commented 7 years ago

have you try to set : "boot_priority":10 in package.json to force the plugin to load in very last place ?

SCiunczyk commented 7 years ago

If I follow scenario:

SCiunczyk commented 7 years ago

with "boot_priority":10 in package.json the situation is little better. After restart Kodi is able to see the ALSA card but not HiFiBerry Amp+. Only the standard Bluetooth output screenshot004

balbuze commented 7 years ago

and disabling startup sound ?

Saiyato commented 7 years ago

Good find balbuze! :) Thanks.

I had to change some work to do and tomorrow night is also no option, but I'll try to do some tests too this weekend.

SCiunczyk commented 7 years ago

Hi guys,

I did final test ;-)

Now its working as expected. No plugin "boot_priority" change , no AE_SINK parameter in kodi.service.

So I think you can leave it as is or find the way to "un-glue" Volumio from HiFiBerry Amp+ ALSA driver during plugin startup.

Have a nice weekend.

Saiyato commented 7 years ago

Really? Is the startup sound the culprit? Damn! Makes me wonder why I don't have this problem on my setup... oh well, good to know, no I can look for workarounds/fixes.

Thanks for your effort in finding the culprit.

SCiunczyk commented 7 years ago

Well the effort was for myself as well. Now I have my YTPC of my dreams

SCiunczyk commented 7 years ago

And little bonus.... Polish translation. Ready to merge ;-)

Saiyato commented 7 years ago

I merged the Polish translations, thanks! I did some editing in the translation (minor), if you want you can send me a new file, if it's ok then you don't need to do anything ;)

SCiunczyk commented 7 years ago

It's OK

Saiyato commented 7 years ago

Awesome! I have not been presented any issues regarding the HifiBerry Amp, will try to figure out a neat way to inform the user when HifiBerry is used.

erikfx commented 6 years ago

Hi there! I'm running the hifiberry dac on rpi3 and have the same issue that the soundcard is just available after disabling the kodi plugin in volumio browser settings and starting it again (Thanks for the intense bug research in here and the workaround). Unfortunately I can't save the setting "enabling dac for kodi" in my volumio kodi plugin. When I hit save and come back to the plugin the setting is disabled again like nothing was changed. Am I missing the trick to save the settings permanently?

kiddzie commented 5 years ago

Hello, Bro Saiyato or anybody, please post again the image as the https://mab.to/MpPqvqLLa seems to point me to another site. My gadget: rPI 2, hifiberry amp+

Nevermind, got it @ https://github.com/Saiyato/volumio-kodi-plugin/raw/master/volumio-kodi-plugin.zip Tq Saiyato

Saiyato commented 5 years ago

The not being able to save problems are related to #28, I have created a new PR for the matter: https://github.com/volumio/volumio-plugins/pull/314