ODROID-C2 Kodi Media Center: Build Your Own Entertainment System With A Custom LED-enabled Case

I am one that likes my movies, and also one that likes to fiddle and make, so the two came together in wanting an easy way to play things from my movie/music collection. It had to be simple to use, reliable and look good too. My movie / music collection is stored on a NAS drive allowing me to store the originals out of the way. So, I thought it was going to be simple given that all I wanted to do was play Blu-Ray iso’s, DVD VideoTS/VOBs, CD MP3s and FLAC files.

Over the years, I have tried many media clients on various platforms, but they were often tripped up by poor audio and unreliable video playback. It did not seem to be related to cost as I have spent a fair bit on dedicated media-center PCs over the years. I have even purchased ready-made solutions. One thing that did keep happening though, was that I kept coming back to Kodi, previously known as XBMC.

Then came along the Raspberry Pi, which was full of promise, attractively priced, with lots of dedicated programming from the Kodi community. For the money, it is incredible what can be done. However, I found everyday use sluggish and even with my basic video standards with many would cause it to skip and stutter.

Kodi installation

Anyone who has used Kodi will know that it comes in a huge number of flavors supporting a huge range of hardware. After the support issues of keeping the OS alive with Windows I knew this had to be moved out of the picture and came across a build called LibreELEC that supplied a basic Linux OS leaving all the power of the device to be dedicated to the main purpose of running Kodi. After a bit of research and LibreELEC’s supported platforms, I came across Hardkernel’s ODROID-C2 – RPi like in size and cost. With it I had a slick Kodi platform up and running in minutes and it just worked! So much so it sat as just a bare board on top of my set-top box in my lounge for ages. I almost forgot about it, sitting back playing movies. Installation is simple:

A note on the reader: I am not sure if this has been fixed, but I found that using Rev0.2 20130402 of the reader tricky and it only seemed to work with certain slots or SD adaptors. I think it is down to the mechanical tolerances of the PCB.

Finding a home for the ODROID-C2

Along came a nice shiny 4K OLED TV, and I took stock of my supporting hardware thinking it was really about time to find the ODROID-C2 a proper home/housing. With most of the purpose build units wrapping the PCB you end you with cables coming at the box from all angles and I wanted it to be more like a set top box. A quick search came up with a nice Aluminium chassis from DoukAudio available all over eBay.

Figure 1 - DoukAudio Chassis
Figure 1 – DoukAudio Chassis

However, I still had to get all the connections I needed to the back of the chassis including, power, LAN, USB and HDMI. Again, a search on eBay resulted in a viable short HDMI adapter.

Figure 2 – HDMI Adapter
Figure 2 – HDMI Adapter

PSU

From my involvement with RPi’s I knew a good PSU was also important, so I built my own basic internal 5V 2A supply that was hardwired directly to J8 of the C2 PCB and followed the advice to remove jumper J1 disabling the USB OTG input.

You could of course purchase a ready built module if you do not feel confident with mains or just power via the normal way using the micro USB port or DC jack.

Heatsink

Given that I had a nice large Aluminium case it seemed sensible to heatsink the C2 via the housing rather than drilling holes all over it and/or using forced air. I removed the stock heatsink and used a block of aluminium to take the heat of the processor out to the case.

Figure 3 – Heatsink
Figure 3 – Heatsink

Overclocking

