Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: WiFi Enabled MP3 player in stanard DIN

  1. #1
    Newbie shinny's Avatar
    Join Date
    Feb 2005
    Location
    Bristol, UK
    Posts
    12

    Single DIN carputer with WiFi

    Right, so this is only my second post here... been lurking on and off for a while, and thought it was about time to let you all know what I've been up to!

    Intro

    I've just graduated from a 4 year computer science course at the University of Bristol (UK), and for the last 4 months or so I had my dissertation to write, based on a piece of practical work that could also be commercially exploitable.

    Last summer (2004), some friends of mine went war-driving, and in the process, made the casual comment about how cool it would be to transfer mp3s to a carputer over 802.11.

    Ok, so that isn't the most novel thing in the world (well, I realise that now, having read this forum a bit)... but I wanted to get this to a place where it would be commercially exploitable and as easy as possible. Thus, I set about cramming a full mp3 / wifi system into a standard DIN headunit... what follows is possibly a slightly inaccurate (and definately not chronological) account of how I went about it, and it's current status:



    1) Rough Planning

    Below is a rough block diagram of how I wanted the system to hook together:



    • Display - 20x4 character LCD
    • Radio - USB controlled D-Link unit
    • Buttons - Hacked PS/2 mouse
    • Wireless Bridge - provides 802.11 while still allowing WOL


    The maximum internal dimersions of a DIN are 178 x 170 x 50, with a chunk taken out of one corner for the connectors, and a faction more width and height at the very front. Knowing this, it very quickly became obvious that no consumer motherboard would actually fit in the space available, let alone allow space for other components. So, I had to find me an industrial embedded motherboard to fit (and have USB, audio and ethernet inc. WOL onboard). I chose an LE-362 from Commell Systems.

    I planned to lay it out roughly as below - it was gunna be tight:




    2) Case & Amp

    So I needed a DIN case. I figured I could rip the stock unit from my aging Vauxhall Astra (for which I didn't have the keycode) and replace with another from a breakers yard (for which I got the keycode). This plan went very nicely, until I lsot the keycode for the latter, leaving myself without music for most of the duration of the project!

    So, having recieved what was actually a very user friendly case from my old stereo, I also ripped the amplifier chips out of it, and contructed a very simple 4-channel amplifier from them.



    I apologise for image quality - all the pics I currently have were taken on a camera-phone, and thus very ropey!

    From that test setup, I realised I'd need an eletronic form of volume control, as when hooked up to an external source at low volume, the signal-to-noise ratio was hideous (unsurprisingly).

    3) Main Components

    To run the system, I'd already decided on setting up an x86 PC within the head unit. I installed Gentoo GNU/Linux on it (as is my preference) and got useful things like networking and audio working.

    I chose an M1-ATX for power, which initially was being power from an old PSU hanging around from my first PC. I had to destroy an ATX motherboard connector salvaged from a very old PSU to provide wiring on the PSU itself, as there was never going to be enough room to get the supplied connector to couple with the M1. This made rigging the system (expecially later on) a slightly fiddly job.

    The wireless bridge was a WGE111, the warrenty on which was almost immediately invalidated as I ripped the plastic case off (which included de-soldering the aeriel from the PCB), took the switchgear off (more on that later) and destroyed the RJ45 connector, soldering a custom 1" cable to it, to fit directly onto the motherboard's ethernet header.

    A word of warning regarding the WGE111 - it will only ever recognise one IP on the wired network and refuses to provide connectivity to any other wired device

    The HDD is a 40Gb Seagate Momentus, with a 40-44pin laptop IDE adaptor. Unfortunately, these adaptors are designed to plug into a pre-existing IDE cable, not directly into the motherboard, and refused to work. It took every single one of the 40 data channels to be swapped on the disk-drive's end before it would work!

    4) LCD Nightmare

    So, I was going to integrate an HD44780 based LCD display into the stereo. That's nice and easy, as the HD44780 is very common and there are 4 different Linux drivers for it! Well, it was easy... eventually!

    The problem was (as I found out on a few occasions), the motherboard was labelled incorrectly. Not only that, the manual was also incorrect, but in a different way! So, when taking my one and only 26pin parallel port connector (the motherboard has 2mm pitch headers, rather than the standard 2.5mm), I was happily getting pin 2 swapped with pin 13, pin 3 with pin 2 etc... I was using a very understanding eBayer for my supply of LCD units, and sent the first one back as defective (having tried three of the four linux drivers, with no success). Figured it out on the second unit, but by the time I had it work it had been soldered onto so much that I was having to solder directly onto lines in the PCB... which broke very shortly afterwards, prompting a desperate plea for help (with the project deadline rapidly drawing in), and a very fast displatch of a third LCD.

    But, it works! I use the LCD-Linux kernel driver, allowing my custom written program to write to a character device (/dev/lcd) as if it were a terminal, and the text appearing on the screen.

    5) Controls

    I'm sure there are more graceful ways of doing this, but I decided to rip apart a cheap PS/2 mouse to use for the control interface. I got hold of the chip from inside (a Topro TP3388ap), looked up the spec and built a new "mouse" on a breadboard. I matrixed 6 buttons onto the three available on the chip, leaving one combination for null and one for an error condition. I also took the switchgear from the scrollwheel and used it on the Y-axis to act as a jog-dial for the front panel.

    The wireless bridge also needed some control - both power and access point / ad-hoc modes needed physical controls. These were achieved via two DPDT push switches, thus allowing a tri-colour LED to indicate if the power was off (red), or the wireless was on in access point (green) or ad-hoc (orange) mode. The LED and bridge were both powered from the 5V STBY line from the M1, with diodes in place to allow it to draw from teh standard 5V when the system is powered on.

    Finally, an analogue potentiometer was used to control the volume of the audio provided to the amplifier.



    6) Building into the case

    By good planning (or good luck), everything more-or-less fitted!



    I hacked together supports for various components from balsa wood or acrylic sheet, which a number of components held in place my foam. Therefore, teh force of the case shutting would hold everything in place in an almost completely screwless design. The disk-drive in particular was held in purely by foam to try and provide some shock insulation. It's only at this point that things actually start to look promising...




    7) Software

    I custom wrote the software myself (mainly because I was doing a software based degree and I wanted to get some marks). Initially I tried using ALSA for my audio output, but for some reason it wouldn't play properly, despite the code working perfectly on my desktop. I resorted to using the OSS emulation layer on ALSA, which works just fine.

    The mp3 decoding is achieved using libmad, and the control events are gathered by directly reading /dev/psaux. Using FFTW, I created a spectrum analyser for the LCD display. I also started putting an sqlite backend on the system, to allow fairly intelligent playback schemes, when...

  2. #2
    Newbie shinny's Avatar
    Join Date
    Feb 2005
    Location
    Bristol, UK
    Posts
    12
    8) Disaster!

    Three weeks before my demonstration (and two before written thesis deadline), the filesystem corrupts, with about 15 hours of work not backed up, including all the database code. I install the drive into a desktop machine to try to recover what I can, but, as there is no space for molex connectors in the DIN case, I had to connect using only the crimp terminals I put on the 40-44pin IDE converter.

    No problem - other than I chose the ONE AND ONLY molex connector in the world where red = 12V and yellow = 5V (instead of visa-versa). One fried disk drive, and a two day wait for an new one...

    9) Nightmare!

    Having received the new HDD, I went about reinstalling the OS and my software, using a knoppix CD to get me going. For some reason, between the desktop PSU and the M1, there was a power-spike, or something like that. In one go I lost the DMA and other random bits of the IDE controller and did serious damage to the VGA controller, plus killed the input on one of my pair of 17" TFTs. After calling the motherboard supplier, I discovered that I would not be able to get hold of a replacement mobo for at least a week (actually, it was almost two given there was a serious screw-up with the shipping too).

    I very nearly decided to give up uni, or at least drop out of the fourth year and graduate with a BEng rather than an MEng. I was completely gutted, because I knew there was abolutely no way I could finish the project in time. Needless to say, much prayer went into the situation, while I wrote-up a 49 page dissertation on a non-operative project!

    I got about 2 days with the new motherboard, after the paper's hand-in, to try resurrecting the project. I sort of had it working on the morning of the demo, but without an operative screen. With two hours before I was due to present, while sat in uni, I found the loose wire in the lcd, plugged it in, quickly hacked the software and had a working, music playing, spectrum analysing car stereo to demonstrate! That's one answer to prayer I'm not forgetting in a hurry!


    Current Status

    Ok, give that the project has actually gone backwards recently, and I've been more concerned about relaxing and finding myself full-time employment since graduating, nothing much has changed since the demo (other than I've loaded on a few more mp3s). It currently resides in my car (in fact, I'll be listening to it in 20min, as I drive into town), although I do intend to get it out and finish off the software and do some hardware tweaks.


    A slightly old picture of the unit installed, before the front buttons were connected

    Here's the to-do list:

    Immediate stuph:
    • Rewrite disk access code
    • Reinstate database
    • Stop the POST beep coming through the speakers
    • Bootup time needs to be seriously reduced
    • Enable seeking through mp3s
    • Enable a timecode display
    • Write a client GUI to allow WOL and mp3 loading


    Medium term:
    • Add radio unit
    • Make a fascia
    • Add a locking mechanism


    Long term / dreams: (for when I buy a nicer car)
    • Add small VGA display
    • Integrate with OBDII
    • Integrate with electric windows / steering wheel controls
    • Use webcams to cover blindspots / for reversing
    • Use webcams for security system



    Well done for reading (or skimming) this far down... I will intend to keep this thread up to date as / when I get off my backside and continue with the project. Likewise, if there's any interest, I'll neturally try to answer questions.

    Cheers,

    Mark

  3. #3
    Maximum Bitrate CavityCr33p's Avatar
    Join Date
    Jun 2003
    Location
    Arkansas
    Posts
    732
    Awesome!

    Very good, cant wait to see more.
    2000 Sunfire build 100%, or is it ever really 100%?

  4. #4
    Maximum Bitrate LagunaICE's Avatar
    Join Date
    Mar 2005
    Location
    Czech republic
    Posts
    772
    ooohhh...

  5. #5
    Raw Wave Laidback's Avatar
    Join Date
    Oct 2003
    Location
    Madrid
    Posts
    1,984
    I hate you!

  6. #6
    Variable Bitrate
    Join Date
    May 2005
    Posts
    350
    wow that's some impressive stuff you're doing there keep up the good work!

  7. #7
    Newbie shinny's Avatar
    Join Date
    Feb 2005
    Location
    Bristol, UK
    Posts
    12
    Re-wrote the disk access code last night. Previously, the software would keep a 128k ringbuffer full, which meant the disk was constantly doing small accesses. I've now made that ring buffer 128Mb, and only to reaccess thedisk when it drops below 1Mb. That means that th edisk's head is only unseated for about 5 seconds per hour of mp3 playback (my mps3 are generally DJ mixes) - that should make me fairly immune to shocks now!

    Currently the system is still a little naive and only buffers one file at a time, but I've got an idea of how to make it load the next 128Mb of mp3 into RAM, regardless of how many mp3s that is.

    Posting this has given me a little more motivation to see things happen, so hopefully there'll be more updates on the way soon.

    Mark
    WiFi enabled single DIN carputer progress:

    [##########] Hardware 90%
    [##########] Playback Software 30%
    [##########] Server / Client Software 0%

  8. #8
    Variable Bitrate
    Join Date
    Apr 2004
    Location
    Spring Hill, Florida
    Posts
    391
    http://www.crutchfield.com/S-BKLHIEP...info&i=575DMP1 ?

    Edit: Nevermind, I see that your long term goals are more lofty than I had previously thought
    2005 Black Chevy Impala
    Current Status: Installed in Vehicle/Testing 75%

  9. #9
    Maximum Bitrate kiltjim's Avatar
    Join Date
    Feb 2004
    Location
    PA, USA
    Posts
    805
    Incredible. Very nice use of a degree. Some slight polishing, and you have one hell of a system.
    2000 Subaru OBS

    Dell P3 @ 900 Mhz
    7" Lilliput TS w/DigitalWW in-dash mount
    80GB External HD

    I am Zero Bitrate....

  10. #10
    Newbie shinny's Avatar
    Join Date
    Feb 2005
    Location
    Bristol, UK
    Posts
    12
    Quote Originally Posted by Shelbrain
    http://www.crutchfield.com/S-BKLHIEP...info&i=575DMP1 ?

    Edit: Nevermind, I see that your long term goals are more lofty than I had previously thought
    Yeah mate - I know creative also have a system that does something similar-ish, but AFAIK no-one's done a cartiridge free, non CD-multichanger system before. My aim was to make it plug-and-play into any DIN.

    I eventually want to turn the system into a proper stealth carputer job, but right now I'm aiming for zero car modification... even running a cable to the boot is more than I am willing to do.
    WiFi enabled single DIN carputer progress:

    [##########] Hardware 90%
    [##########] Playback Software 30%
    [##########] Server / Client Software 0%

Page 1 of 2 12 LastLast

Similar Threads

  1. Command line mp3 player for Linux?
    By lewisd in forum Software & Software Development
    Replies: 6
    Last Post: 10-17-2008, 05:28 PM
  2. iTunes Purchased Music / In Dash MP3 PLayer (CDC-MP3)
    By MichaelK in forum Software & Software Development
    Replies: 15
    Last Post: 01-21-2005, 09:51 AM
  3. Replies: 7
    Last Post: 08-06-2004, 04:16 AM
  4. Bullet proof mobile MP3 player
    By MobileAudioDude in forum General Hardware Discussion
    Replies: 8
    Last Post: 08-21-2003, 06:58 PM
  5. Software to use for mp3 player
    By Catfish in forum General MP3Car Discussion
    Replies: 2
    Last Post: 01-08-2001, 08:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •