View RSS Feed

Sonicxtacy02

  1. Automotive Computing (R)Evolution - The Android Head Unit Build - Touchscreen Setup

    by , 06-25-2013 at 06:50 PM

    A part of the thrill of using custom hardware is that eventually you will run across an obstacle. The resistive touchscreen that's used in the Lilliput and Xenarc monitors presented quite the thrill when connecting it to the ODROID-X2.

    Upon plugging in the USB connector the initial response is delightful. The touchscreen will automatically begin responding to touch. The problem lies in where those touches occur based on the position of your finger on the screen. The X and Y axes are reversed, leaving you with a touchscreen that cant really be used. Unfortunately, the solution isn't as easy as it would be in Windows, where a simple recalibration of the touchscreen would correct the issue. The driver that allows the touchscreen to operate on the ODROID-X2 is a part of the system kernel files, and the only real way to apply any fix is to recompile the OS with the modified kernel files.

    Luckily I have Googled enough to stumble on an easy to use guide to correct the issue and get the ODROID-X2 working in harmony with our standard touchscreen fare. This solution may work on other Android development boards, but obviously your source files will vary.

    I must note that I take NO credit for the solutions presented here. It's mostly a combination of information found at these two sources:

    http://forum.odroid.com/viewtopic.php?f=51&t=83
    https://groups.google.com/forum/#!to...86/uNo7a39-s3I



    Requirements
    -A computer running Ubuntu
    -Android SDK with ADB installed (I used this guide to set it up)
    -Download the Toolchain application for Ubuntu from here
    -Download the Android Beta 1.6 Kernel Sources from here

    Steps
    1. Open the Terminal application in Ubuntu and run the following command. You will need admin access as well as the admin password as these are root commands:
    Code:
    sudo apt-get install build-essential libqt4-dev xz
    2. If your Ubuntu is installed on a 64bit machine, you will need to run the following commands (if not, go to step 3)
    Code:
    sudo apt-get install package-name:i386
    sudo apt-get update
    sudo-apt-get install ia32-libs
    3.Run these commands to install and configure Toolchain:
    Code:
    tar -jxvf arm-2010q1.tar.xz
    cd arm-2010q1/bin
    export CROSS_COMPILE=`pwd`/arm-none-linux-gnueabi-
    4.Unpack the kernel sources. Run the following commands:
    Code:
    tar zxvf kernel_4412.tar.gz
    cd kernel_4412
    5.Configure Toolchain for your ODROID-X2 storage type.
    If using the eMMC module enter:
    Code:
    make ARCH=arm odroidx2_android_emmc_defconfig
    If using an SD card enter:
    Code:
    make ARCH=odroidx2_android_sdmmc_defconfig
    6.At this point you can minimize terminal, and navigate to the directory where your kernel sources were unzipped (should be in Home folder, a folder called kernel_4412). In this folder, navigate to the file kernel/drivers/hid/hid-input.c. Open this file with a text editor, as we will be modifying a small portion of the file with the corrected code.

    7.Find the hidinput_hid_event() function, and append the following code between the lines that read "input_event(input, EV_MSC, MSC_SCAN, usage->hid);" and "input_event(input, usage->type, usage->code, value);" . You can use the find/search capability to help locate these lines within the hidinput_hid_event() function:

    Code:
    -//+RDG: patch for eGalax touchscreen: swap X and Y, invert X
    direction
    -if (usage->type == EV_ABS)
    -{
    -        if (usage->hid == HID_GD_X) {
    -                usage->code = 1;        // vs 0 (X becomes Y)
    -                value = 4096 - value;
    -        } else if (usage->hid == HID_GD_Y) {
    -                usage->code = 0;        // vs 1 (Y becomes X)
    -        }
    -//printk("RDG: hidinput_hid_event: type = %d, code = %d, value = %d
    (hid = 0x%x)\n", usage->type, usage->code, value, usage->hid);
    -}
    -//-RDG
    (In the event you cant find this/don't want to be bothered with it, the modified version of the file is attached)



    8. Save and close the file and maximize your terminal window. Run the following command to build the modules:
    Code:
    make -j4 ARCH=arm zImage modules
    This step can take several minutes, so be patient.

    9. copy the modules to the ODROID-X2 by running this command:
    Code:
    adb remount
    for module in `find . -iname *.ko`; do adb push $module /system/lib/modules ; done
    10.Copy the kernel... we're almost there:
    Code:
    adb push arch/arm/boot/zImage /system/lib/modules
    11.Flash the kernel to complete the process!:
    Code:
    adb shell
    cd /system/lib/modules
    busybox dd conv=notrunc seek=2455 bs=512 if=zImage of=/dev/block/mmcblk0
    sync
    exit
    adb reboot
    This command reboots the ODROID and should fix the touchscreen axes!

    Attached Thumbnails Attached Files
  2. Automotive Computing (R)Evolution - The Android Head Unit Build - The Quest for Power

    by , 06-22-2013 at 08:05 PM


    The Quest for (always-on) Power

    A part of the challenge when planning the Android head unit build was finding the best way to power the development board in the car. One area that tablets and smart phones have an advantage over a development board like the ODROID-X2 is that they come with a battery. This means that not only can the be powered by something as simple as a 12v car plug, but also that there's some level of power remaining after the vehicle ignition stops.

    As mentioned in previous posts, my choice to provide a stable power output to the 5 volt 2 amp ODROID-X2 is the Minibox intelligent DC/DC converter. The Minibox device can be configured to provide the 5 volts the X2 needs, as well as the 12v a standard Lilliput touchscreen requires. While this device can provide the power the development board demands during a drive, there's no easy way to notify the ODROID-X2 that the ignition signal is off and the board needs to shut down gracefully. A quick search on Amazon presented me an opportunity to potentially never have to shutdown, effectively creating an always-on solution for the ODROID-X2.




    The Anker Astro E4 is an external power source specifically designed to recharge tablets and smart phones. It provides a mammoth 13000mAh, enough juice to completely recharge a Samsung Galaxy S3 twice over and then some. The new plan given the E4's specs is simple. Instead of the Minibox DC/DC powering the ODROID-X2 directly, it will instead charge the external battery pack. The battery back will then serve a constant dose of 5 volt power to the ODROID-X2. Using the all too valuable android app Tasker, I can set the development board into a low power state, stopping all non-critical processes and turning the WIFI and GPS devices off. Tasker can automate this task based on my phone disconnecting from the Bluetooth connection the ODROID-X2 creates upon startup, then automatically restore the power state upon Bluetooth reconnection.


    The key to the planned implementation of the battery is the real-world battery life available, a factor that I've only begun to start testing. Nevertheless, the preliminary results are very promising. With the ODROID-X2 in full power mode (no services/devices disabled), the Anker battery has been running 6 hours without 1 of the 4 charge light indicators showing a partial discharged state. If I can effectively achieve 2-3 days out of a battery charge, the always-on portion of the Android head unit build will be considered a success!

    More test results soon to come, along with a video breakdown of how Tasker automates my Android install.
  3. Automotive Computing (R)Evolution - The Android Head Unit Build - Hardware Overview

    by , 06-11-2013 at 10:33 AM


    The Hardkernel ODROID-X2

    The heart of the Android head unit was obviously the item most considered for a new project build. Because I demand a lot of power from my system, as well as a lot of connectivity options, I simply could not choose the easier way to get Android up and running. The ODROID-X2 is a powerhouse of a development board, boasting specs that meet or exceed my prior Windows based installation. The processor that powers the ODROID-X2 is the Exynos 4 Prime ARM Cortex-A9. With four cores, a default 1.7ghz of power that can be easily overclocked if need be, the ODROID-X2 is the ideal launching platform for a powerful Android car PC. The board houses 2GB of DDR 2 RAM, and boast a very capable 3D graphics processor which can handle more than one would need in the car, unless of course you plan on hosting 4 player Mario Kart 64 tournaments in traffic.




    The Android standard benchmark utilities, Antutu and Quadrant, both prove the ODROID-X2 as a absolute powerhouse of a board. This coupled with its miniature profile at 90x94mm makes it the best choice for an Android head unit.




    Another key factor in selecting the ODROID-X2 for my car PC needs was the ability to purchase compatible hardware accessories at once source. Hardkernel.com sells the board along with compatible Wifi, Bluetooth, UART, and Android-installed storage solutions. For my build, I selected the 64GB eMMC memory module with the thought I could also add a 64GB SD card for additional storage, but you cannot use both at once. The board has a jumper that allows you to select which option you choose.






    The ODROID-X2 has a total of 6 host-enabled USB ports that can provide the max 500mA per port provided your supplied power meets the requirement. Considering that both wifi and Bluetooth need to be handled with dongles and your touchscreen needs an additional port, its safe to assume that at least one powered hub is a good option. Sound output is handled by a single 3.5mm port and input is handled by a second 3.5mm port. Additional components can be connected via the 50pin expansion slot. This allows interfacing with items like LVDS displays, GPIOs and more low-level device interfaces. If ribbon wires aren't your suite, the micro-HDMI port can be your primary display means. Take note though, that the ODROID-X2's HDMI port is hardware locked to display at either 720p or 1080p. That means that for devices like the Lilliput 669, you must use a HDMI-to-VGA adapter to achieve native resolution without overscan.


    Because the ODROID-X2 requires a regulated source of 5 volt 2 amp power, it cannot be powered properly via the unregulated 12v found in most car systems. Because of this, I acquired a Mini-Box DC/DC Power converter. In fact, I acquired two, one for the ODROID, and one for the display, as they both run on entirely differently input voltages. There may be an all-in-one solution that fits your bill, but I like that the two will be isolated. The ODROID-X2 is out of the box capable of auto start on power up, and doesn't need to be shutdown or put to sleep with ignition, so you wont have to deal with any timing issues.


    The rest of the Android head unit installation will allow me to use all of the car PC add-on equipment used from the Windows PC. OBD-II receiver, GPS receiver, USB hard drives, and cameras can all be plugged in and work without much muss or fuss. The eGalax touchscreen module found on the new Lilliput 669 charged with the task does however require some kernel modifying to work properly. More on this in the next blog.

    While finding a spot for the ODROID in my compact vehicle wont nearly be the hassle of my Windows system, finding a suitable case to protect it from at least some of the bumps and bruises of the road became somewhat a chore. Custom cases aside, there are a few eBay retailers which provide a solution. My choice of casing can be shown below. While it doesn't provide much side protection, my new Android head unit looks good in it's two-piece .


  4. Automotive Computing (R)Evolution - The Android Head Unit Build Part 1

    by , 06-05-2013 at 01:49 PM


    The Crossroads...

    Somewhere, far too long ago to remember, I realized that a “practical” Windows-based car PC platform with all the bells and whistles may perhaps be an unreasonable goal. Now that my seemingly powerful-enough hardware is becoming more and more unreliable (and outdated), I find myself smack dab in the middle of crossroads pertaining to the future of my automotive infotainment platform. On one hand, I’ve got years and thousands of hours invested into attempting to create the perfect Windows automotive ecosystem. The other hand sees a more efficient platform brewing in Android, with updates and supporters that are seemingly blurring the lines between “on the go” and “in the car” applications.



    Old (Not So?) Faithful


    Perhaps I should have prefaced this blog with the fact that I am not a user of the “common” Windows car PC. My current Zotac/Intel dual-core car PC features include the following capabilities:

    - GPS Hardware with live tracking
    - Tire Pressure Monitoring
    - SpaceNavigator Control
    - Parking Sensor Interface
    - Rear Backup Camera
    - Fusion Brain with a host of various Sensors
    - XM/HD Radio
    - Custom Bluetooth Phone Hardware
    - Bluetooth ODX MX
    - USB Array Microphone for hands-free communications
    - A total of 21 USB devices, spread over 3 self-powered USB hubs


    All this hardware and more is being delicately managed by my choice of front end software. For the most part, the system as a whole works. But there are times where resume for system sleep doesn’t occur so smoothly, HD Radio fails to initialize, or the system draws so much voltage at rest that it completely drains an auxiliary power cell.


    The New Kid On The Block



    Now, based on the details of the Windows system, one might surmise that the run of the mill android tablet install might come short of fulfilling my demands. Raspberry Pi seemed initially intriguing, but falls short on true horsepower. In short, I need an Android board that can haul the load without compromise, all while sipping power. Enter the ODROID-X2, a 1.7ghz quad-core Android development board, complete with 2ghz RAM and a 64GB eMMC module. Essentially, this is the same Exynos4412 chip that powers the international variant of the Samsung Galaxy S3. It’s safe to say this device should meet my demands at a mere 5 volts and be powered by a Mini-Box DC/DC Power Converter.


    So the challenge as I so dramatically impose on myself, is to build a complete and total Android-based car PC platform to replace my current system and all of its capabilities. Join me as I get to know the development board, power up the system for bench testing, attempt the in-vehicle installation, and configure all necessary software along the way. Ultimately, the project may finally solve my longing desire to reliability integrate all of my madness into a modern automobile. Success or failure, every few days comes a new adventure. Check back next time for a new hardware component overview.