With a nice cool processor, I had some headroom for overclocking. A good power supply is a must. I suggest overclocking one step at a time. First, I followed the overclocking steps in the forum article: (https://forum.odroid.com/viewtopic.php?t=30078&p=214852). For me it was a case of loading up the eMMC card on a PC and editing the boot.ini file to see what worked. A CPU frequency of 1.752GHz was stable for me. This was the line I added to the boot.ini file:

 setenv max_freq “1752”
If there are any other lines starting with setenv max_freq simply comment them out using a “#” in front eg: #setenv max_freq “1536”. Plug the card back in to the C2, reboot and test. Next, was setting up the 792 Mhz graphics chip overclock (https://goo.gl/TgGqVx). For this you need to login to your box while it is booted. First you need to know its IP address and this can be found on the Kodi Settings/System information/Network page. Then using a telnet client such as PuTTy (https://www.chiark.greenend.org.uk/~sgtatham/putty), SSH into your box and logon as root using the password libreelec. At the command line run the following, then reboot:
 $ echo "echo 5 > /sys/class/mpgpu/cur_freq" >> /storage/.config/autostart.sh
The final overclock you can apply is to the RAM (http://odroid.com/dokuwiki/doku.php?id=en:c2_adjust_ddrclk). Again, SSH into your box and enter the following:
 $ wget https://dn.odroid.com/S905/BootLoader/ODROID-C2/c2_update_ddrclk.sh
 $ chmod +x ./c2_update_ddrclk.sh
 $ ./c2_update_ddrclk.sh 1104
 $ reboot
Please note that overclocking is a trial and error process and not all systems will work the same due to factors such as component tolerances, but give it a go. I was able to overclock the RAM, graphics and processor and still maintain a reliable Kodi box albeit just that much slicker to use and navigate, which was a nice freebie.

Remote Control

A disadvantage of housing the C2 in this way was that the IR remote did not work with the lid on and this was needed to power the board ON/OFF. There are some options to attach an IR receiver via the GPIO pins, but it was a simple task to remove the IR receiver and extend it, so it sat behind one if the existing 3mm LED holes on the chassis front plate. I enlarged this hole to 5mm. Other navigation and control was made super responsive by using the USB Bluetooth adapter (https://goo.gl/zYPdkc), which sat on the rear panel of housing.

Figure 4 - ODROID-C2 Wiring
Figure 4 – ODROID-C2 Wiring

Front Panel Power LED

One thing was left: I wanted an LED on the front panel to tell when the box was alive. Now the C2 already has some Red & Blue LEDs mounted on the PCB. But the Red LED is connected to the 5V rail and is on all the time the board has power even if the OS has gone to sleep. The Blue heartbeat LED flashes and flickers with activity and can be distracting so much so that this has been turned off with more recent builds of LibreELEC.

I needed another way and the obvious route was the GPIO (https://goo.gl/GzKcVY) pins. Now, I am no programmer and I had already given myself the mental block that it was going to be to hard to implement and put out a request for help on the forum (https://forum.odroid.com/viewtopic.php?f=144&t=30505). In the meantime, I did some digging and it turns out that access to the pins has been made really easy (https://goo.gl/KQVMLD) by Hardkernel.

The LED is 3mm, which is a nice press fit into one of the pre-drilled holes of the front panel. Being a high efficiency White LED, it does not take much current to make it light up and I did not want a flood light illuminating the room. So, I chose a high value current limiting resistor of 47k ohms wired in series with the LED. There is a 3.3V @ 3mA limit on the pin. I could have used Ohm’s law to work out the value, but I just used trial and error to get a brightness that I liked.

I then connected it between 0V & GPIO pin 249 (Pins 7 & 9) of the J2 Header. You can use pins of your choice I just used these because they were next to each other and I could use a pre-wired connector I had.

Figure 5 – ODROID-C2 & LED
Figure 5 – ODROID-C2 & LED

With some simple additions to the startup and shutdown scripts, I now have my LED. I edited the files by SSH’ing in and first edited the autostart.sh file:

 $ nano /storage/.config/autostart.sh
I then added the following lines:
 $ echo 249 > /sys/class/gpio/export
 $ echo out > /sys/class/gpio/gpio249/direction
 $ echo 1 > /sys/class/gpio/gpio249/value
For the shutdown procedure, I edited the shutdown.sh file:
 $ nano /storage/.config/shutdown.sh
I then added then following lines:
 $ echo 0 > /sys/class/gpio/gpio249/value
I am not sure if this is the best way, but it works for me. Coupled with a Logitech Elite remote to manage my AV system I now have a family friendly media center.

Figure 6 - Chassis Front
Figure 6 – Chassis Front

Figure 7 - Chassis Rear
Figure 7 – Chassis Rear

Figure 8 - Chassis Internals
Figure 8 – Chassis Internals

For comments, questions, and suggestions, please visit the original forum post at https://forum.odroid.com/viewtopic.php?f=144&t=30505.

Be the first to comment

Leave a Reply