TRAXMOD:FAQ
From K9spud
TRAXMOD is an open source digital audio player for dsPIC/ARM microcontrollers. Unlike most portable audio players, TRAXMOD's main focus is module music files (MOD, etc).
Contents |
What is module music?
MOD music started in the 1980's on Amiga computers and has been evolving ever since. While MP3 seems to take center stage for most people today, module music files still provide some unique advantages over MP3:
- A huge amount of legal, freely downloadable music is available on the Internet from sites such as the MOD Archive and Nectarine Demoscene Radio. Most MP3 files are ripped from commercial RIAA controlled music CDs, which makes it illegal to share them with friends. In contrast, most MOD files are composed by individuals who allow them to be freely distributed.
- MP3 files are finalized raw wave data that are not easy to tinker with. MOD files combine individual instrument wave data and note event information (ala MIDI) which allows users to see more information about how the music is composed. It is far easier to read, remix, and tinker with MOD music files for those learning about creating music.
- Numerous free and low cost programs exist to support the creation of new module music on most platforms. Many people create MOD music in their home with minimal equipment, rather than spending large amounts for studio time.
- Small file sizes, almost always smaller than MP3 files of comparable play length.
- Patent free.
What can it play?
TRAXMOD v0.1 Single Chip MOD Player
TRAXMOD v0.1 plays one MOD file directly out of dsPIC FLASH program memory - no additional chips required! Since the dsPIC30F3012 only has 32KB FLASH memory (dsPIC30F4013 has 48KB), this means you can only play really small MOD files.
The TRAXMOD Converter v0.2.1 program is used on your PC to convert MOD files into C and assembly text files that can be compiled together with the TRAXMOD v0.1 firmware source code to generate a dsPIC HEX file. When this HEX file is burned into the dsPIC chip, it will play the music when power is applied.
TRAXMOD v0.2 SD Card Raw Audio Player
TRAXMOD v0.2 plays raw audio data streaming directly off of an SD Card. Unsigned raw 8-bit audio samples are dumped directly on the SD Card (no file system or partition table).
TRAXMOD v0.3 SD Card MOD Player (working proof of concept)
TRAXMOD v0.3 plays one MOD file at a time:
- Pattern data is stored in dsPIC FLASH program memory
- Sample data is stored on an SD Card
The TRAXMOD Converter v0.3 program for your PC pre-processes MOD files into C/assembly source files and a raw SD Card binary data file. The binary data file is dumped directly to the SD Card (no file system or partition table) and source files are compiled with the TRAXMOD v0.3 firmware source code. The firmware is compiled into a HEX file and then programmed into the dsPIC. This player can play much larger MOD files because all of the sample data is stored on the huge SD Card FLASH memory instead of internal dsPIC FLASH program memory.
Ideally, the firmware should be able to play normal MOD files straight off of a FAT formatted SD Card. This should be possible to do, but we aren't spending time working on doing it right now.
Also, it would be nice if the player supported more audio channels than just 4. Currently, however, the dsPIC chips used do not provide enough SRAM and MIPS to implement very many channels. MIPS might be okay if the code were optimized harder, but the 2K data memory limit is very hard. Because we need to buffer two 64 byte SD Card blocks for each play back channel, it will be difficult to support any more than 8 channels, and impossible to support anything >15 channels.
TRAXMOD v0.4 MMC/SD Card Player
TRAXMOD v0.4 uses the LPC2103 ARM7TDMI-S chip. Why? It is cheaper, faster, 32-bit, and provides more on-chip memory than the dsPIC chips we were using.
Currently, the firmware can play raw digital audio files streaming off of a FAT formatted MMC/SD Card. It plays at 44.1KHz, 10-bits, stereo. It also plays small MOD files that it loads into RAM directly from the MMC/SD Card (no PC converter software needed). Playing from RAM limits us to about 1468 bytes of sample data.
Eventually, the ARM port will play sample data streamed off of the SD Card like TRAXMOD v0.3 did, so that we can play any size MOD file.
TRAXMOD v0.5 Player with 16-bit PWM/Resistor DAC
TRAXMOD v0.5 plays raw audio data streaming off a defragmented FAT MMC/SD Card at full 44100 Hz, 16-bit, stereo (CD quality).
This hardware revision uses two PWM pins for each audio channel, tied together by a resistor divider network. This allows us to produce 16-bits of digital to analog converter (DAC) resolution per audio channel, all without an expensive and difficult to interface external DAC IC!
Currently, the MOD player portion of the v0.5 firmware is broken such that it doesn't play at the right speed. This is because it does not know how to interface with the new 16-bit DAC hardware.
TRAXMOD v0.6 Streaming FAT MOD Player
TRAXMOD v0.6 ditches the PWM/Resistor DAC in favor of an external PCM1770 audio DAC chip with integrated head phone amplifier. This change allows full volume control without increasing the external component count too much.
This version supports playing 16 bit 44.1KHz raw audio streaming off an SD Card. It also supports playback of 4 channel MOD files streaming off of a FAT formatted SD Card.
Could TRAXMOD play MP3 files?
MP3s are patented technology, which would probably require licensing. Nevertheless, MP3s are fairly old, so in several more years the patents should expire and then maybe work on supporting MP3 can be added.
The dsPIC firmware probably won't be able to play MP3 (16 bit, too slow, and far too little RAM), but the ARM port could have a possible chance at it. The LPC2103 chip has enough MIPS performance for the job, but it still may not have enough memory. The open source Helix MP3 Decoder is optimized for playing MP3s on ARM microcontrollers and might be useful for porting to the TRAXMOD/ARM hardware. The GNU GPL'd MAD: MPEG Audio Decoder also looks promising (used by Rockbox on other ARM players).
Rob's MP3 Projects - Lots of MP3 player projects.
Will TRAXMOD have an LCD?
It is not very likely that we will work on adding an LCD right away because there is plenty of other work to do first. I need something I can throw in my pocket and listen to more than I need yet another thing to spend time looking at.
If we add an LCD, it was suggested that we use the LPH7779 (used in old Nokia 3310 / 3330 / 3390 cell phones):
- 84 x 48 monochrome graphics
- Low power (3.3VDC)
- Easy to interface
- Compact size
- Easy to obtain and cheap
The LCD can be removed from an old Nokia cell phone using a Torx-6 tool.
Gadgets Galore - Low cost cell phone LCD replacements. Nokia 3310 OEM replacement LCD for $3.95.
Philips PCD8544U - Interface Controller
Nokia 3310 LCD Library - Interface examples for PIC16F microcontrollers.
LPH7366 - Is this really for Nokia 3310 display?
How much power does it draw?
TRAXMOD v0.5 (LPC2103) playing a 44.1KHz raw audio file streaming off an SD Card (1GB Kingmax) draws about 69mA to 72mA total current typical.
TRAXMOD v0.6.7 (LPC2103) playing a 16 bit 44.1KHz raw audio file streaming off an SD Card (2GB Dane-Elec) draws about 70mA total current typical. It draws about 80mA total current typical while playing a 4 channel MOD file at 44.1KHz, 16 bits streaming off the same SD Card.
SD Cards are specified to use a maximum of 65mA during reads (75mA during writes). The LPC2103 absolute maximum current is specified at 100mA. Under the absolute worst case scenario, TRAXMOD should draw no more than about 175mA.
What will be the power source?
Currently, we're thinking of using four AAA NiMH rechargable batteries:
- Small
- Lightweight
- Low cost
- Available at any electronics store or Wal-Mart.
Most off the shelf AAA NiMH batteries provide 850mAh capacity these days. 1000mAh AAA NiMH batteries are available online from Circuit Specialists and Thomas Distributing. 1450mAh AAA NiMH batteries seem to be available in Germany (search eBay).
What will the interface port do?
A DB25F connector on the bottom of the TRAXMOD digital audio player will provide access to the following:
- (9) JTAG interface pins for use with the K9JTAG Debugger
- (3) Audio line out
- (4) Serial port interface (RX/TX + power for serial interface chip)
- (3) SPI high speed data transfer interface
- (2) Power input (+12VDC)
- (2) Power output (+3.3VDC, ~5VDC unregulated battery)
- (2) General purpose I/O
This interface port will provide us with a lot of possibilities...
Firmware Upgrades and In-Circuit Debugging
The JTAG interface pins will allow us to do in-circuit debugging of the TRAXMOD firmware, using nothing but a cheap K9JTAG Debugger connected to your PC's parallel port. Hopefully this will work more reliably that the dsPIC and the ICD2 we were using on the dsPIC based TRAXMOD development.
If not though, the TRAXMOD firmware should still be possible to FLASH update using the serial port pins. This will allow anyone, even people without the K9JTAG Debugger, to re-program the microcontroller chip.
High Speed File Transfers
The SPI high speed data transfer interface should allow us to copy files on and off the TRAXMOD's SD Card at maximum speed. It should be possible to build an external USB interface adapter/cable, even a USB 2.0 high speed one. This will cost money and a lot of development time though, so initially people will have to move files on to the SD Card using an external SD Card reader instead.
It should also be possible to swap files at high speed between two TRAXMOD units using a custom DB25 cable. This would not require any extra interface ICs, so the cable will cost very little. We considered adding a wireless interface feature to the TRAXMOD for swapping files among units, but decided against it due to the cost and complexity of wireless interfaces (maybe that can be a future project someday).
Digital audio players today do not allow transferring files between units, most likely due to Digital Rights Management (DRM) restrictions imposed by copyright cartels (RIAA, etc). Since TRAXMOD is for playing freely distributable MOD music files, it should not be a problem for the device to support transferring MOD files between units.
In-Circuit Charging
Hopefully, it will be possible to charge the AAA NiMH batteries without having to open the TRAXMOD unit and swap batteries into an external charger. This will make day to day use of the TRAXMOD much more convenient.
Automobile Use
We've already done a ton of work with interfacing to Volkswagen car audio systems in the VWCDPIC project. It should also be possible to leverage some of that work into the TRAXMOD project so that the player can be easily used in the car (unless, of course, patents get in the way). The interface port should provide means for interfacing to the car with only a single cable.
Dimensions
Outside dimensions of the plastic enclosure: 4.3 x 2.2 x 0.8"
The following probably doesn't mean much to anybody, these are just my temporary notes while I'm trying to figure out how to cram everything together in a tight little box.
- Maximum inner PCB size: 4.205" x 2.094"
- Maximum inner height: 0.714" - 0.042" (lip of lid)
- Enclosure plastic thickness: 0.055"
- PCB thickness: 0.065"
- DB25 Shield Height: 0.493"
- Max space under DB25 PCB: 0.214"
- Minimum space above DB25 PCB: 0.393"
- Minimum space under DB25 PCB (drop shield down outside of enclosure): 0.198"
- Max space above DB25 PCB: xxx
- LCD minimum height: 0.125"
- LCD maximum height: 0.160"
- SD socket height: 0.160"
- Header height: 0.340"
- 3.5mm stereo jack height: 0.238"
- AAA battery length: 1.745"
- AAA battery diameter: 0.406"
