How to install Kodi on an ODROID-C1 as a standalone mediacenter

The ODROID-C1 ist just too cool not to have. This feature-packed ARM7 quad core Linux mini computer comes with an incredible price tag of $35. However, with all the accessories (RTC-battery, power supply, case, mini-HDMI cable, eMMC card, remote control…) and shipping from Korea, the final price is around $100. It’s going to replace my Raspberry Pi which I initially intended to use as a media center but it always felt a little too slow for the task, even with the highly tuned Raspbmc.

Since I wanted the ODROID-C1 to run Kodi without a desktop manager (but with an Ubuntu repository), I started off with the Ubuntu 14.04 minimal image provided by Hardkernel. Don’t forget to resize the root partition to its true size once the ODROID-C1 is up and running (and reboot again!). I’m recommending the Odroid-Utility for doing this. And while you’re at it, make sure to “Update udev rules for ODROID subdevices” in the “Update your Kernel/Firmware” menu. If you forget this step, Kodi might abort with ERROR: failed to initialize egl display.

odroid-c1-kodi-summary

I’m assuming here that the ODROID-C1 has network connectivity and you’re logged in as root.

With a few adaptations, this information was taken from my existing post on how to install Kodi on an Ubuntu 14.04 server.

rm -rf /etc/ssh/ssh_host_*_key
dpkg-reconfigure openssh-server
dpkg-reconfigure tzdata
apt-get update
adduser --disabled-password --disabled-login --gecos "" kodi
apt-get install python-software-properties pkg-config software-properties-common kodi xinit alsa-base alsa-utils alsa-tools xserver-xorg-video-mali odroid-remote policykit-1
usermod -a -G audio kodi
usermod -a -G video kodi
usermod -a -G dialout kodi
usermod -a -G plugdev kodi
usermod -a -G tty kodi

Make sure /etc/asound.conf looks like this:

pcm.!default {
  type hw
  card 0
  device 1
  format S16_LE
}

ctl.!default {
  type hw
  card 0
}

Select “Anybody”:

dpkg-reconfigure x11-common

Create /etc/init/kodi.conf with the following contents:

# kodi-upstart
# starts Kodi on startup by using xinit.
# by default runs as kodi, to change edit below.
env USER=kodi

description     "Kodi-barebones-upstart-script"
author          "Matt Filetto"

start on (filesystem and stopped udevtrigger)
stop on runlevel [016]

# tell upstart to respawn the process if abnormal exit
respawn
respawn limit 5 120
limit nice 21 21

script
  exec su -c "xinit /usr/local/bin/kodi --standalone -- -nocursor :0" $USER
end script

Paste this into /etc/rc.local right below the shebang (#!/bin/sh -e) line:

chmod 666 /dev/am*
chmod 666 /sys/class/video/axis
chmod 666 /sys/class/video/screen_mode
chmod 666 /sys/class/video/disable_video
chmod 666 /sys/class/tsync/pts_pcrscr
chmod 666 /sys/class/audiodsp/digital_raw

This seems to prevent the Failed to open Amlogic Codec error.

Here’s some additional fine-tuning from Fatih from the comments below (thanks Fatih!). Add this line to the end of /etc/security/limits.conf:

kodi - nice -1

To get a shutdown/reboot menu create /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla and insert:

[Actions for kodi user]
Identity=unix-user:kodi
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Now is probably a good time to reboot the ODROID-C1. Kodi should start up at boot time from now on. You can restart Kodi with service kodi restart.

If you’re having any problems to start Kodi, have a look at the log files in /home/kodi/.kodi/temp and check for crashlogs in /home/kodi.

30 thoughts on “How to install Kodi on an ODROID-C1 as a standalone mediacenter

  1. Hi Jan,
    please excuse my bad english , this is not my native language .
    I installed according to your instructions Kodi . After booting Kodi is not started . I see only the logon prompt .
    When I log in as root and try Kodi to start manually , then I just get an error message ( “ERROR: Unable to create GUI. Exiting”) .
    I can not find any log files in /home/kodi . The list is empty .

    Is it a problem that in addition root and Kodi another user has been created ?

    • Sam, you could have a look at the X11 log file in /var/log/Xorg.0.log or something like that. It looks like a video driver problem but I have never seen this error before.

      Cheers,
      Jan

      • I could not find the first X11 log file . So I simply entered times startx in the shell . Then there was a Xorg.0.log . I ‘ve found some errors in it. But I will not really smart of it. Maybe you can do with it even more .

        [ 250.747] Current Operating System: Linux odroid-c1 3.10.80-131 #1 SMP PREEMPT Thu Oct 15 19:53:29 BRT 2015 armv7l
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
        [ 250.803] Initializing built-in extension MIT-SCREEN-SAVER
        [ 250.905] (EE) Error: MaliSetup
        [ 250.905] (EE) Error: MaliIdentify
        [ 250.926] (EE) Error: MaliProbe
        [ 250.926] (EE) Error: MaliHWProbe
        [ 250.927] (EE) MALI(0): [mali_drm_open_master:1326] Error: mali_drm_open_master DRM OPEN (fd: 0x8)
        [ 250.936] (EE) MALI(0): [mali_drm_open_master:1326] Error: mali_drm_open_master DRM OPEN (fd: 0x8)
        [ 250.961] (EE) Error: enter to aml_disp_init
        [ 250.961] (EE) Error: success to aml_disp_init
        [ 250.992] (EE) AIGLX error: dlopen of /usr/lib/arm-linux-gnueabihf/dri/Mali DRI2_dri.so failed (/usr/lib/arm-linux-gnueabihf/dri/Mali DRI2_dri.so: cannot open shared object file: No such file or directory)
        [ 250.992] (EE) AIGLX: reverting to software rendering
        [ 251.087] (EE) MALI(0): [maliModifyPixmapHeader:185] Error: GET_UMP_SECURE_ID_BUF1 returned 0x37a8eb5e offset: 0 virt address: 0xb4eb2000 fb_virt: 0xb4eb2000
        [ 251.087] (EE) MALI(0): [maliModifyPixmapHeader:190] Error: GET_UMP_SECURE_ID_BUF2 returned 0x440617ed offset: 7056000 virt address: (nil) fb_virt: 0xb4eb2000

      • I’m afraid, I can’t help you with video driver problems. Maybe someone in the Odroid C1 forum knows why it can’t find those shared object files.

        Cheers,
        Jan

    • Hi,
      if your X doesn’t start after upgrade,
      check your /media/boot/boot.ini and check if the line
      setenv m “1080p”
      is uncommented.
      The upgrade rewrite many configuration files

  2. Have the same error as Steve in Kodi error log: ERROR: failed to initialize egl display. The Option “Update udev rules for ODROID subdevices” has no effect.

    An easy System-Update “apt-get update && apt-get dist-upgrade” crash all.

  3. ah, not sure what went wrong last time, but after a bit of a fight, and a cleanup of mismatched kernel versions on the minimal image, I started again, and kodi is working!

    Thank you…

    Only issues I now have are:
    – Odroid Wifi adapter isn’t detected
    – Odroid IR remote doesn’t do anything /me sobs

  4. Oh, and one other quick question, how do I get the odroid supplied wifi adapter to be recognised, that seems to be missing from the minimal image too :-(

    (I just hope the OEM IR remote is supported after all this, or I’ll be back to exactly the same dead end as I am with Openelec).

  5. I seem to be having a bit of a fight.
    I installed the minimal image, that booted fine. No odroid-utility though, so had to wget that from git:
    wget -O /usr/local/bin/odroid-utility.sh https://raw.githubusercontent.com/mdrjr/odroid-utility/master/odroid-utility.sh
    chmod +x /usr/local/bin/odroid-utility.sh

    That threw some errors, apt-get update was required to fix that.

    I then expanded the partition and did “Update udev rules for ODROID subdevices” (I’ve done this several times!).

    I then followed the rest of your instructions, everything seemed fine… Except the screen flashes a few times, and I’m left with a command line log in…

    The kodi log shows the infamous ERROR: failed to initialize egl display.

    Any ideas? I’ve run the “update udev….” menu option several times.

    • I make it :)
      Install python-dbus
      and add org.freedesktop.NetworkManager.* to actions in /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla

    • Did you read the release notes?
      “+eMMC cards generally don’t work with this image. Venture into eMMC territory at your own risk.”

      I’m using the Droid as a DNS resolver, VPN client, Smokeping and MRTG monitor, DB server AND as a standalone multimedia server. Try this with OpenELEC.

      On the other hand, it might be more stable as it looks like the ones behind the Ubuntu Odroid-C1 repository just broke HDMI audio in the latest Kodi update today :(

      • You’re perfectly right to go custom build like your guide, if that’s the case.. My suggestion was for those who only wish to use C1 as a standalone media server, like myself.
        However, I would honestly feel like wasting the power of the C1 as an only media player now because I know c1 is capable to do alot more than just a media server. I felt this way right after trying to install stunnel on openelec, realizing there is no apt-get lol

    • Faith, thanks for pointing out that OpenELEC is now available for the C1. I know this just came out in the past 24 hours. I plan to give it a try, I have used their OE image on a Odroid U3 with success.

      Jan, I agree with your point about the eMMC with this OE image and still like the minimal build concept. This will be more flexible with additional features/functions such as game emulation, home automatic, etc. Right now I’ve only been playing with the minimal build for about a day. I need more time to tweak the minimal build since right now I get only sound or picture when streaming video files from the web. In my experience this could take minutes to fix or months depending my free time and other people’s feedback.

  6. Great write up! I followed it and did get Kodi working but I have a couple of questions. 1. I too had the same issue mentioned above about not having a “input” group. Do I need to create this group manually and if so does it need any specific properties? 2. Kodi plays local network video files properly but I didn’t get any video/picture (only audio) when streaming video files from the web. I had to uncheck amcodec and OpenMax under video hardware acceleration to get streaming video files to work proper from the web. Do others have this issue or a better solution to this problem? 3. What is the best way to configure wifi on this build? I have everything working using the Ethernet cable but wifi would be nice and I don’t see anything to configure it. Thanks for getting information out there about this new board.

    • You may be better off with the OpenELEC build Fatih mentioned below since (AFAIK) you can configure wifi using some sort of plugin that’s already present in OpenELEC. Maybe the video streaming is better as well.

      As for the tutorial above, you can safely ignore any warnings/error regarding the input group.

      Cheers,
      Jan

  7. Cool, I will try that. I installed ubuntu from the full blown-installation and stipped off things I do not need, but I thing your strategy is better. But in my experience, the 15.0-alpha version is too shaky and not ready for the stage. I get memory corruption and core dumps, on first look it is not an odroid issue. So, what is you impression on stability, and has anyone made a 14.0 or 14.1 version of KODI?

    • I’ve only watched like 4 movies and a couple of tv shows but it’s been super stable. However, I agree with you, using an alpha version isn’t too smart. I didn’t even notice it was the 15.0 alpha. Is there a binary repo for a working 14.1 version? I’m not really looking forward to compile it on my own – it’s gonna take a loong time unless one can x-compile it.

      Cheers,
      Jan

  8. Excellent How-To, for some reason I had to add the group input, also the audio seems to be out of sync with the video and i haven’t been able to sync it in kodi.
    Thank you for posting this,
    I’ll see what i can find with my audio issue
    sam

    • OK I have seemed to clear up the problem. Originally had
      privileges to /dev/am* taken care of by a rule in udev,
      once i copied the statement into /etc/rc.local
      the audio is synced up now
      thanks

  9. I confirm the guide works. Thanks a lot.

    Here’s a suggestiong;
    Below steps gives KODI the abilities to Power Off, Restart, Etc the Odroid C1 so it becomes more standalone system. Also some steps to give Kodi more priority;

    Priority mods:
    Modify /etc/init/kodi.conf
    # tell upstart to respawn the process if abnormal exit
    respawn
    #Add below 2 lines
    respawn limit 10 5
    limit nice 21 21

    Add this line to the end of file;
    /etc/security/limits.conf

    Reboot, Shutdown mods:
    Create /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla and insert below lines;
    [Actions for kodi user]
    Identity=unix-user:odroid
    Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*;org.freedesktop.login1.*
    ResultAny=yes
    ResultInactive=yes
    ResultActive=yes

    I’ve already tested above mods and they work fine.

    • CORRECTION to my previous post – Please ignore it

      I confirm the guide works. Thanks a lot.

      Here’s a suggestiong;
      Below steps gives KODI the abilities to Power Off, Restart, Etc the Odroid C1 so it becomes more standalone system. Also some steps to give Kodi more priority;

      Priority mods:
      Modify /etc/init/kodi.conf

      # tell upstart to respawn the process if abnormal exit
      respawn
      #Add below 2 lines
      respawn limit 10 5
      limit nice 21 21

      Add this line to the end of file /etc/security/limits.conf;

      kodi - nice -1

      Reboot, Shutdown mods:
      Create /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla and insert below lines;

      [Actions for kodi user]
      Identity=unix-user:kodi
      Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*;org.freedesktop.login1.*
      ResultAny=yes
      ResultInactive=yes
      ResultActive=yes

      I’ve already tested above mods and they work fine.

  10. I am very sorry but I forgot an important step;
    make sure to “Update udev rules for ODROID subdevices”
    My mistake. Now it works.

  11. Sorry, it doesn’t work. Kodi crashed with below error. Have you tested it before posting?

    16:26:41 T:3036704768 ERROR: failed to initialize egl display

    I tried the steps on a fresh minimal ubuntu image on hardkernel website, upgraded to latest kernel;
    Linux odroid 3.10.66-50 #1 SMP PREEMPT Sat Jan 31 18:43:36 BRST 2015 armv7l armv7l armv7l GNU/Linux

Comments are closed.