Home     Tech Headlines     Gallery     Links     Feedback     Register    Login




Table of Contents

1. Introduction
1.1 Hardware Table
1.2 Hardware Sources
2. BIOS
2.1 Customizing your BIOS
3. OS Install
3.1 Kernel
3.2 Config Files
3.3 Packages
4. Xorg
4.1 Install Xorg
4.2 Install Openchrome
5. Touchscreen Driver
5.1 eGalax Driver
5.1.1 Get the Driver
5.1.2 Install Additional Packages
5.1.3 Install the Driver
5.1.4 Notes on the Driver
5.1.5 Test and Calibrate
5.1.6 Final Notes
5.2 evtouch Driver
5.2.1 Get the Driver
5.2.2 Configure Your Kernel
5.2.3 Install the Driver
5.2.4 Find the Right Event
5.2.5 Calibrate and Configure
5.2.6 The Phantom "Double Click"
5.2.7 Final Notes
6. MythTV
6.1 Unmask .20
6.2 Install
6.3 Setup the Database
6.4 Run Mythtv-Setup
6.5 Launch the Frontend
6.6 Customize It
7. On Screen Info - New
7.1 Install xosd
7.2 Install onscreend
7.3 Install gxmessage
8. GPS Navigation
8.1 GPS Software That Doesn't Work
8.1.1 GPSDrive
8.1.2 RoadNav
8.1.3 Navigator
8.2 So What DOES Work ?
8.2.1 Configure Your Kernel
8.2.2 Install CrossOver Office - Updated
8.2.3 Create New Bottle
8.2.4 Load Maps
8.2.5 Disable Warning
8.2.6 Add User to tty Group
8.2.7 Add Serial Port to CXOffice
8.2.8 Configure Xorg
8.3 Making it Better - New
8.3.1 Install wmctrl
8.3.2 Install bbbutton
8.3.3 Make a Wrapper Script
8.3.3 The New Launch Script
8.3.4 Video!
8.3.5 Pictures!
9. More Coming Soon!



Introduction

Here it is! The very delayed, and much requested software walk-thru for my Mazda CarPC. First off, to everyone who emailed me, I am sorry this took so long. Getting married and buying a house tend to slow down a person's documentation efforts :) Plus, by the time you are done reading this, you will see why it took so long!

Let me start with a simple table of what hardware I am using and what drivers are needed to make it go:


Hardware Table

Hardware Status Details
VIA C3 E-Series 1.0GHz Processor, Nehemiah core Works
Integrated VIA Unichrome 2D/3D graphics with MPEG-2 Accelerator Works Currently using openchrome drivers.
VIA Networking Tahoe VT6103 Fast Ethernet 10/100 PHY-ceiver Works
VIA Vinyl Six-TRAC Audio AC' 97 codec Works
Lilliput 7" VGA touchscreen Works Using evtouch 0.8.1 with Xorg 7.1
Gyration Cordless Optical Air Mouse and Compact Keyboard (RF Mouse/Keyboard) Works No special configuration needed - OS just sees a USB mouse and keyboard.
TripNav USB GPS Receiver TN-200 Works Just enable ftdi_sio in the kernel config
D-Link DBT-120 Bluetooth Works Just enable Bluetooth in the Kernel
D-Link DWL-AG530 802.11a/g Dualband Wireless PCI card Works Using madwifi driver, but had to do this hack.
Motorola E815 Cell Phone Works Using bluetooth tethering I can use the cell phone as a moem to get on Verizon's highspeed EVDO network. I average about 756kb/s, which is sufficient to stream TV from my house :)
Elmscan 5 usb Works The system sees the serial interface created by the Elmscan, now I just need some decent software.
Hardware Sources
You can see the more detailed hardware list here. But it is worth mentioning here that all hardware came from either Mp3Car.com, Mini-Box.com, or G-NET In Vehicle Computing (or BestBuy :) ).

Ok, so that is a VERY high level overview, now on to the nitty gritty...

BIOS

Well, I suppose the best place to start is with the BIOS. With v2.0 of my CarPC, I opted to go all out. Meaning I want this carputer to look as "factory" as possible. For me this meant changing the "Via" BIOS splash screen. You know, the very first thing displayed when you turn on the computer. I changed mine to this (click for full size):


