juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Kodi for Fedora 21

Fri Mar 20, 2015 3:57 pm

I compiled a neon optimized Kodi build for Fedora 21 (only Raspberry Pi 2). RPM Fusion repository needed.
Tested on Clivem's image (http://www.raspberrypi.org/forums/viewt ... 1&t=101027). Let me know if you get any problem. ;)
Notes: Exit bug fixed.
https://dl.dropboxusercontent.com/s/i10 ... l.rpm?dl=0
For CEC support also install
https://dl.dropboxusercontent.com/s/wm8 ... l.rpm?dl=0
Last edited by juppiter89 on Thu Apr 02, 2015 2:24 pm, edited 3 times in total.

ajmichael
Posts: 2
Joined: Sun Mar 22, 2015 8:57 am

Re: Kodi for Fedora 21

Sun Mar 22, 2015 9:12 am

Can I ask a really stupid question? How is this intended to be used - under a window manager or standalone? I have Kodi running happily under Gnome on my Athlon machine with Fedora 21. If I try the same on my Pi2 with clivem's Fedora 21 remix, neither your version nor the one sitting in the rpmfusion repo function. The rpmfusion version produces a blank black screen, yours crashes before getting that far.

I'm no stranger to Fedora but Kodi is new to me. It took some Googling to discover the framebuffer_depth=24 bit!

juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Re: Kodi for Fedora 21

Sun Mar 22, 2015 4:56 pm

My version is standalone using framebuffer (however you can start it from a desktop environment aswell), and yes, I think you need framebuffer_depth set to 24 or 32 bit.

I forgot to say, if Kodi does not start (just crash), try to create a file /etc/udev/rules.d/10-permissions.rules with this content:

Code: Select all

# 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"
then adding your user (e.g. pi) to these groups:

Code: Select all

sudo usermod -a -G video pi
sudo usermod -a -G input pi

dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Wed Apr 01, 2015 10:57 pm

I have just attempted to install this Kodi package under Fedora 21 installed as a BerryBoot OS on my RPi2.
This attempt resulted in several fatal errors due to unmet dependencies.

Can someone please specify exactly which extra packages must be installed on top of a stock RPi2 Fedora 21 install, in order to make it possible to install this Kodi package without errors ?

Preferably such specifications should include complete command line examples.

Edit: When I wrote the above I had not yet installed RPMFusion properly. I have now done that, installing both the 'free' and the 'nonfree' repos. But the install of the Kodi package still fails due to unmet dependencies, though perhaps fewer than before.

The text below was copy-pasted from the output window of yumex:

Code: Select all

Dependency Resolution Errors:

Package: kodi-14.1-1.rpi.fc21.armv7hnl (/kodi-14.1-1.rpi.fc21.armv7hnl)
    Requires: libmmal_core.soPackage: kodi-14.1-1.rpi.fc21.armv7hnl (/kodi-14.1-1.rpi.fc21.armv7hnl)
    Requires: libvcos.soPackage: kodi-14.1-1.rpi.fc21.armv7hnl (/kodi-14.1-1.rpi.fc21.armv7hnl)
    Requires: libEGL.soPackage: kodi-14.1-1.rpi.fc21.armv7hnl (/kodi-14.1-1.rpi.fc21.armv7hnl)
    Requires: libmmal.soPackage: kodi-14.1-1.rpi.fc21.armv7hnl (/kodi-14.1-1.rpi.fc21.armv7hnl)
    Requires: libmmal_util.soPackage: kodi-14.1-1.rpi.fc21.armv7hnl (/kodi-14.1-1.rpi.fc21.armv7hnl)
    Requires: libGLESv2.soPackage: kodi-14.1-1.rpi.fc21.armv7hnl (/kodi-14.1-1.rpi.fc21.armv7hnl)
    Requires: libvchiq_arm.soPackage: kodi-14.1-1.rpi.fc21.armv7hnl (/kodi-14.1-1.rpi.fc21.armv7hnl)
    Requires: libbcm_host.so
Best regards: dlanor

juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Re: Kodi for Fedora 21

Thu Apr 02, 2015 9:45 am

First post updated: I uploaded a new Kodi 14.2 version. Now it should work fine without any dependencies issue.


dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Thu Apr 02, 2015 8:43 pm

