Kodi Community Forum

Full Version: Kodi on Raspberry Pi 4 with Ubuntu server
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

I´m trying to install Kodi on a Pi4 with Ubuntu Server with no GUI.
I´m following a guide I found at here to boot straight to Kodi and everything works OK, except that when I enter Kodi, the interface as well as the videos I play are lagging. When I look at htop, I find that all 4 cores are at 100%.
I tried to install Libreelec to check if it was a hardware limitation, but when using Libreelec CPU is around 10% and only in 1 CPU.
I only install the below, and as I said everything works ok but looking at htop I have a lot of processes of kodi-standalone running occupying all 4 cores at 100%.
  • xserver-xorg-legacy
  • Kodi
  • xinit
I think this is due to the fact that the GPU is not used.
I´m trying to learn linux, and searched quite a bit, but I seeing terms like "mesa drivers", "X11", "Xorg", "Xinit "and I´m a bit lost. 

Looking at Libreelec options I used the following options on confix.txt,
  • gpu_mem=320
  • hdmi_ignore_cec_init=1
  • dtoverlay=vc4-fkms-v3d
  • disable_overscan=1
, but apparently that did nothing.
Can you please help me or point me to the right direction.


Many thanks
FranciscoRC
(2020-05-25, 01:28)FranciscoRC Wrote: [ -> ]I´m trying to install Kodi on a Pi4 with Ubuntu Server with no GUI.

What Why that specific combination? Perhaps Raspbian Buster + Kodi is a better start. That combo already works.
(2020-05-25, 08:03)Klojum Wrote: [ -> ]
(2020-05-25, 01:28)FranciscoRC Wrote: [ -> ]I´m trying to install Kodi on a Pi4 with Ubuntu Server with no GUI.

What that specific combination? Perhaps Raspbian Buster + Kodi is a better start. That combo already works. 
Thanks for your reply,

I´m trying to make Kodi work on Ubuntu server, and next I´m planning to install Openhab server + Mosquitto.
I already tried Libreelec and it works OK, the "challenge" was to make it work on Ubuntu Server if possible.


Either way, thanks for replying.
Francisco
@FranciscoRC ubuntu does not ship  a "pi optimized" Kodi like raspbian and LE do, but a generic X-based version with patches from og. debian which is usually frowned upon here
and there is no Team Kodi ppa for arm/aarch thus Kodi performance will be very hindered.

Your best bet would be to build Kodi from source configured for gbm/gles, this way you won't need xorg at all, as opposed to xorg/gl that ships with ubuntu.
(2020-05-25, 13:30)asavah Wrote: [ -> ]@FranciscoRC ubuntu does not ship  a "pi optimized" Kodi like raspbian and LE do, but a generic X-based version with patches from og. debian which is usually frowned upon here
and there is no Team Kodi ppa for arm/aarch thus Kodi performance will be very hindered.

Your best bet would be to build Kodi from source configured for gbm/gles, this way you won't need xorg at all, as opposed to xorg/gl that ships with ubuntu.
Thank you for your help,

Just 2 noob questions
1. Don´t I need Xorg to display ...anything?
2. What do you mean by gbm/gles ?

thank you so much reading and reply.
Francisco
@FranciscoRC 
1) No, it depends on the application, some applications have the ability to run "directly" over drm/gbm without xorg, this ability is usually enabled at configure time _before_ compiling.
2) If would be too large an explanation, on linux Kodi can work on top of xorg, wayland, gbm + on pi (not applicable to pi4) ontop of dispmanx, which one will be used is configured before building Kodi.
(open)gles is a lighter version of opengl (this explanation is too vague!) which was designed for low power (embedded) systems such as pi or smartphones, will be better on a pi performance-wise.
gbm - Generic Buffer Management , basically it's an abstraction that allows direct rendering on the graphics driver without (expensive for a low powered system) intermediate layers such as xorg/wayland

If you really up for the "challenge" you wanted - this is a good one ) .
But it will require some time to research what is what and how to build Kodi to make the most out pi4 hardware.
You probably won't get anywhere by just asking on the forums, it's a lot of information to be explained in a single post, this amount of info may be enough for a PhD thesis )) , but all the info is already there.
Bear in mind that pi4 graphics stack and Kodi on pi4 are still WIP, there are things that do not work or are suboptimal, eg video hw decoding works, but "skipping" does not.
Bear in mind that ubuntu might lag behind raspbian in terms of kernel and firmware.

My recommendation would be to use raspbian for now.
asavah, thank you for your post,

You are 100% right, for stability sake I should use Pi/system for its particular purpose. I´m a windows guy (sorry for the blasphemy), and was trying to use this case for educational purposes.
I´ve installed linux 1000 times in the past 20 years, but after install I always ask myself "Now what?" and then put it aside. To me personally if I don´t have an objective I always tend to abandon things.
But you helped a lot in sorting some ideas. You see, the bad thing about google is that sometimes gives me a buffer overflow, and other times its difficult to understand if the guy writing the article does know a thing about the area or just had dumb luck.

Will order a 2nd unit so my wife doesn´t spank me, and given the average life expectancy in Portugal I calculate I have around 40 years to make it work. 

Will follow your directions and sort out how to build Kodi, and see were that leeds me.

Again thanks for your help.

Francisco
So FranciscoRC, with only 39 and a half years to go I hope you have made some progress. It would be interesting to know things are going.
(2020-10-16, 12:16)Joeyh Wrote: [ -> ]It would be interesting to know things are going.

Don't get your hopes up too high, he hasn't visited the forum in 4 months.
Hi guys I'm trying to do the exact same thing.
In my case I already had the Pi4 8GB with ubuntu server (now 20.10) up and running, then I realized I had my living room TV not far from it and I said "why not using it also to enhance my TV with a Kodi installation?!"

Ubuntu doesn't have libcec (control kodi with the tv remote) compiled with raspberry support due to license concerns, but I managed to recompile and rebuild the deb
The real problem is the Kodi installation, the GUI is sluggish and takes the cpu busy all the time, hi res movies stutter

With a second microsd I tried libreelec and it works flawlessly, I just can't migrate all the services there due to how it's built and packages limitation

Wiped libreelec I tried Raspberry Pi OS 64bit based on debian buster, the package Kodi is broken and it can't even be installed. They say it's still in beta stage.
(2020-11-20, 10:53)TeslaZap Wrote: [ -> ]Wiped libreelec I tried Raspberry Pi OS 64bit based on debian buster, the package Kodi is broken and it can't even be installed. They say it's still in beta stage.

Kodi on Raspberry Pi OS works just fine, there is no beta software on Raspberry Pi OS.
I recommend that you follow this tutorial: https://www.raspberrypi.org/forums/viewt...6&t=251645
I think 64-bit OS is the issue here - it will need a 64-bit build.
In theory that should work and support hw hevc decode on Pi4,
but building for 64-bit is going down an largely untrodden path,
so there may be obstacles.

I believe a 64-bit LE build has been made that worked,
but you lose widevine compatibility (32-bit only), so no Netflix/Amazon,
and so that's not something LE are pursuing.
(2020-11-22, 15:35)popcornmix Wrote: [ -> ]I think 64-bit OS is the issue here - it will need a 64-bit build.
In theory that should work and support hw hevc decode on Pi4,
but building for 64-bit is going down an largely untrodden path,
so there may be obstacles.

Which branch of kodi do you recommend for a 64-bit build with HW decoding?  Your gbm branch?  Also, I assume we need to use the rpi-5.10.y branch of kernel to get the needed headers and libs?
(2020-11-20, 17:40)rascas Wrote: [ -> ]
(2020-11-20, 10:53)TeslaZap Wrote: [ -> ]Wiped libreelec I tried Raspberry Pi OS 64bit based on debian buster, the package Kodi is broken and it can't even be installed. They say it's still in beta stage.

Kodi on Raspberry Pi OS works just fine, there is no beta software on Raspberry Pi OS.
I recommend that you follow this tutorial: https://www.raspberrypi.org/forums/viewt...6&t=251645

The relatively new 64 bit version of Raspberry Pi OS is, itself, still Beta though I believe?
(2020-11-22, 17:25)graysky Wrote: [ -> ]Which branch of kodi do you recommend for a 64-bit build with HW decoding?  Your gbm branch?  Also, I assume we need to use the rpi-5.10.y branch of kernel to get the needed headers and libs?

I'd start with upstream kodi and build for gbm. When you have that working you can look at getting the hw accel enabled (e.g. my gbm branch).
5.10 kernel is recommended (although 5.9 should behave the same currently).
Pages: 1 2