Login Form
| Linux CarPC Software Walkthrough |
| Written by Jason | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Thursday, 04 January 2007 00:00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() 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
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) or, if you happen to own a Mazda, you can get my custom bootsplash version both files are available in my files section. 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 (found in my files sectaion) 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:
After you have created the bmp file, you can merge it into your bios file. You will need a program called CBROM (found in my files section). I was only able to find the windows (DOS) version of this program, so that's what I used:
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:
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:
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 (in the files section) 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 (in the files section). If you are using genkernel, you can copy my kernel config to /etc/kernels/kernel-config-x86-`uname -r` and then run genkernel.
Config Files Some useful car configs.
Packages You will want to come up with a list of packages that makes sense for you, but here is what I installed:
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 (in the files section), 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
First off, the current stable gentoo via driver did not compile for me. Unmasking the unstable did the trick:
Now emerge Xorg and your favorite window manager. I went with Fluxbox for it's versatility, and small footprint:
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). You will need subversion for this:
Now get the sources:
Compile and Install:
Lastly you want to make sure your modules get loaded, and X if configured:
Now grab my xorg.conf (in the files section), 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. 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:
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:
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!
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:
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.
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.
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 :)
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/:
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 :
And to return the original Myth Menu:
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:
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:
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.
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:
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.
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:
This creates 'COM2' in your windows environment. When you launch iGuidance, make sure to set the GPS device to COM2. 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:
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:
All this script does is determine if you are currently on desktop 0 or 1, and toggle between them. 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:
|