juppiter89 wrote:First post updated: I uploaded a new Kodi 14.2 version. Now it should work fine without any dependencies issue.
Thanks, I've downloaded this now, and also the CEC libs you linked to.
(My current TV doesn't use CEC well, but I may as well have it installed for Fedora anyway.)
juppiter89 wrote:Dlanor, are you using this image http://www.raspberrypi.org/forums/viewt ... 1&t=101027?
Not directly, though the one I use may be derived from that one. I'm just not sure about that.
As I mentioned before I use BerryBoot to allow me to use multiple OS on the same SD card (a 64GB SDXC card).
So I am limited in my choice of OS images to those that have a BerryBoot-compatible image, or those for which I can make one myself. I have done the latter for a few images, but not for Fedora, so the Fedora I use is the one offered for install through the BerryBoot firmware, where it's referred to as "Fedora 21 MATE" due to the bundled MATE desktop.
Thanks for the tip, I will add them before trying to install the new Kodi RPM, just to be sure I have all as needed.
(Unless the Fedora version I use is lacking something else that is... ;) )

So I'm going to test your new Kodi RPM a bit later tonight and get back to you with my results here afterwards.

Best regards: dlanor

dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Thu Apr 02, 2015 10:57 pm

@juppiter89:
I've now managed to install your new Kodi RPM (the 14.2.1 version). It took me a while to realize that I could not use GUI methods to install the squeezecommunity RPMs, as trying to install them with Yumex had no effect at all (not even an error message or warning). But when I gave up on that method and instead opened a terminal window and used "sudo yum install rpm-file-name" for each of them it worked as expected, and when I then used "sudo yum update" I could see how a lot of the previously missing dependencies got installed. And thereafter I could also install the libcec RPM and finally your Kodi RPM. After this I made one final "sudo yum update" which added another megabyte or so of stuff, after which I considered the install complete.

I can now see "Kodi Media Center" as a Mate menu entry in the submenu "Applications" > "Sound & Video", as expected.
I have also inspected "/usr/share" to verify that it has the subfolder "kodi" with its normal contents, and have also verified that a "kodi" binary file is present in "/usr/bin". So far so good...

However, when I attempt to launch Kodi, either by using the menu entry in the GUI, or by launching "/usr/bin/kodi" directly, I get no functional response at all. Either it doesn't launch, or else launches and terminates too quickly for me to notice any activity, even though I have the Mate System monitor open as I attempt a launch. All I see is a minor peak in one of the CPU core's usage, which may as well have been due to processing the GUI mouse-clicks.

I've seen that you posted some info for cases of failing launch, so I guess that's where I'll have to turn next.

Best regards: dlanor

dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 3:02 am

@juppiter89:
I have now added the extra measures you recommended earlier in this thread, for cases where Kodi wouldn't launch or crashed directly on launch. (The 10-permission.rules file and the group assignments.) But it made no visible difference... :(

Kodi still doesn't launch properly no matter how I attempt to launch it, but the attempts I made from a terminal window did at least give a new symptom that is a little more informative than the mere failure to start that I see with all other methods.

Here is a copy of one such terminal session, containing two launch attempts:

Code: Select all

[[email protected] ~]$ /usr/bin/kodi
Unable to find path to Kodi data files!
[[email protected] ~]$ cd /usr/share/kodi
[[email protected] kodi]$ /usr/bin/kodi
Unable to find path to Kodi data files!
[[email protected] kodi]$
As you can see my first launch attempt here did address the Kodi binary directly using its install path, but without any consideration for the current work directory. So the failure to find Kodi data files is not very surprising. But before the second attempt I had switched current work directory to Kodi's own folder, where all the files installed with it reside. And yet it still failed to find its data files. Now, I realize that Kodi/XBMC always has two different data folders. One with original files the user is not supposed to modify (corresponds to the 'Program Files' subfolder of Kodi under Windows), and another folder used for files modified during normal work, and also modifiable by user (corresponds to the AppData subfolder of Kodi under Windows). If it is this second folder that Kodi fails to find in my launch attempts there's not much I can do about it yet, since I have no idea where that folder would be located under Fedora. But hopefully you can tell me that and/or some other tips on how to get this working.

Best regards: dlanor

juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 6:18 am

Uhm... this is very strange :?

Have you rebooted after the fix above?
Anyway please try to run

Code: Select all

/usr/lib/kodi/kodi.bin
or

Code: Select all

KODI_HOME=/usr/share/kodi kodi
if these don't work try to run kodi with root permissions

Code: Select all

sudo kodi

dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 12:18 pm

juppiter89 wrote:Uhm... this is very strange :?

Have you rebooted after the fix above?
Yes. Results were identical for tests before and after reboot.
Anyway please try to run

Code: Select all

/usr/lib/kodi/kodi.bin
or

Code: Select all

KODI_HOME=/usr/share/kodi kodi
if these don't work try to run kodi with root permissions

Code: Select all

sudo kodi
Of those three methods the first and last had exactly the same result as before, of showing the message: "Unable to find path to Kodi data files!"

The middle method finally managed to launch Kodi, but it was in some weird bugged state, unable to accept keyboard input properly. It did respond to keyboard, but incorrectly, making it impossible to enter text into editing fields as needed for configuration by using keyboard. It possibly would have worked using mouse with the virtual keyboard on screen, but before testing that I wanted to exit to desktop again to check some things, and that was when the BAD bug struck. Exit from the program did not work properly so it crashed to a black screen with no responsiveness to any input. I was now forced to restart the system by pulling the power plug, with a high risk of corrupting the SD card. Right now I had no choice but to do that, but I will not willingly repeat it... I'm prepared to test some more, but preferably with a better chance of normal program termination. (Corrupting the SD card would mean losing half a dozen test systems on it.)

For my next tests I plan to use the 'Reboot' or 'Shutdown' commands from the exit menu of Kodi, rather than the 'Exit' command I used this time in my failed attempt to get back to desktop. Hopefully 'Reboot' and 'Shutdown' will work better, since they don't have to interact with (or restart) the desktop GUI directly. But for the long term 'Exit' needs to be fixed of course.

So right now I have two problems, one minor and one major:

1: The integration of Kodi to the desktop menu is bugged, and needs to launch Kodi with the proper environment setup. That would probably involve something similar to the launch string I used when it actually started (the middle method of those you suggested).

2: Termination of Kodi is bugged, simply crashing the system instead of returning control to the MATE desktop, or whatever other program launched it. (In my test that would be bash running in a terminal window.) This could very well be a consequence of the launch method, or of something missing from my setup. I'd welcome more advice on both counts.

Does it work well for you when launching Kodi from desktop, and can Kodi then return to it at termination ?

Edit: I really should have included the odd response to keyboard entry of text as a third problem above, but this is minor as long as the virtual keyboard entry with mouse works.

Best regards: dlanor

juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 1:38 pm

Well, atleast now it starts correctly :)

For the "Unable to find path to Kodi data files!" error, I really don't know the cause, it seems that for a unknown reason Kodi does not find automatically the data folder (/usr/share/kodi), so passing the KODI_HOME env variable let it to start fine. As a workaround you could mod the Kodi launcher with:

Code: Select all

sudo sed -i 's/Exec=kodi/Exec=env KODI_HOME=\/usr\/share\/kodi kodi/g' /usr/share/applications/kodi.desktop
For the keyboard issue, I suspect could be a power supply issue (?), becuase if you executed the fix above correctly, it should work fine without any bizzarre problem as you described.

For the black screen on exit try this: first install fbset package, then mod the /usr/bin/kodi file so that the bottom become

Code: Select all

...
    print_crash_report
  fi
done

fbset -depth 8 && fbset -depth 32
xrefresh -display :0

exit $RET
This should fix the issue.

dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 3:26 pm

juppiter89 wrote:Well, atleast now it starts correctly :)
Yes, that is a significant step forward. And I've also tested that playback of local mp4 and avi videos works fine.
I haven't yet configured SMB paths for remote playback or installed PlexBMC to access my PMS server, but I think this will work as well. It' s just inconvenient to configure that stuff without using the physical keyboard for entry of all the strings needed.
The text entry dialogs for naming file sources still don't accept physical keyboard, though the virtual one works fine.

Btw: I recognize this keyboard entry problem from earlier XBMC versions on various platforms, so it's not unique to your build.
It has happened in many builds when they enter a dialog (but not all) where the virtual keyboard entry is supported.
At least I think it's the same problem, judging from its behaviour, though the underlying causes may differ.
For the "Unable to find path to Kodi data files!" error, I really don't know the cause, it seems that for a unknown reason Kodi does not find automatically the data folder (/usr/share/kodi), so passing the KODI_HOME env variable let it to start fine. As a workaround you could mod the Kodi launcher with:

Code: Select all