Even if you are not as hardcore as me, you may want to update your BIOS anyway. The BIOS revision I started with did not support the native resolution of my Lilliput touchscreen (800x480). Updating to the latest revision (1.16 as of this doc) fixed this issue. You can get the latest BIOS revision here. Because I never trust sites to stay up, you can get the BIOS revision I used (unmodified) here. Or, if you happen to own a Mazda, you can get my custom bootsplash version here.

To update your bios, grab yourself a nice new BIN file. If you are not going to add a custom splash, all you have to do is make a boot disk and copy awfl823b.exe and the .bin file to the boot disk. Now boot off the disk and run the awfl823b.exe, giving it the name of the BIN file when it asks.

If, however you want to go all out, read on...

Customizing your BIOS
If you want to customize your BIOS splash, you need to start by making a new splash image. The image needs to be 640x480 and Indexed to 256 colors. If you are using Photoshop, you do this by first creating the image, then selecting Image->Mode->Indexed Color. In the new window, for Palette, I selected System (Windows). And make sure you select None for Dither. Now save the file in TIFF format. Select LZO for the compression type so the image is small enough to fit in the BIOS bin file.

Now you need to convert the image to something the BIOS understands. Download AWBMTools from here. There are both Linux and Windows versions available. Extract the files and read the README. To convert your image you should need to ru something like this:

> ./tiff2awbm logo.tif logo.bmp


After you have created the bmp file, you can merge it into your bios file. You will need a program called CBROM. I was only able to find the windows (DOS) version of this program, so that's what I used:

C:\> CBROM215 I0100116.bin /logo logo.bmp


If you get an error, chances are the image you created was too big (too detailed). Try again with a less detailed image. If you are desparate to get a larger image in, you can free up some space in the BIOS by deleting some uneeded stuff (read the README that came with AWBMTools for details).

If there were no errors reported, you can verify your new BIOS is ok by running:

C:\> CBROM215 I0100116.bin /d


Look for the filename of your logo in the output. If it's there, you are ready to try out your new BIOS! Just install as described above.

OS Install

My OS of choice ? Gentoo of course! I started with a stage 3 install of 2006.1. Install according to Gentoo's Install Handbook. Before you reboot, you will want to run tune2fs on all your partitions:

> tune2fs -c 0 /dev/hda#


Replace # with each partition number. This is to prevent the system from checking the filesytem on boot. Chances are, you chose a journaling filesystem (ext3 is fine for our purposes), and a fs check is a real pain when you are waiting for your CarPC to boot :). Take a look at my make.conf for my setup. Once you have your make.conf all set, proceed with a normal Gentoo install.



Kernel
I opted to go with gentoo-sources for my kernel (2.6.18-gentoo-r3), and for ease of use, used genkernel to build it. I did however use the --menuconfig option to really fine tune things. Below are some options I set, mostly to support my hardware. If you have the same hardware as me, or if you're lazy, you can use my kernel config. If you are using genkernel, you can copy my kernel config to /etc/kernels/kernel-config-x86-`uname -r` and then run genkernel.

Gensplash Options
Device Drivers --->
 Graphics support: --->
   [*] Support for frame buffer devices
   <*>   VESA VGA graphics support
           VESA driver type (vesafb)  --->
Device Drivers > Graphics support > Console display driver support:
 [*] Video mode selection support
 <*> Framebuffer Console support
Device Drivers > Graphics support:
 [*] Support for the framebuffer splash















Evtouch Options
 Device Drivers --->
    Input device support  --->
		<M> Event interface --->
    USB support --->
                <M> USB Touchscreen Driver
                  











GPS Reciever BU-353
 Device Drivers --->
    USB support --->
        USB Serial Converter support --->
            <M> USB Prolific 2303 Single Port Serial Driver









Bluetooth
Networking --->
  <M> Bluetooth subsystem support --->
    <M> L2CAP protocol support
    <M> RFCOMM protocol support
    [*]   RFCOMM TTY support
        Bluetooth device drivers --->
          <M> HCI USB driver













Config Files
Some useful car configs.
/etc/conf.d/rc:
RC_PARALLEL_STARTUP="yes"
RC_PLUG_SERVICES=""
RC_NET_STRICT_CHECKING="none"
RC_FORCE_AUTO="yes"
RC_DEVICE_TARBALL="yes"
svcmount="yes"











Packages
You will want to come up with a list of packages that makes sense for you, but here is what I installed:
> vim ufed acpid screen slocate syslog-ng vixie-cron coldplug hotplug grub
gentoo-sources genkernel dhcpcd splashutils splash-themes-gentoo splash-themes-livecd bind-tools alsa-utils xosd x11-terms/aterm gpsd







Xorg

As of this writing, the current stable X server in Gentoo is Xorg 7.1. This is a modular server, which is nice because you only have to compile the pieces you need. If you look at my make.conf, you will see that I specified VIDEO_CARDS="via". This will cause the system to install x11-drivers/xf86-video-via - but this is not the X driver we will be using. As I stated above, I am using the latest openchrome drivers (2.10.2 is what I am running). I only use the 'via' VIDEO_CARDS flag so that packages like mythtv will be compiled with support for the via hardware acceleration. But this also means in order for things to get compiled against the right libraries, you must first install (emerge) xorg-x11, then install the openchrome via drivers (overwriting the emerged version), THEN install anything that would compile against the via driver. This is how:

NOTES: (clean this up later): had to unmask unstable via driver - and follow http://gentoo-wiki.com/HARDWARE_Unichrome
  1. First you want to install Xorg
    First off, the current stable gentoo via driver did not compile for me. Unmasking the unstable did the trick:
    > echo "x11-drivers/xf86-video-via ~x86" >> /etc/portage/package.keywords




    Now emerge Xorg and your favorite window manager. I went with Fluxbox for it's versatility, and small footprint:
    > emerge -vD xorg-server fluxbox




    Now go do your taxes, paint the house, or call your mother and ask her how her day was. Compiling all the dependancies on the Nehemiah is going to take a while (hours).

  2. Install OpenChrome
    You will need subversion for this:
    > emerge -va subversion




    Now get the sources:
    > mkdir openchrome
    > cd openchrome
    > svn co http://svn.openchrome.org/svn/trunk







    Compile and Install:
    > cd trunk
    > ./autogen.sh --prefix=/usr
    > make
    > make install








  3. Get ready for reboot
    Lastly you want to make sure your modules get loaded, and X if configured:
    > echo "via-agp" >> /etc/modules.autoload.d/kernel-2.6




    Now grab my xorg.conf, take a look at it and make any changes you deem necessary.

    Once your xorg.conf is setup to your liking, go ahead and reboot and test it out.

Touchscreen Driver (Lilliput 7" VGA)

Below I document the install and configuration of 2 different Linux drivers for the Lilliput 7" touchscreen (also works for a number of other touchscreens). I documented both because I tried both. My personal preference is the evtouch driver. If you don't know which to use, try the evtouch first. It is the opensource driver, and I personally have had better luck with it.

eGalax Driver
When i started updating all the software on my CarPC, by far the biggest headache I had was with the touchscreen. I updated to a modular Xorg (7.1), and I could not get the evtouch driver to compile. As a result I was forced to find an alternative. It turns out The company that makes the touchscreen also made a linux driver, although not for Gentoo. This means I had to "shoehorn" it in. The following steps are an adaptation of the notes I found for Debian:

  1. First grab the installer: We will be using the Fedora Core 6 drivers.
    > wget http://www.egalax.com.tw/web20/drivers/Fedora/Fedora6.tar.gz




  2. Next you will need sharutils, xmkmf and tcl:
    > emerge -va sharutils imake tcl




  3. Now install the touchscreen driver
    # extract the tarball you downloaded
    > tar zxvf Fedora6.tar.gz
    # run the extracted file
    > ./touchkit.setup.sh
    # this will fail, but it creates the needed install files:
    > cd /tmp/touchkit
    # The setup script is looking for the `rpm` command, which we are obviosly lacking. We want to skip this part of the install:
    > vi setup
    # Delete lines 11 ("package=(make tcl tk)") through 39 ("done").
    # Another thing the installer is going to try is to update /etc/rc.d/rc.local, so we have to give the install what it wants:
    > mkdir /etc/rc.d
    > ln -s /etc/conf.d/local.start /etc/rc.d/rc.local
    # Now you are ready to run the setup again (this time step 1 will be skipped
    > ./setup
    # When prompted, select option #2: (2) Full Mode (RS232, PS/2 and [USB])
    # The installer should finish successfully now.






















Notes on the eGalax Driver:
  • The accuracy is not great. I had MUCH better accuracy with the evtouch driver.
  • This driver requires 2 daemons to run: /usr/bin/usbpnpd and /usr/bin/tpaneld
  • The kernel module gets installed to /lib/modules/tkusb.ko (not ideal)
  • The tpaneld process seems to create the needed devices: /dev/tkdat0 /dev/tkpanel0, and some others. However, the creation is slow, and they were not getting created in time for X to see them.
Here are some thing I did to clean up these problems:
  1. First move /lib/modules/tkusb.ko to /lib/modules/`uname -r`/kernel/drivers/usb/input/tkusb.ko (this is a little more conventional
  2. Next comment out the entries the installer made to /etc/rc.d/rc.local (/etc/conf.d/local.start):
    #rmmod touchkitusb #insmod /lib/modules/tkusb.ko # /usr/bin/usbpnpd
  3. Now, we want to start /usr/bin/usbpnpd as early as possible so it has time to create the devices before X starts. I did this by editing /etc/init.d/modules:
    Go to line 117. Just before the end of the start() function you will see a line like this:

    [[ -n $(modprobe -l -t boot) ]] && modprobe -a -t boot \* &>/dev/null

    Add this line BEFORE that one:

    /usr/bin/usbpnpd
Test it out:

Now reboot and give it a try. If all went well, X should launch and respond to touchscreen input (although it may not be what you expect). There are 2 calibration utilities that also got built with the touchscreen driver. I recommend you copy these somewhere useful, and run the calibration:
> emerge -vD xhost
> su -
> cp /tmp/touchkit/diag/25pcal /tmp/touchkit/diag/4pcal /usr/local/bin/
> /usr/local/bin/4pcal /dev/tkpanel0
# hold your finger on each pulsating dot until the pc speaker beeps, and the next point starts pulsating.








Final notes on the touchscreen:

As I said, the accuracy of this driver is not very good (at least for me). When I relied on this driver, I also kept a wireless gyration mouse in my car as a backup for when the touchscreen got really annoying. I am very happy that the evtouch driver was updated, and I am able to use that now.





evtouch Driver
After not being satisfied with the eGalax driver, I did a LOT of searching to get the evtouch driver working. A forum post suggested I use the precomoiled binary. When I went to download it, I found, much to my surprise, that the developer had updated his driver to version 0.8.1. The new version has a proper configure script (which previous versions lack). And more importantly compiles against my modular Xorg!

  1. First grab the sources: We will be using version 0.8.1
    > wget http://www.stz-softwaretechnik.de/~ke/touchscreen/xf86-input-evtouch-0.8.1.tar.bz2




  2. Now make sure your kernel is configured properly : The evtouch driver is only the Xorg driver, in order to make the touchscreen work, you will also need the kernel driver. Make sure have these options set in your kernel.
    # Now verify you can load the kernel modules
    > modprobe evdev
    > modprobe usbtouchscreen






  3. Install the evtouch Xorg driver: Now compile and install the Xorg driver.
    > tar jxvf xf86-input-evtouch-0.8.1.tar.bz2
    > cd xf86-input-evtouch-0.8.1
    > ./configure
    > make
    > make install








  4. Next you need to know the right event Interface: The kernel driver works by creating a raw event interface that will pass coordinates to the Xorg driver. Unfortunatley, this means Xorg does not dynamically find the right USB device. If you change the usb port the touchscreen is plugged into, you will have to repeat this step
    > cat /proc/bus/input/devices
    # Look for N: Name="eGalax Inc."
    # Two lines under that you should see something like:
    # H: Handlers=mouse1 event5
    # Note the event number
    # Now you may need to create the event devices
    > mknod /dev/input/event0 c 13 64
    > mknod /dev/input/event1 c 13 65
    > mknod /dev/input/event2 c 13 66
    > mknod /dev/input/event3 c 13 67
    # And so one, max is event31 but 5 should be plenty















  5. Calibrate and Configure: Now (re)start Xorg. Using a mouse, not the touchscreen, open a terminal and do the following (make sure you have an Internet connection):
    > wget http://www.timekiller.org/carpc/files/calibrator.c
    > gcc -L/usr/X11R6/lib/ -lX11 -o calibrator calibrator.c
    # Now tht the calibrator is compiled, run it
    > ./calibrator /dev/input/event5
    # Replace with the proper event number.








    Touch the points in order. When you are done, you will be given 4 values for Min/Max X/Y coordinates. Use these to create the new input device in your xorg.conf:

    	Section "InputDevice"
    		Identifier "touchscreen0"
    		Driver "evtouch"
    		Option "Device" "/dev/input/event3"
    		Option "DeviceName" "touchscreen"
    		Option "MinX" "62"
    		Option "MinY" "1910"
    		Option "MaxX" "1966"
    		Option "MaxY" "45"
    		Option "ReportingMode" "Raw"
    		Option "SendCoreEvents"
    	EndSection
















    Replace with your event number, and the values from your calibration. You may also have to play with additional options like "SwapX" "SwapY" and "Rotate". See this for more details.

  6. The Phantom "Double Click" Many people using the evtouch driver have complained of a double click that occurs when tapping the screen. I experienced this too, which was frustrating when trying to type an address into iGuidance. After a lot of searching, and some experimenting, I fixed the issue on my screen. Here's how :
    # The double click appears to be caused not by the touchscreen device, but the regular mouse input.
    # I, like many people, use "/dev/input/mice" as my normal mouse device. It seems this caused a second
    # click when using the touchscreen. One from the raw event, and one from the mouse device
    # By changing my mouse input to the actual standard mouse device, not the generic "all mice" device, I elimated the double click:
    Section "InputDevice"
            Identifier  "Mouse0"
            Driver      "mouse"
            Option      "Protocol" "IMPS/2"
            Option      "Device" "/dev/input/mouse0"
            Option      "ZAxisMapping" "4 5"
            Option      "Emulate3Buttons" "yes"
    EndSection



















Final Notes:

Calibration is not very stream lined. There is plenty of info out there, so do some googling if you run into problems. This driver is still pretty young, so I expect things will get better eventually.



MythTV

Now this where we get to the heart of the CarPC. Truly the most important part of a car computer is it's interface. It has to be intuitive, functional, and easy to use. Of the options available in linux (admittedly, not very many), MythTV seemed to have the most versatility, and able to accomplish everything I wanted it to. The downside, is that MythTV is designed to be a homebrew PVR. This means there is a LOT of stuff in there that we will not need (record TV for example). This makes MythtTV a rather bloated option for a carpc. On the upside, MythTV has been around for a while, has some really great features and is visually very appealing. If you are going to build a linux based CarPC, I would suggest you look at all the options, and chose something that fits your needs. For me, aside from functionality, a "from the factory" look was most important. Read on to see how I accomplished this.

  1. First we need to unmask the .20 version of MythTV:
    > su -
    > vi /etc/portage/package.keywords
    # Enter the following lines:
    media-tv/mythtv ~x86
    x11-themes/mythtv-themes ~x86
    media-plugins/mythvideo ~x86
    media-plugins/mythweather ~x86
    media-plugins/mythmusic ~x86
    media-plugins/mythgame ~x86
    media-plugins/mythnews ~x86
    # Save and exit.















  2. Now install MythTV, and a few of it's plugins:
    > su -
    > emerge -vD mythtv mythtv-themes mythmusic mythvideo mythweather mythnews mythgame
    IMPORTANT: Although I am installing things like mythgame and mythnews, I do not advocate, nor do I practice playing games or reading news articles while driving. These packages are intalled fr testing, and passing time while the car is in a PARKED state.







    Now go do something for a while. Installation here will include mysql, qt, and a bunch of other things. This will take a few more hours :)


  3. Setup the database:
    > su -
    > /usr/bin/mysql_install_db
    > /etc/init.d/mysql start
    > mysql -uroot < /usr/share/mythtv/database/mc.sql







  4. Next run mythtv-setup, this enter some more default DB entries:
    # (run the following from a terminal in X)
    > su -
    > /usr/bin/mythtv-setup
    # (just exit after the window launches)







  5. Time to launch the frontend!:
    # Run the frontend and an unprivileged user - NOT ROOT!
    > /usr/bin/mythfrontend




That's it ! You now have a GUI. There is still plenty of work so do, but if you have made it this far, you are well on your way. There are approximately 1037 different things you can customize within Mythtv, including where you keep your music and videos. Most of which is beyond the scope of this doc. Explore the menus, join the mailing list, jump in the IRC channel if you have myth related questions (in other words, don't ask me!).

Customizing It
Ok, so you have a GUI, what now ? Well, first lets get rid of the menu items we don't want, and add some things we do. Everything in the Myth menus is controlled by xml files. The files we want to edit are located at /usr/share/mythtv. For a good starting point, you can download my CarPC theme. If you are familiar with MythTV, you will notice it is basically a variation of the "Blue" theme. I chose it because the buttons work well with a touch interface. Unpack the tarball to /usr/share/mythtv/themes/:
> su -
> wget http://www.timekiller.org/carpc/files/CarPC_Myth_theme.tar.gz
> cd /usr/share/mythtv/themes/
> tar zxvf ~/CarPC_Myth_theme.tar.gz








I have made a few changes to the menu items MythTV displays. Menu items are not controlled from the theme, so you will have to overwrite some xml files. I made 2 scripts which will make it easy to switch between my menu and the default Myth theme :
> su -
> cd /usr/share/mythtv/themes/CarPC
> ./createcarpcui.sh






And to return the original Myth Menu:
> su -
> cd /usr/share/mythtv/themes/CarPC
> ./returnmythui.sh






Now restart the mythfrontend, and navigate to Utilities/Setup->Setup->Appearance. Select the CarPC theme. Also, select "OpenGL" for the Paint Engine (makes the menus fade in and out, and looks GREAT. trust me). This will more or less give you the same interface I am currently using. I am sure there are changes you will want to make. The Mazda logo for example (unless you have a Mazda). I suggest you explore the theme, and the xml files to make the changes that suit you. For example, I have added a number of menu items that run scripts or external apps that I need, and you may not (the script to conect ot Verizon's EVDO network, which is discussed later, is a good example).

I created a couple of (poor quality) videos to show the interface in action:
  • Music - Shows the touchscreen menu navigation (note the pretty OpenGL transitions). Also shows a little of the music visualization.
  • Weather - Shows what the weather interface looks like.
Mplayer

In order for Mplayer to take advantage of the MPEG-2 hardware acceleration the Via provides, you will have to patch and recompile it.

Patch and Install Mplayer:
> cd /usr/local/src
> tar jxvf /usr/portage/distfiles/MPlayer-1.0pre8.tar.bz2 > wget -o mplayer_xvmc.diff "http://wiki.openchrome.org/tikiwiki/tiki-download_file.php?fileId=17"
# NOTE: You may have a different version of mplayer. Go to here for the latest patches.
> cd MPlayer-1.0pre8
> patch -p1 < ../mplayer_xvmc.diff
> ./configure --prefix=/usr/local --enable-xv --enable-xvmc --with-xvmclib=XvMCW
# I used /usr/local for my prefix so I would not squash the other install of Mplayer.
> make
> su -c "make install"













Be sure to go into your settings for MythVideo and set the default player to /usr/local/bin/mplayer


On Screen Information

When doing some funtions with a car computer, it is useful to have the system give you informational feedback. For example, when I connect to the Internet, I want to know if it connected successfully, etc. For this I use 2 applications: xosd, and gxmessage.

Install XOSD
Xosd is a perfect solution, but it is just a library, you will need an app to actually use the Xosd interface.
> su -
> emerge -v xosd



As I said, this only installs the libraries. Now you need an application.


Install onscreend
I stumbled upon this little app a long time ago. I use it on my main desktop for volume functions. It is very simple, there is a daemon, and a fifo writer. You launch the daemon with your window manager, and anything you echo to the fifo gets displayed on your screen. Unfortunately, there is no portage ebuild, so we have to install it by hand:
> mkdir onscreend
> cd onscreend
> wget http://caladan.nanosoft.ca/download/onscreend.tar.gz
> tar zxvf onscreend.tar.gz
# The developer hardcoded a font that is not on most systems, so we will have to make a source code change:
> vi onscreend.c
# go to line 19 and change:

                    char *font = "-urw-serpentine d-bold-r-normal-*-*-720-*-*-p-*-iso8859-1";
                    char *colour = "rgb:0/0/f";
                    int outline_offset=2;
                    char* outline_colour="rgb:0/0/7";
                    char* shadow_colour="rgb:0/0/3";
                    int delay = 5;
                    xosd_pos pos = XOSD_bottom;
                    int voffset = 150;
                    int hoffset = 0;
                    int shadow = 7;
                    
to:
                    char *font = "-*-times-bold-*-normal-*-25-180-100-100-*-128-iso8859-15";
                    char *colour = "rgb:f/f/f";
                    int outline_offset=0;
                    char* outline_colour="rgb:0/0/0";
                    char* shadow_colour="rgb:0/0/0";
                    int delay = 2;
                    xosd_pos pos = XOSD_bottom;
                    int voffset = 75;
                    int hoffset = 0;
                    int shadow = 2;
                    int scroll_age = 0;
                    struct timeval old_age,new_age;
                    int screen_line = 0;
                    xosd_align align=XOSD_center;
                    fd_set selset;
                    
# There are many configurable option including font,size,color, position, and drop shadow. Tweak these settings until they are what you want.

# Now compile and install:
> make
> su
> cp onscreend putfifo /usr/local/bin
# Finally add onscreend to your window manager startup script (for fluxbox, add it to ~/.fluxbox/startup).
# Restart Xorg, and test it by echoing some text to the fifo:
> echo "Some test text" | /usr/local/bin/putfifo /tmp/onscreen
# Did it work ? If so, you are ready to script some on screen display!































































Install gxmessage
While XOSD is a very useful tool for displaying information, gxmessage allows to you interact with the information by providing the ability to add buttons when the information is displayed. For example, if a connection to the internet failed, I can have gxmessage display a button to retry the connection.
> su -
> emerge -v gxmessage






GPS Navigation!!

Since posting my CarPC page, I have received MANY emails telling me to try out XYZ on linux for my navigation. So, let me first go down the list, so people can stop emailing me:

GPS Software That Doesn't Work
GPSDrive - This does not do turn-by-turn!!! (yet) It is a great app for plotting the course you are currently driving, but can not tell you where to go. I use gpsdrive to plot wifi access points when I wardrive.
RoadNav - This looked very promising when I downloaded it. Unfortunately, it kept crashing when I tried it. There have been new releases since the last time I tried it, but the project still looks like it's too early to be a viable GPS solution.
Navigator - This is actually a commercial GPS app offered for linux! But they do not offer any US maps :( . I emailed them about 2 years ago, and they told me US maps would be offered by months end, needless to say, this did not happen. I finally gave up on waiting for them.

So What DOES Work ?
Ok, so you must be wondering what I AM using for GPS, right ? Well, thanks to this thread on mp3car.com, I decided to try out iGuidance v3 under windows emulation. I have been using CrossOver Office pretty much since the company released its first version. I am a HUGE fan of their product, and what they are doing for the Linux community. Once I saw some positive feedback from someone who tried it on iGuidance, I decided to download the latest beta version and give it a shot. I should note that the latest stable release (5.x) has problems. Read the thread I mentioned above for detils. I am THRILLED that I decided to try this! I can honestly say I have a very good GPS system in my CarPC now. This is HUGE. So how did I make it work ? Here's how:

  1. First make sure your kernel can see the USB GPS device (in my case, BU-353). Look above for the proper kernel configuration.
  2. Install CrossOver Office. I am currently running version 6 beta (will upgrade when 6 stable is released). Update: Crossover Office 6 is out now, and I have upgraded.
  3. Create a new bottle (I used the windows 2000 template) and install iGuidance into it
  4. When the installer finishes, it will auto launch the Map Loader. Use it to copy the maps you need to the harddrive (I copied all of them).
  5. Next I disabled the Warning screen when iGuidance launches:
    > vi ~/.cxoffice/[bottlename]/desktopdata/cxmenu/Desktop.c^5E3A^5Fwindows^5Fprofiles^5FAll^2BUsers^ 5FDesktop/iGuidance+UMPC
    # (Your path might be slightly different)
    # Change the 'exec' line to include "nowarning":
    exec "/opt/cxoffic/bin/wine" --bottle "iGuidance" --check --wait-children --start "c:/windows/profiles/All Users/Desktop/iGuidance UMPC.lnk" "nowarning" "$@"








  6. Add the user that will run iGuidance to the 'tty' group. This ensures the user can read from the GPS device
  7. Make the serial port (GPS device) available to cxoffice:
    > ln -s /dev/ttyUSB0 ~/.cxoffice/[bottlename]/dosdevices/com2




    This creates 'COM2' in your windows environment. When you launch iGuidance, make sure to set the GPS device to COM2.

  8. Last thing is to make sure you are loading 'extmod' in your xorg.conf. Uner the "Modules" section, make sure you have 'Load "extmod"'
Making it Better
Now this is where we get really crazy. What good is GPS Navigation if you can't listen to tunes while you drive ? When I originally set this up, I had Myth launch iGuidance directly, which effectively "locked" Myth until I closed iGuidance. I have since installed a couple of apps and wrote some scripts to fix this. This is how:
  1. First install wmctrl. wmctrl is a handy little command line app to control elements in your desktop environment. You can you it to focus, unfocus apps, minimize them, switch virtual desktop, etc.
    > su -
    > emerge -v wmctrl






  2. Now install bbbutton. This is a very simple dock app that has one purpose: display and image you choose, and execute the command you choose when clicked.
    > wget http://bbbutton.sourceforge.net/bbbutton_0.8.tar.gz
    > tar zxvf bbbutton_0.8.tar.gz
    > cd bbbutton_0.8
    > make linux
    > su
    > cp bbbutton /usr/local/bin/










  3. Next, we change the script used to launch iGuidance. Two things are accomplished here. First, we make it possible to detach iGuidance from Myth. Without this, Myth would "hang" until iGuidance is closed. Second, we want to make sure hitting the iGuidance menu item a second time does not launch a second instance. Below is what the new /usr/local/bin/iGuidance will look like.
    /usr/local/bin/iGuidance:
    #!/bin/bash
    
    STATE=`ps aux | grep iGuidance | wc -l`
                      
    if [ $STATE -gt 1 ]; then
      wmctrl -s 1
    else
      /usr/local/bin/LaunchiGuidance &
    fi
                      


















  4. Finally, lets look at the LaunchiGuidance script. This is the script that really ties it all together. What I am doing is switching to another virtual desktop, launching the dockapp bbbutton which controls switching back and forth, then finally launching iGuidance. When iGuidance is closed, we are automatically brought back to the Myth menu, and the dockapp is closed as well. Here is the script:
    /usr/local/bin/LaunchiGuidance:
    #!/bin/bash
    
    /usr/local/bin/wmctrl -s 1
    
    echo "Launching Navigation" | /usr/local/bin/putfifo /tmp/onscreen
    
    /usr/local/bin/bbbutton /usr/share/mythtv/themes/CarPC/switch.xpm /usr/local/bin/deskswitch.sh &
    
    exec "/opt/cxoffic/bin/wine" --bottle "iGuidance" --check --wait-children --start \
                     "c:/windows/profiles/All Users/Desktop/iGuidance UMPC.lnk" "nowarning" "$@"
    
    /usr/local/bin/wmctrl -s 0
    pkill -9 bbbutton
                      





















    Two things to notice in the above script. First, notice I am making use of xosd/onscreend to let me know Navigtion is launching. This app takes a couple of seconds to come up, so I use this to let me know the command was received and understood. Second, the bbbutton dockapp references 2 other files. The first is an image, which I have made part of my CarPC theme. The second file is the switching script which gets executed when you click (touch) the dockapp. The deskswitch.sh script is as follows:

    /usr/local/bin/deskswitch.sh:
    #!/bin/bash
    
    CURDESK=`/usr/local/bin/wmctrl -d | grep '*' | awk '{print $1}'`
    
    if [ "$CURDESK" == "0" ]; then
    
     /usr/local/bin/wmctrl -s 1
    
    else
    
     /usr/local/bin/wmctrl -s 0
    
    fi
                      




















    All this script does is determine if you are currently on desktop 0 or 1, and toggle between them.

That's it! It may not be some cool new open sourced Linux app, but hey, at least it's navigational software, and it works. This software works great, and gets me where I need to be, I'll take it!

Here's another horrible video showing how smooth this works:


And here are some pics of iGuidance in use:









More to Come!

There is still a lot I want to cover, but this doc took long enouh as it is. Check back, because some of the coolest stuff is yet to come. Here's the teaser to keep you checking:

  • Optimize Boot Time
  • Custom Bootsplash - I created it, I just have to upload and document it.
  • Bluetooth Internet (Verizon EVDO)
  • Streaming Live TV