[ Powered by Linux ] [ Powered by Dodge ]

Linux based Auto MP3 player....in the trunk :)

Or "How to build/install a Cajun MP3 Player"


NOTE: This project was done back in 1998-2000!!


I'll be adding the new system soon which is in my 2000 Dodge Ram 3500 Quad Cab Sport Diesel..that's a long name! It's a small Asus NLX form factor Booksize PC with Linux on a 92MB compact flash card. New Setup


  • What is Cajun?
  • The Computer and OS
  • Amplification
  • Parts required for the LCD controller
  • Putting it together
  • Linux and installing Cajun and required Software
  • Case preperation
  • Cajun Modifications
  • Installation
  • Using the Cajun player - pics
  • Creating new MP3's for your ride
  • Getting the MP3's on the Cajun MP3 Player



  • What is Cajun

    Cajun stands for Car Audio Jukebox (implemented under) UNix. It is a Perl script and modules written by Paul Bournival Jr. and is used to control the MP3 software and to control the Matrix Orbital LCD display used in this project. Cajun information itself can be found at The Cajun Website. I suggest you go read his site and then come back for the details. I'm basically using a modified version of this script. I guess you can say I customized it to my liking.

    The computer is in the trunk and is accessed through a handheld controller. The controller houses a 4 row by 20 column backlit LCD. It also has a keypad on it for input. My version has the power and hard drive LED lights built in so I can see what's going on.




    The computer and OS

    The computer itself is a P233 with 96MB of RAM onboard. This is overkill for this project and is basically configured this way for future projects. Most people are running something around a P90 - P166 with 16MB of RAM.

    My present configuration

    Hardware

  • Asus T2P4P4 motherboard
  • Intel Pentium 233
  • 96MB RAM
  • S3 - 4MB
  • Sound Blaster 16 - one of the originals around Rev 2 :) This also has the amp disabled by jumper
  • Network Card
  • 1.6G Maxtor HD - Linux OS and applications
  • 13G Western Digital HD - MP3 Storage
  • OS and applications

  • Linux distribution - redhat 5.2 ( soon to be upgraded to 6 )
  • kernal 2.2.1 *
  • Paul Bournival's Cajun software
  • Xaudio Player - shareware with $10 registration
  • Perl 5 - also included in redhat distribution as 5.004
  • * - Version not needed for MP3 player operation

    Other equipment and parts

  • TrippLite PowerVerter 300-Watt inverter - picked it up for $80 at the same place as my radio
  • Wire for inverter - real wire...not the hokey stuff
  • 30 Amp relay
  • Switch
  • Fuse holder for under hood - heavy duty rated at 30amps, rubber cover
  • Assorted insulated butt connectors, female 1/4 blade connectors, 3/8 stud ring connectors (12-10 gauge) and some Super33 electrical tape
  • 25' sheilded audio cables with RCA ends
  • "Y" adapter. Stereo plug to left and right dual RCA jacks (1/4" mini) - $3
  • Fuse holder for inside computer (power connection to LCD controller) - You can usually buy these in strips of 5 for cheap
  • DB9 connectors - for end of cable and for optional port I made
  • And most important...1) Some knowledge of Linux/UNIX and 2)A receiver that supports AUX input or some kind of amp setup





  • Amplification

  • I purchased a new receiver for my ride. I wasn't totally thrilled with the stock Chrysler head unit, which was pretty decent for a stocker, but lacked a real good sound. After looking around for receivers that supported AUX (line) inputs. I found after doing some research that Pioneer receivers that support external CD devices could have a optional box that hooks into the MCD port and allows the use of AUX devices. This allows me to simply change the mode to AUX, complete with "LinuxMP3" on the radios display, and start playing MP3s. The model I chose was the DEH-P86DHR. Don't let the MSRP scare ya..I picked mine up for $349. What a great sounding receiver in my opinion. This made the attachment of the computer easy and very fuctional without any crazy hookups. The box is a CD-RB20 RCA to IP-BUS Interconnector which has 2 RCA inputs. I picked one up for around $60. The receiver must have the IP-BUS for the multi-CD and support this option. The receiver was alittle expensive but sounds great even with the stock 6 speakers in the Neon R/T. All in all a good setup that sounds great.
  • The internal, on board amplifier on the Sound Blaster is turned off. This was done on my old card by changing a jumper. I then set the volume knob (remember those) to about the 95-100% position. The volume of the output is controled within the Cajun software and defaults to 80%. This seems to be fine with my setup, your mileage my vary. It can be changed in the scripts themselves if need be. You don't want to overdrive the AUX inputs of the radio. Even with this old Sound Blaster, everything sounds good. I was going to use it just for testing but have left it in so far.





  • Parts required for the Cajun LCD controller

    The controller itself is the LCD diplay and a keypad. My version also has a red LED for the HD and a green LED for the power LED. Also I opted a 16 key keypad

  • Case/enclosure
  • - The Cajun site recomended a project enclosure by Pactec. The size of the case is 4.0 x 7.5 1.12 . The
    Mouser part number is 616-60624 and can be ordered online for approx $8 or $9. This is about the smallest case you would want to try and use. A slighly deeper case would be perfect if you would like to have the LCD totally enclosed inside without the chrome border showing.

    Matrix Orbital 4x20
  • LCD 4x20 display
  • - The display is manufactered by Matrix Orbital and the specs and screenshots of the product can be found on their site. This is basically a green backlit LCD screen with 4 rows and 20 columns. The version used in the project has a keypad interface built into the LCD module and can also do bar graphs, large digits and special characters. The part number used for this project is LK204-25V. I purchased mine online at Linux Central which happens to be one of the distributers for this product. The price was around $100.

  • Keypad
  • - The keypad can really be anything your capable of hooking up. People use keypads from old appliances or aux. computer numpads. The Cajun site recomends a 12 key keypad. I purchased a 16 Key front panel mount keypad from Digi-Key online, part #GH5003-ND. The keymap portion of the script had to be modified to use this part. (information provided on this site). There is also a list of suggested keypads on the Matrix Orbital site.

  • Cabling
  • - You need enough cable to be run from the mounting point of the computer to the dash area. Don't under estimate the amount needed, think about the route it will take to get to the front of the car. Approx 15-20ft should be the minimum. Don't forget others will want to control the MP3 player too :) I used a 25 pin serial cable and cut off the ends. The cable was a dark grey which looks good too. The total number of wires needed for the LCD is 4 (Positive, Negative, Send and Receive). I use 5 pair or 10 wires to add the LEDs and speaker which run to a special port I made.

  • Assorted items needed
  • - These items include the DB9 cable end(s), the wire for wiring up the internals of the controller, assorted LEDs and serial port connector with wiring that you can modify (pin 9 will have +5 power supplied to it). If you have a motherboard with the serial port built on the board (the actual DB9 itself, as in ATX and some proprietary motherboards), this my require some modifications or a separate serial interface card. I also have a modified port that has the LED and speaker connections going through it. This branches off from the main cable at the back of the computer. This way the module can be hooked up to differnt systems by just adding the 5 volts to be used for the LCD without the other options.

  • Tools, Time and skill
  • - You'll need a soldiering iron and the assorted stuff that goes with it. The inside of the controller has connections that will need soldiering. Also I modified the LCD by removing the serial connector on the back of it. This modification isn't neccesary if you are going to use the case above and let the LCD stick out the front of the case. I also hardwired my keypad to the LCD module instead of using a cable. I used to work as an arcade tech and I collect vintage 80's video games. For me it was an easy task. If you are a beginner and understand the basics of soldiering, take your time and don't rush, you should have no problems. Also you will need something to cut the box with, preferable a Dremel. I used a straight edge and a sharp razor...borrow the dremel :) . Also you will need a drill and some drill bits to notch the case for the cable to exit it, mount the LCD, mount the keypad and to add the holes for the LEDs if you choose to add them.






    Putting it together

    All the directions can be found on the Cajun site. These are optional things I did and an overview of some of the other things that need to be done that might not be metioned on the Cajun site. Skip through and find the info you need.

    Keep notes about the color of wires used and their functions. This will be real useful later on down the road if for some reason you need to work on your controller again

  • Wiring the cable to the LCD
  • - The included booklet that comes with the LCD has diagrams and pictures of the LCD module and the connectors. Read over the material before starting. I'm saying that because putting voltage, even the 5 volt, to a wrong pin can result in a $100 paper weight. Be careful. Compare the pinout below to your documentation first.

  • The directions for wiring the cable to the LCD can be found on the Cajun site. Print them out and have them nearby.
  • Removing the DB9 connector (optional)
  • - I opted to remove the DB9 connector from the back of the controller. This takes up room and basically is not needed for the way the LCD is mounted in the enclosure. This is not an easy task and requires some soldiering skill. You have to separate the 2 curcuit boards of the LCD module. This is done by removing the 4 small bolts and nuts and GENTLY pulling the 2 apart like a hinge. There are pins soldiered between the 2 boards that don't come apart. I pried it open just enough to poke the soldering iron inside and remove the soldier. I don't recommend this unless you know what you are doing. You can easily destroy the traces on the board. Another option would be to gently cut the pins and leave them in the curcuit board and then just attach to them. Your on your own with this mod. For people experienced with the soldiering iron.

  • Wiring the 16 key keypad instead of the 12 key used in the Cajun docs (optional) - I chose to use the 16 key so I could add extra fuctions to the project. It's not required but fits nicely on the controller and also allows someone familar with Perl to modify the scripts/modules to add more features. If you choose to use the 16, the pinout is different from the Cajun 'hardware_setup' page and goes as follows.
  • The module '/opt/cajun/lkdmgr-2.0/bin/CajunMO4x20.pm' must be editted to use this keypad. Edit the keymap section. Below is the new keymap:
  • # Keymap for 16-key Greyhill Keypad/Matrix Orbital
    keymap=41:1
    keymap=42:2
    keymap=43:3
    keymap=44:A
    keymap=46:4
    keymap=47:5
    keymap=48:6
    keymap=49:B
    keymap=4B:7
    keymap=4C:8
    keymap=4D:9
    keymap=4E:C
    keymap=50:*
    keymap=51:0
    keymap=52:#
    keymap=53:D
    

  • Internal mods to the system and wiring up the connector(s)
  • - Following the pinout, wire up your connector and modify the wire for pin 9. This will go through a fuse holder and be connected to a +5 (red) wire from a drive power connector. On older systems that have a connector on the motherboard and a ribbon cable going to the prots, the cable going from the motherboard COM port connector to the port itself has to be modifed. Just take a razor knife and getly cut the wire for pin 9 (should be the opposite end from the red stripe. The wire going to the COM PORT on the back of the system is the one we will use. Attach this to a fuse holder and then go from the other end of the fuse holder to a +5 (red) drive power connector. The fuse will protect your computer and the display if for some reason if the +5 becomes shorted to another wire or component.

    Update:
    On newer ATX stuff the ports are right on the motherboard. I made a DB9F to DB9M adapter with the needed wires passing straight through. I then ran power out of the case and into the adapter. The power is applied to the needed pin on the controller side of the adapeter and not on the motherboard side

  • Now wire up the DB9 connector following the pinout. I cut the 4 wires going to the com port about 4 inches shorter than the remaining wires I used for the LEDs. This allowed me to split them of to another connector. If you not going to add the LEDs or speaker you can just wire up the 4 wires you used and chop the others off short.
  • Wiring the aux port (optional)
  • - I found a blank slot (used where there are no cards) and installed a female DB9 connector in it. On the inside I spliced into the hardrive activity LED, the power LED and the speaker and soldiered them to the pins on this connector. I then took the extra wires in the cable coming from the LCD controller and hooked them up to a male DB-9 connector. This creates a separate connector just for these items allowing you to bring the controller inside and hooking to another system with the modified com port with +5 on pin 9 without the extra LED connecotr being used.

  • Testing your controllers display
  • - Once you get everything mounted in the controller, wired, and have the cable connected to the computer it's ready to test. I also liked checking out the LCDproc software that does some very cool things using the LCD controlleri. The keypad doesn't work for this but the display does. Very cool...check it out.

    The only problems you might run into is the renaming of the serial ports lately.

    This is a kernel 2.2 and later change. If you are running this kernel you may need to change the programs to work with those devices. They are as follows:

    COM 1 is now /dev/ttyS0
    COM 2 is now /dev/ttyS1
    

    NOTE: You might have to change the "CajunMO2x40.pm" module in order to get Cajun to work properly. Try the default way first.




    Linux and installing the Cajun software

    Kernel options

  • If you already have Linux installed or you are starting from scratch there are a few things that may need to be done. You have to have either 1) Have the modules for the sound card compiled and installed or 2) compile the kernel with the required code for your sound card (I suggest the in kernel since this is a dedicated MP3 player and will be constantly using sound). This is an easy task for people familar with Linux and tougher for the new Linux user. I'll quickly step through what needs to be done.

  • Make sure you have the kernal source installed on you system. This is usually located in '/usr/src/linux' using the redhat distribution (the 'linux' part being a symlink to the current source tree)
  • You'll also need the compilers install on your system.
  • Make a copy of your of your lilo.conf 'cp /etc/lilo.conf /etc/lilo.orig'
  • Change to the source directory. (/usr/src/linux)
  • IN X11 - Open up an xterm or Eterm..whatever your favorite is and type 'make xconfig' to open the kernel configuration utility.
  • IN A SHELL - 'make menuconfig' to open the kernel configuration utility.
  • You'll see a "Sound" section on the screen. Click on this and set the options for your card. There is a doc available on setting up sound called 'Sound-HOWTO' that is a FAQ and is supplied on the redhat CD (installed in '/usr/doc/HOWTO' if you installed documentation. It is also available on Linux.org in the support area.
  • If you are going to use loadable modules, you must also set this option in 'Loadable module support'
  • choose 'Save and Exit'
  • If using modules do the following in the source directory

    'make dep;make clean;make modules;make'
    and when that finishes with no errors then 'make modules_install;make install'

    leave out the make modules and modules_install if your not using modules ( makes sense :) )

  • This will install the new kernel, modules and reconfigure 'lilo'. I would then go edit '/etc/lilo/conf' and add you old kernel as another entry incase you can't boot on the new kernel. The kernels and other needed files are in '/boot' if you need to see filenames and dates to add the entry

    If your not totally sure about changing the kernel, read up on it first. If you frazzle your linux box by building a wacked kernel...well i'm not responsible. Be smart, read up.

    Installing Perl

  • Perl is also on the redhat CD, available as RPM packages or source from prel.org Choose your method of installation and install it. I suggest the RPM method..ya just can't beat 'rpm -Uvh perl*.rpm'

    Installing Paul Bournival's Cajun software Ver 2

  • After downloading the tar.gz file, uncompress and untar it using 'gunzip' and then 'tar -xvf [archive name].tar'. It will be installed in the '/opt' tree. I use a modified version of the 2.15 release on my linux box. This will install a snapshot of Paul's setup.
  • In the 'Cajun' script, look for $base and change it to the base directory you'll be hording your MP3s in. I chose '/MP3'
  • Installing Paul Bournival's Cajun software Ver 3

  • These are the newer verions and are available in .rpm format for easier installation. They also install the cajun software in /usr/share/cajun. A much easier install method for some. Files is /usr/share/cajun/lib need to be changed for your setup.

    Installing the xaudio software

  • Download the software and open the archive. Read the license. Then install the files in '/opt/xaudio/bin' and you can also install them in say '/usr/local/bin' too





  • Case preperation

  • Look in the case. Think "If I was a part or wire that wanted to wreck a cool thing, what I do?" :)
  • Stop the parts from flying around inside
  • - I made sure all the wires wouldn't rub through on anything. I tightened ALL the screws down and even threw some electrical tape over them to make sure they couldn't come loose and turn my MP3 player into a door stop. These included the screws for the adapter card slots, the motherboard hold down screws and anything else I could get some tape on to keep it were I wanted it. I even taped over the screws that held the CPU fan onto the heatsink. I live in NJ..the worst roads around. I've seen potholes so big you'd swear it was a bombing range for runway destroying artillary.






    My Cajun Modifications






    Installation

    NOTE: If you don't read this thoroughly and somehow set your car on fire, the neighborhood, kill wildlife in the area or somehow hurt yourself...it's your own fault. These are here as suggested steps for people. Get an idea of the steps involved. Use your brain..think before you do it, don't take my word for it. These are the steps I followed and I'm still here...and driving my car around :)

    Wire up the power inverter - Don't use some cheap wire. I used gas and oil resistant wire that's used for internally wiring appliances. I had spools of both red and black. If you know and electricain ask him if ya can get some wire from him. If not buy quality wire...don't make your project hokey :)

    Find the underhood fuse box and the hot terminal. Most new cars have these and you can see a positive (red) wire going straight from the battery to this box. This is were we'll get the power for the inverter. Find a safe place to mount your fuse holder. Make a wire with a ring terminal (don't even think of wrapping it around! :) )and connect from the post on the under hood fuse box to your fuse holder. It's best to neatly wrap the sonnectors splices with Super33 (electrical tape). This will keep the weather out of the connections. Then run your cable from the other side of the fuse holder through the firewall and down the side of the car to the trunk. Be careful where it runs and what it might com in contact with. Run it under the sill plates or next to them in a manner where they won't get worn or hit.

  • Now run your ground from the battery to the trunk. Use a 3/8" ring terminal and hook it directly to the negative clamp on the battery. You can run it right along with the postive wire.
  • Wire up the 30 Amp relay
  • - yes, wire the power through a relay and then have a switch to start and stop the system. Hooking the relay to the switched power lead (amp turn on, power antenna) on the radio might not be a good idea becuase usually between on and start, the power drops out. Besides with switch you can control it yorself. If you need sommething fancier that's fine too. I used to drive a Peterbilt, i'm used to throwing 4000 switches every time I get in to drive :)

    Here's a typical relay wiring diagram:

  • Run your audio cables
  • - If your hooking the audio out of the computer to your receiver, run the sheilded audio cables up the opposite side of the car from the power wires. This will isolate them from possible noise problems. I ran my all the way to the back and had them come up under the spare in the hole for the spare tire hold down. I don't know how your going to hook up the audio cables up to your system. If it is a simular setup to mine, it's a very straight forward deal. Power, ground, plug it into the back of the radio and hook up your RCA cables.

  • Connecting the inverter
  • - Make sure the positive wire is disconnect or the postive wire is disconnected from the battery or the fuse is out under the hood. I cut the cigarette lighter adapter that was on the inverter off. This was the way I planned to run it and the manual also stats the fact that it can't handle the full 300 watts without doing so. Make sure before> you cut it off, if you inverter has a simular adapter, to open up the cigarette plug and check to see what wire is the negative lead. Mark it so you can identify it for the connections to your power cables. Use butt connectors for the connection and then neatly wrap some Super33 (electrical tape) around the connection.

    Note: I don't own stock in 3M...Super33 happens to be the electrical tape that doesn't fall off 45 seconds after you put it on :)

    You should now have a trunk mounted power inverter controled by a nice relay/switch setup

    OK..Ok...go grab the damn computer already!! :)

    I think you can figure out the rest of the installation on your own. Mount it thinking about the shocks of everyday driving. If possible shock mount the drive in the case but remember it needs air flowing over it.




    Using the Cajun Player

    Cajun LCD controller
    This is a shot of the handheld LCD controller.

    Here are some pics of what the player looks like on the display.

    Main Menu
    This is the main menu.

    Util Menu
    Cajun 3.0 is a work in progress. Menu items are in place
    for future versions.

    Util Menu
    You can control the mixer from the handheld LCD controller.

    Main play Menu
    This is the first level of the play menu. Choosing an
    artist then shows the albums for that artist.....

    Album selection
    ....like so. Choosing an album then shows the songs available.

    Song Choice
    Choosing the first song will play everything in that album.
    Remember, albums are just directories, so you can have directories
    with 40 or 50 mp3's in them or create symlink albums from boxsets.

    Cajun Playing MP3
    And heres the player playing a song. The display includes song play
    time, percentage of that song played, what song in the album, Artist,
    Album and Song. Songs longer than the display scroll. (This is currently
    being worked on. I have mod'd mine too scroll with good results )






    Creating new MP3 files for your ride

    These are now perl scripts. If you have the old scripts you'll probally want these

    A lot of things are fixed in the new version

    Newest version is 2.0.3 -Converted to perl -Added both single drive and changer operation -Added optional use of 'mp3info' to set tags -Fixed paths that were static, now all paths set from configuration variables -Fixed broken path names

    I have 2 scripts I made to rip and save MP3 files. They use cdparanoia, cdda2wav and bladenec. They also optionally use 'mp3info' to set the tags in the files after encoding

    The script can use a SCSI 5 CD changer or a single CDROM of your choice (SCSI or IDE)

    One script 'build-songlist.pl' gets the CDs ID and goes to CDDB and gets the info. It then creates the generated 'batch.sh' script that actually does the ripping and saving using 'multi-rip.pl' The file 'encode' is for the xterm and bladeenc process. Put it in your path somewhere

    Final output: /[basedir]/artist/title/songnumber_songname.mp3

    Example: /mp3/AC-DC/Back_In_Black/01_Hells_Bells.mp3 etc

    1) Be in X, online and insert CD(S)
    2) Edit 'buildsonglist.pl' and set the configuration options
    3) Edit 'multi-rip.pl' and set the configuration options
    4) Run 'build-songlist.pl'
    5) Check your songlist(s) for errors (drive?.songlist)
    6) Run 'batch.sh' which is a feeder for 'multi-rip.pl'
       It allows as many process as you want..pick
       4 and it only does 4 at a time...one stops, the    next one starts...in it's own resized xterm
    7) Wait....
    8) Enjoy 
    

  • multi-rip-2.0.3.tar
  • Your on your own, these are here to help others.




    Getting the tunes on the Cajun MP3 Player






    HTML coded in VI

    You should be powered by
    [ Powered
by Red Hat Linux ]

    send email to Denis Hruza - hruzaden@SPAMyahoo.com
    remove SPAM