sudo sed -i 's/Exec=kodi/Exec=env KODI_HOME=\/usr\/share\/kodi kodi/g' /usr/share/applications/kodi.desktop
I've now implemented that change, though I did it through GUI instead of command line. Earlier I installed 'beesu' and the beesu script to invoke 'caja' in superuser mode. So when using this method to open a window to "/usr/share/applications" I could simply right-click the entry for "Kodi Media Center" to open its property list and directly edit the launch command.
After doing this the launching of Kodi works fine both from the 'Applications' menu and from a launcher icon placed on desktop.
For the keyboard issue, I suspect could be a power supply issue (?), becuase if you executed the fix above correctly, it should work fine without any bizzarre problem as you described.
I doubt very much that it can be a power issue (unless your Kodi overclocks heavily), since the PSU is rated at 2.1 Amperes and I never have keyboard problems elsewhere (including all programs used from same desktop as this Kodi).
For the black screen on exit try this: first install fbset package, then mod the /usr/bin/kodi file so that the bottom become

Code: Select all

...
    print_crash_report
  fi
done

fbset -depth 8 && fbset -depth 32
xrefresh -display :0

exit $RET
This should fix the issue.
I'm afraid that didn't work, as I still get the same black screen on attempts to 'Exit' from Kodi to desktop.
But fortunately the 'Reboot' command of Kodi's exit menu does work, so I can use that instead until a working fix is found.
Effectively it's just a much slower way of getting back to desktop (via BerryBoot menu, new Fedora boot and log in).

Best regards: dlanor

shaun.cranfield
Posts: 2
Joined: Fri Apr 03, 2015 3:20 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 3:31 pm

First time Pi user. I just installed Kodi on the box. I want it to read a external USB drive with movies on it. When I go to videos the file updated it does nothing then when i look for a path it does not show the drive. Any thoughts? It about 400GB drive. Will this not read it or do i need to go into settins of the PI and setup to discover the drive?

Thanks

juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 3:37 pm

@dlanor
Can you post the output of these 2 commands please? :)

Code: Select all

fbset --show | grep geometry | cut -d' ' -f 6-
xrefresh -display :0
And, when you just exit from Kodi and you get the black screen, if you move your mouse do you get strange graphical things?

@shaun.cranfield
Kodi should autodetect any USB drive you attach. If not, I think you need to configure something on your system. For an external hard drive, make sure your power supply is powerful enough (2+ Ampere)

dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 5:46 pm

juppiter89 wrote:Can you post the output of these 2 commands please? :)

Code: Select all

fbset --show | grep geometry | cut -d' ' -f 6-
xrefresh -display :0
Done. I entered the commands one at a time, resulting in the following output:

Code: Select all

[[email protected] ~]$ fbset --show | grep geometry | cut -d' ' -f 6-
1920 1080 1920 1080 16
[[email protected] ~]$ xrefresh -display :0
[[email protected] ~]$ 
I suppose the response to the first command means that my desktop only uses 16 bit graphics, which may be involved in the problem, and which I would like to change for other reasons too (some colour banding in images). I just don't know how to do that yet, as I'm pretty new to both Fedora and this MATE desktop.

But it does hint at the possibility that a fix you suggested earlier might still be made to work, by replacing the parameter 32 with 16. Right ?
And, when you just exit from Kodi and you get the black screen, if you move your mouse do you get strange graphical things?
I don't recall seeing anything other than black screen. I suppose I could try it once more, though I still worry about possible card corruption. A Linux OS is liable to do some background log writing at any time, and pulling the plug during update of a directory sector is almost certain to corrupt the SD card.

On a brighter note, I've now configured Kodi further, so I can access my extensive media collection both through primitive SMB browsing and higher-level Plex client access through PlexBMC. It was very inconvenient to enter names and passwords with virtual keyboard, but once done Kodi is as convenient to use as ever.

About that keyboard problem:
One key element in this is that physical keyboard keys are also defined as command shortcuts, and in fact ALL keys seem to be filtered for possible shortcut use, even those who are not yet implemented for such commands. And that is one of the reasons why the keypresses I make in text entry mode never are interpreted as text entry, because the command interpreter snaps up those keypress events before they go any further. Thus if I press the "s" key this results in opening the Kodi exit menu, and if I press "h" this attempts to call a PVR function (resulting in an error message as I have no PVR addons installed), and so on. And these things happen not only when navigating normal menus, but also when trying to enter text strings. That is a definite bug in the program, as all interpretation of letter keys as commands must be disabled during text entry.

Best regards: dlanor

juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 5:53 pm

But it does hint at the possibility that a fix you suggested earlier might still be made to work, by replacing the parameter 32 with 16. Right ?
Exactly ;) If you change in the above fix the '32' with '16', I bet Kodi will exit fine.
So /usr/bin/kodi become:

Code: Select all

...
    print_crash_report
  fi
done

fbset -depth 8 && fbset -depth 16
xrefresh -display :0

exit $RET
If you want to set 32 bit graphic, let 32 in that file, and add framebuffer_depth=32 to /boot/config.txt ;)

About the keyboard problem, I admit that I didn't tested it in depth, because I use a TV remote with CEC. I'll check more when I will have more spare time. Thanks for the testing anyway :)

dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 6:00 pm

shaun.cranfield wrote:First time Pi user. I just installed Kodi on the box. I want it to read a external USB drive with movies on it. When I go to videos the file updated it does nothing then when i look for a path it does not show the drive. Any thoughts? It about 400GB drive. Will this not read it or do i need to go into settins of the PI and setup to discover the drive?
I'm not entirely sure I understand your exact problem (though I think so), so my reply may be misdirected.

When you go into the submenu "Videos" > "Files" the first time you can't directly browse to any media files.
Instead you should use the "Add Source" command which opens a file browser that you can use to browse to the drive and the root folder of the folder tree containing your media files, and have that folder added as a new source for the "Videos" section. After adding a source you can access it as with a normal file browser. Such sources may reside either on drives connected to the same system, or on drives connected to other systems in the same LAN, usually accessed by SMB filesharing.

As part of the 'Add Source' operation you also get the option to exclude that folder from 'scanning', which you should do for folders you intend to browse 'manually', such as temporarily connected USB drives. Otherwise the folder will be considered part of Kodi's permanent media library, and scanned for changes and adding metadata info etc. That can be a good thing for drives permanently connected (directly or via SMB shares in a LAN), but it's not appropriate for temporarily connected media, such as those moved between systems on USB sticks etc.

Best regards: dlanor

dlanor
Posts: 11
Joined: Thu Apr 11, 2013 10:58 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 6:37 pm

----- snip ----- re: changing /usr/bin/kodi to restore 16bit frame buffer depth at kodi exit
Yes, I thought that could work, but for improved graphic quality in other work I prefer raising desktop depth to 32 instead.
juppiter89 wrote:If you want to set 32 bit graphic, let 32 in that file, and add framebuffer_depth=32 to /boot/config.txt ;)
That's what I decided to do, though I had to do it a bit differently since my Fedora runs in a virtual filesystem under BerryBoot, so the "/boot" folder has no "config.txt" file, and even if there was one there it would be ignored...
Instead I added the "framebuffer_depth=32" into the "config.txt" file of BerryBoot, to achieve the same effect.

After rebooting with that change made I again used the test commands you showed me earlier, so as to test my current bit depth, which had the desired 32 value. (But I knew it even before the test, as background colour banding had disappeared. :))

Seeing this I then launched Kodi to test its ability to exit properly to desktop, which now works perfectly :).

This leaves the keyboard text entry as the only complaint I have about how this Kodi version works, and that's not a very important issue to me, especially now that I've already finished all major configuration.
About the keyboard problem, I admit that I didn't tested it in depth, because I use a TV remote with CEC. I'll check more when I will have more spare time. Thanks for the testing anyway :)
And thank you for helping me every step of the way like you did. I truly appreciate it. (And it taught me a lot that I needed to know about this Linux distro.)

Best regards: dlanor

juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 6:43 pm

My pleasure! :D

shaun.cranfield
Posts: 2
Joined: Fri Apr 03, 2015 3:20 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 8:17 pm

juppiter89 wrote:@dlanor


@shaun.cranfield
Kodi should autodetect any USB drive you attach. If not, I think you need to configure something on your system. For an external hard drive, make sure your power supply is powerful enough (2+ Ampere)

This hard drive does not have a power supply. It gets powered from the device that it is plugged into. Will this setup work?

juppiter89
Posts: 91
Joined: Fri Jan 04, 2013 10:50 pm

Re: Kodi for Fedora 21

Fri Apr 03, 2015 10:02 pm

shaun.cranfield wrote:
juppiter89 wrote:@dlanor


@shaun.cranfield
Kodi should autodetect any USB drive you attach. If not, I think you need to configure something on your system. For an external hard drive, make sure your power supply is powerful enough (2+ Ampere)

This hard drive does not have a power supply. It gets powered from the device that it is plugged into. Will this setup work?
I mean the Pi power supply. For a self-powered hd a 2+ Amperes power supply is HIGHLY recommended. Finally you need max_usb_current=1 in /boot/config.txt.

Return to “Pidora / Fedora”