Mini-Itx basedMP3 Player
Please Note:This is borrowed without permission from: http://www.mini-itx.com/projects/headunit/default.asp?page=1
I wanted to retain a permanent copy for my own records.
Current head units while starting to support USB drives and MP3/WMA files have a few drawbacks - firstly there a limits on the number of files that can be accessed by various media, secondly they are painfully slow loading files, and thirdly they are yet to support lossless music files (excluding the Phatnoise Phatbox). My aim was to produce a music player capable of playing both lossy (MP3/WMA/etc) and lossless media (FLAC/APE/WAV) for the price of a cheap headunit.
Things high on my list were a fast loading time, fast song change time and low resource requirements. Low on the list were a fancy colour screen, touchscreen, etc.
SoftwareMy first task was to find any software capable of undertaking this task. After playing with varying versions of Windows, ignoring Linux as I'm not capable of a well stripped down install, and ignoring BeOS/Zeta due to possible hardware compatability issues, I came to DOS (MS-DOS, DR-DOS, FreeDOS, they are all pretty much identical). In DOS I had an operating system with a fast boot time, practically zero resource overheads, and is damn easy to use. The downside of DOS was the realisation of "Where the hell am I going to find a modern media player for it?" After painstaking browsing I finally happened across a website linking to the strangely titled application - MPXPLAY. Looking at the features it supported all the files I was interested in:
- AAC (Advanced Audio Coding from http://www.audiocoding.com (in RAW/ADTS/ADIF fileformats))
- MP4/M4A (MPEG4 container (only AAC in MP4 is supported))
- AC3 (Dolby AC3 from http://ess.engr.uvic.ca/~aholtzma/ac3 and http://www.dolby.com)
- APE (Monkey's Audio from http://www.monkeysaudio.com)
- DTS (Digital Theatre Systems from http://www.videolan.org/dtsdec.html)
- FLAC (Free Lossless Audio Codec by http://flac.sourceforge.net and http://ffmpeg.sourceforge.net)
- MP2,MP3 (Audio MPEG Layer II/III from http://www.mpg123.de)
- MPC (MPEGPlus/MusePack from http://www.uni-jena.de/~pfk/mpp)
- OGG (Ogg Vorbis from http://www.xiph.org)
- WAV (uncompressed wave files)
- CDW (Audio-CD 'ripp and play' on the fly)
To enable MPXPLAY to display long file names, DOSLFN was used.
HardwareThe next stage was to procure hardware. While my first plan was to use an old Pentium 200MMX motherboard and CPU I had laying around alongside a SoundBlaster AWE32 soundcard, I soon ran into difficulties what with them being too large to feasibly fit into my Toyota MR2. I needed a small motherboard and I wanted it to be cheap!
The answer was the VIA EPIA 5000 motherboard running a 533 MHz Eden CPU. It was easily up to the job at hand while only measuring 17cm x 17cm x 4.5cm - small enough to fit into the DIN slot in a car. While hardly a powerful machine it was more than up to the task at hand. I needed memory for it which came in the form of an old 128MB stick of SDRAM I had lying around.
After the hardware to run the software I needed a power supply for it. While it's possible to use a 12V-240V inverter and a normal PC PSU it's incredibly wasteful of space in the car, and is generally frowned upon electrically. The solution there came in the form of the M1-ATX PSU, it only weighs in at 90W but that's enough to power the motherboard, and a couple of regular PC hard drives, or a couple of laptop hard-drives and a laptop CD drive.
To store the music I needed a hard drive, so I purchased a 40GB laptop drive with an adaptor to use it with a regular pc.
Finally I got the screen, it's an inexpensive Hitachi HD44780 based screen that runs from the parallel port on the motherboard and features a 20 character wide, 4 line display.
All in all the raw parts cost weighed in around $170.
ConstructionAssembling the parts was easy. The power supply itself takes a live, ground and ignition feed from the car to run, and it gives a remote out when it is on. The PSU connects to the motherboard via a regular ATX power lead and there are a set of jumpers that can be connected to the motherboard's power switch pins that allows the PSU to turn the PC on and off.
Once assembled the hard drive was put into my desktop PC where it was formatted as FAT32 and MS-DOS 6.22, DOSLFN and MPXPLAY were installed. The mpxplay.ini and autoexec.bat files were configured (explained later) and saved on the drive. Then music files were copied across. Once complete the hard drive was put on the rig and it was test booted from a car battery, whereupon all worked fine. At this stage I was using a keyboard to control the software, and was testing compatability with a SoundBlaster Live card.
Building the ControllerMPXPLAY supports input from a keyboard, mouse, joystick, serial port, or parallel port. A keyboard offered the most options, though obviously using a full size keyboard in a car would be cumbersome. A more suited solution was required. Borrowing inspiration from another install by TomG involving the adaption of a stock Ford headunit to control a IR remote for his Nakamichi headunit which was hidden out of sight, I decided to use the stock Toyota headunit in the car as the controller. This also added an extra element of stealth to the install.
The initial phase was much easier than expected, as the donor keyboard itself undid via 9 clips:
This opened to reveal 3 layers of plastic film and a circuit board that sat under the caps-lock/scroll-lock/num-lock LEDs. In this shot the circuit board has been removed:
Under the top layer of rubber "springs" that activated the keys, the key switches themselves were simple tracks printed on the plastic that once depressed connected to the layer beneath in a matrix fashion:
Once opened out to show the two layers it is possible to trace where the various lines run. These coincide with various pins on the circuit board. From there it is possible to draw up a matrix of what pin connections coincide with which "key", in the photo below I'd already started marking some out in pen:
Once I had a list of keys I then set about stripping the stock head unit out to just a case and the fascia:
Then I set about wiring buttons on the head unit to the relevant pins on the keyboard controller circuit. To make life easier I only used one "row" of keys, though if I chose I could wire up more keys at a later date:
For good measure I also took the stock volume controller and wired RCAs to it so I could feed my output into it before it went to the EQs, to enable me to have an analogue volume control for ease of adjustment.
Software ConfigurationThe final step was to setup the software. The harddrive contained all my music and I'd used winamp on my desktop to create various playlists I'd want to listen to. The first step was to make MPXPLAY run automatically on bootup. For this I needed to create a file called autoexec.bat in the root directory of the harddrive. It contained the following text:
c:/doslfn/doslfnThe next step was to configure the keyboard controls to be relevant to what I had selected. In the DOCs folder theres a list of all the codes that relate to each key. Note: where the programmer referred to certain keys as "gray" it means keys on the number pad. So you browse through the mpxplay.ini file under the keyboard control section removing keycodes relevant to the keys you are using and replacing them with the code: "0xffff" which means "no key assigned". The next step is to find the functions you want to use and assign the relevant keycode to it, so if I assigned "b" to be "skip to next track", in my mpxplay.ini file the line would read:
KeyStepForward =0x3062 ;The main keys I set up were volume up and down, skip to next track, pause (which unpauses when pressed again), random on/off and repeat on/off. An extra function of the software is the ability to browse a file manager or playlist independently (called the editor in the software). I assigned one key to "KeyEditChgSide" which changed the main view from the filemanager to the playlist. I also set up keys to browse up and down the editor, and a key to select. I could now control opening of files and playlists and select songs to play in playlists directly. Next I assigned a key to "KeyLCDpageNext", the function of which will be explained below.
Finally I assigned a key to Exit the software. Exiting the software saves the settings for volume, current playlist, current playing track, where in the track we are, the status of the random and repeat modes as well as other settings with no keys assigned - all of which won't otherwise be saved at power off. This does means this button needs to be pressed every time you want to save your settings for when you next start up the software.
The next stage in the mpxplay.ini file was to set-up the display settings. Different screens are referred to as pages, and you will need 2 pages, one to show information on the current track playing and one to show the editor, this is where the "KeyLCDpageNext" function comes in to let you change what you see. There's a fair amount of customisation here (information is in the Lcd_disp.txt file in the DOCS directory), and you can create more pages if you want but here is an example of mine:
[LCDdisplay] LCDport =LPT1 ;LPT1..LPT4 or COM1..COM4 LCDtype =1 ;1,2,3,4: LPT, 5,6,7,8:COM-port LCD LCDrows =20 ;number of characters/line (usually 8-40)(max. 512) LCDlines =4 ;number of LCD lines (1-16) LCDportdelay =5 ;for LCDtype 1,2,4 (value should be between 1 and 500 (or maybe more))(increase it if the display doesn't work properly, reduce it to get a faster displaying) LCDrefresh =0 ;refresh delay (lower value faster, higher value slower refresh (0=40fps,1=20fps,3=7fps,5=4fps)) LCDscrollspeed=4 ;(-"-) LCDscrolldelay=30 ;pre-delay before scrolling (20 = 1 sec) LCDpagereset =400 ;(re)set LCD to page 0. after n/20 sec (20 = 1 sec) if there's no desktop (keyboard) activity ;LPT to LCD controlbit configuration for LCDtype 1 and 3 (different wiring schemes, different bit configs)(0x01=LPT-pin 1, 0x02=LPT-pin 14, 0x04=LPT-pin 16, 0x08=LPT-pin 17) ;(note: old LCDtype3 cfg: RS=0x08,E1=0x01, old LCDtype4 cfg:RS=0x04,E1=0x08) (set the unused bits to 0x00) LPT_cntrlbit_RW=0x02 ;read/write bit (used at type 3) LPT_cntrlbit_RS=0x04 ;register select bit (command/data) LPT_cntrlbit_E1=0x01 ;enable (data send) for controller 1. LPT_cntrlbit_E2=0x08 ;enable for controller 2. (LCDtype 1 only: 4x40 displays) ;display-item config(s) LCD_items=1,linescroll,P_TITLE," "; LCD_items=2,linescroll,P_ARTIST," "; LCD_items=3,p_timepos,"::",p_songtime; LCD_items=4,2,"[Vol:",mix_vol,"|",s_hq,"|",s_re,"|",s_rn,"]"; LCD_items1=1,linescroll,editorhlinem1," "; LCD_items1=2,linescroll,editorhline," "; LCD_items1=3,linescroll,editorhlinep1," "; LCD_items1=4,linescroll,editorhlinep2," ";
These settings tell the software to use a 20x4 display based on the HD44780 chip. The first page will show the song title and artist, let you know how far into the track has played and what the full song length is, and tell you the volume level, whether high quality is switched on, the repeat mode, and whether random is activated. The second page will show the editorbrowser, the second line of the screen is the currently highlighted file with the other three lines showing the tracks either side.
The final thing to set is the startup setting. At the end of the mpxplay.ini file you'll find these settings and you'll need to adjust them to look something like this:
[startup] StartupEnabled =11 OldListType =0 OldListname =C:\ OldSongname = OldFrameNum =2755These settings tell the software to load the last saved playlist and track settings as well as any other variables for the software and when the exit key is pressed to save the current settings.
One final note: When setting up the software I found playback to be faster than it should be. When connected to a monitor, a part of the screen displays the playback speed - you can adjust this speed until the playback sounds normal. Then you need to edit this line to reflect the speed shown in the software. For some reason I found it did not save this setting when exiting:
Speed =100 ;-sp
InstallationThe next step is to install the parts in your car. As I used the stock head unit as the controller placing that in the car was easy. Being a non-smoker I used the ashtray as the home for my LCD screen. After that a simple MDF base was made to house the motherboard, PSU and hard drive in the glove box. While this could be tidied and potentially placed in the dash (I've a doubleDIN dash) the glovebox is never used anyway and made the perfect target location.
A caddy slot was made for the hard-drive so that it's easily removable from the carPC to slot into my desktop to update the music files there. It's possible to set a simple script to copy new files from a CD/DVD in the attached CD/DVD drive but as I didn't put one in I use the relatively simple method of updating via my PC.
Some shots of it installed. There's nothing really to see when it's playing except the text on the screen as above:
ConclusionThis will give a cheap and simple music player. You just need to connect the speaker out from the motherboard to any processors you have or to your amplifier. You may or may not have noise and/or protection issues like this - I didn't but it depends on the amp/processor you are pairing the motherboard with. A solution is to use the motherboard's digital output into an external DAC/Processor (I've used a Nakamichi DAC101, you could equally use an Alpine 3900, or H700, or a Rockford EPX, etc) which would also gain you better sound quality over the onboard soundcard. And while you can run the PC from your car's stock loom (it's fused at 10 amps), I'd recommend running a dedicated feed (mine also switches on via a relay but that is because of dodgy electrics in my car on the ignition line).
If you are feeling brave you could wire anything up to be a controller, or you could buy switches yourself and make your own from scratch and incorporate the screen into that, rather than have the screen seperate. You could fit a TFT screen and use the main display from MPXPLAY over the limited LCD one. Alternatively you could use a PLED display using the same Hitachi HD44780 controller and hide it behind some smoked perspex for added stealth.
Obviously this is just one method of making a carPC and there are many more. This one is hinged on speed and sound quality, it boots in seconds, changes track instantly and is easilly stealthed for security.
Software LinksMPXPLAY :: http://www.geocities.com/mpxplay/
DOSLFN :: http://www.geocities.com/jadoxa/doslfn/index.html
FreeDOS :: http://www.freedos.org/