Search This Blog

Building a Kodi in-car entertainment system using a Motorola Atrix Lapdock and an Odroid C0

Watching movies in the car is great fun. It is even better when you have a camper and lie in your comfy sleeping bag - I needed an in-car entertainment system.
I have a stereo in the car already that can even play videos, but the screen is small, codec support is limited and it is in the front whereas you're sleeping in the back. Tablets with big screen are expensive and have rather bad sound quality. Also I still had this Motorola Atrix Lapdock lying around I wanted to use for a build and try out the Odroid C0 board.
The Lapdock is nice for a Raspberry Pi like SoC. It is basically a 11.5" HDMI screen with a 1366x768 resolution, a touchpad and keyboard, speakers (audio via HDMI), 2-port-USB-hub, and a 36Wh 3-cell Li-Ion-battery built in. It originally connected to a smartphone via a male micro-USB and micro-HDMI plug. To connect the Lapdock to a computer you'll most likely need a micro-HDMI-D (female) to HDMI-A (male) adapter. It comes with a 19V AC/DC power supply, but wanted to power it from the 13V car battery. I had to butcher it...
Taking apart the thing is not so hard. It is the usual small-screws-and-plastic-clips system all laptops use. When you're done the "mainboard" looks like this:

You find the battery connected to a 6-pin connector labeled "JP2". The system needs a 3.3V and >5.5V power supply. The 5.5V voltage sounds strange, but it was measured when the system ran via the 19V AC/DC adapter. With anything below 5.5V USB devices might not work, because then USB supply voltage is < 3.3V and most USB devices do not work below that. I found 5.6V to work fine. Here's the pinout of JP2:

Supplying power is not enough to make the Lapdock display turn on. When you have disconnected the touchpad cable it will not turn anymore, because the touchpad has a reed switch or hall sensor that detects when the Lapdock lid is closed or opened. If you want the mainboard and display to turn on immediately when you supply power, simply bridge two pins on the JTP1 connector:

Bridge the pins marked in green and blue here.
Audio can be sent to the Lapdock via HDMI, so make sure your SoC supports that. The Lapdock has a small audio amplifier that drives the microscopic built-in speakers. If you want to route audio to a better amplifier etc. you have to tap the pins on the APA2031 audio amplifier IC. The typical application circuit from the specs give a hint on where to find the audio signals. The left channel is on LIN- (pin 5), the right one on RIN- (pin 17). GND can be found in a lot of places:

I connected a switch to the pins, so can either use built-in speakers or route audio to the main stereo for better sound quality. Soldering to the IC pins can be quite a pita, because it's quite small...
Now you should be mostly ready to roll. On to the Odroid C0.

The Odroid C0 is a small board sporting an Amlogic S805 1.5GHz dual-core SoC with a Mali 450MP2 GPU (decodes H265/HEVC) and 1GB of DDR3 RAM. The board is as bare-bone as it gets, having only a power and HDMI connector, which gives it a great form-factor. You should order a heat sink though and maybe the connector kit if you want to add a USB-connector, GPIO pins or the IR receiver. If you want a board version with all connectors and Gigabit Ethernet, go with the C1+ which has the same SoC. Hardkernel also sells a small remote for the IR receiver which works quite well (and even out-of-the-box) with the Hardkernel Lubuntu 14.04.03 image.
What is really important though is to get an SD card that works with the board! Not all cards do. Make sure you read this and this before you buy one!
Copying the image to the SD card can be done in Linux with a simple:

sudo dd if=<THE_IMAGE_FILE> of=<YOUR_SDCARD_DEVICE>; sync

Don't forget to properly unmount the card. Now insert the SD card into the device and supply power. On the first boot the image is expanded to the whole card, so give it some time and wait for the C0 to reboot. Now you are greeted with a LXDE desktop. You can adjust the display settings via the "odroid utility". The natural choice would be 1360x768, but that gave me wrong colors and a screwed-up display, but I found 720p to work well. If you know how to use the native 1366x768 resolution, let me know in the comments. The utility also lets you update the kernel and firmware to a current version. Kodi is already installed and can be auto-started by adding it to the Desktop preferences. See here how.
The end result looks like this, and yes, it still needs an enclosure:

Comments

Hey Not sue if you may read this, i noticed your pinouts of the Lapdock and was wondering if you may provide some assistance. BAsically im looking for alternate solder points for the USB line from the JHDMI connector. Wandering if you may have come accross this when working on this project?

Post a Comment

Popular Posts

Installing newer gcc/g++ versions is easy: sudo apt-get install gcc-4.7 g++-4.7
If your system does not provide the new versions, you might still be able to get them via a different repository. Add the toolchain repository to your system and update your sources:sudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo apt-get update
Now you should be able to install gcc/g++. The real problem comes after that. How to make use of the newer versions?

Option #1 - Uninstall older versions
This is sometimes not an option, because lots of dependencies will be uninstalled which you might need, or you want to keep those versions around for compiling stuff that still uses them.

Option #2 - Use update-alternatives to switch versionsThis informative post describes it pretty well. I'll sum it up here. First remove all update-alternatives:sudo update-alternatives --remove-all gccsudo update-alternatives --remove-all g++
Now add update-alternatives for 4.6 and 4.7 and make the g++ configuration a s…

Wow. This was a royal pita. I wanted to build this wake-up-light-alarm-clock-media-thingy for my girlfriend. Well, I got my hands on a RPi Zero and needed an LCD display. I found this nice-looking "WaveShare 4" IPS display" on Ebay and spent days trying to get it to work properly. You want a hint? DONT DO IT! BUY A HDMI SCREEN! Refresh rate sucks, Kodi is not working with hardware-acceleration, Framebuffer copying never worked. Short: It sucked!

So. Next chapter: Bought a 5" HDMI screen here. It has an HDMI input and connects to the RPi GPIO pins for power and touch functionality... and works ALMOST out of the box on a fresh Raspbian install (from 5/2016). Nice!

Sometimes you are in the need to read back the OpenGL backbuffer, or other framebuffers. In my case the question was how to read back a downsampled framebuffer resp. its texture to system memory. There are different methods for this and I wrote a small benchmark to test them on various systems.

UPDATE #1: A thing I've totally overlooked is that you can actually blit the backbuffer to the downsampled framebuffer directly, saving you the FBO overhead (memory, setup, rendering time). I've updated the page and the code reflecting that.UPDATE #2: The code now works on Windows and Linux (via GLX). Maybe I'll port it to GLES2 for the Raspberry Pi too... :)UPDATE #3: The code works on the Raspberry Pi now using OpenGL ES 2.0. Reading the framebuffer is quite slow though even with an overclocked device. It's not the actual reading that is slow, but that we have to render to another framebuffer first and back to the screen. Atm all buffers and textures use RGBA8888, which might s…