Introduction: Building an .OGG Player Using the Pocket Mini Computer

Back in the late 90's Diamond introduced the first portable MP3 player, the Diamond Rio PMP300.   It had a whopping 32MB of memory (enough to carry most of a single album.)  Fast forward 20 years, and nearly all portable devices have some sort of MP3 compatibility.

This Instructable will teach you how to create your own .OGG player (.MP3's non-licensed cousin) using a Propeller powered Pocket Mini Computer, and an VLSI VS1000 Module.   This is an easy project which could be expanded to become an in-car system, or audio system for an exhibit controllable with everything from a simple keyboard, push buttons, or even an IR remote.

I'll be using a Pocket Mini Computer running COLOR BASIC for this project, but in any favorite Propeller based board will work just fine providing you have VGA output, and PS/2 Keyboard input for the demonstration code in this Instructable.  



Items required for this project:
  • A Pocket Mini Computer (or your favorite Propeller configuration with VGA & PS/2 support)
  • A VLSI VS1000 Audio Module  (available from Propellerpowered)
  • A set of amplified speakers
  • A female headphone connector with attached wires
  • A small breadboard & jumper wires



Step 1: What Is the Pocket Mini Computer?

The Pocket Mini Computer

You might be scratching your head at the requirement of a Pocket Mini Computer.

What's a Pocket Mini Computer?    I'm glad you asked!

The Pocket Mini Computer is an open source "mini computer" design which uses the Parallax Propeller microcontroller as it's brain.   The kit from Propellerpowered.com comes pre-loaded with a retro-style BASIC.  The hardware itself is extremely powerful & featured.


Here's the specs:

The Pocket Mini Computer hardware specifications:
  • Parallax Propeller Quickstart Board (8 cogs, 32K RAM, 64K EEPROM)
  • Improved VGA Output (64 or 256 color modes)
  • Stereo R/L Audio Output
  • PS/2 Keyboard/Mouse Input
  • Wii(tm) compatible controller connection
  • Optional microSD adapter connector
  • Optional iR connector
  • Experimenter's ports
The Pocket Mini Computer is language compatible with Spin, Assembly (PASM), C, and BASIC.

COLOR BASIC features:
  • 6144 available bytes free
  • 64 or 256 color modes
  • 1 "SIDlike" audio channel
  • 127 character re-programmable character set
  • plot, line, and box graphics commands
  • I/O access commands
  • 95+ BASIC Commands, operators, and functions
  • SD operating system
  • Full screen editor (requires a microSD card.)
  • Ability to execute non-basic binary programs
  • Extended memory features (requires a 23K256 SRAM chip)

More details about the Pocket Mini Computer can be found on this Wiki.
Schematics and Souce Code are avaible for anyone who wants to "roll their own".

Step 2: What the Heck Is .OGG?

What the heck is .OGG?

Compressed audio formats such as MP3 or OGG are able to store very large audio files in a small space because they actually reduce the accuracy of the recording in a way that is not easily detectable by the human ear, called auditory masking .    It turns out that the human ear is very easy to fool, and the brain is able to still clearly understand the sound even if audio quality is traded away.   For example, removing very high frequency tones from an audio recording allows the file size to be smaller without discernible differences when it is played back.   Sadly, when compared side-by-side with a vinyl recording, the audio differences are very clear, but I digress.

You may not be aware of this, but MP3 is actually a licensed format that was designed by the Moving Picture Experts Group meaning that devices which feature MP3 playback "should" have properly paid license fees for the ability to do so.  (Something which I suspect doesn't happen when those cheap MP3 players are sold on Ebay from Hong Kong.)

The .OGG format is called Ogg Vorbis.   It is roughly comparable to the MP3 format in performance and file size. It is different from these other formats because it is completely free, open, and unpatented.   It's actually not a bad idea to convert existing MP3 files to this format, insuring that they will always be completely unlocked and playable without restriction.   Most portable MP3 player devices and software players support this format readily.

Because we are using the VLSI VS1000 Module for this project, we don't have to pay the additional licensing fees associated with the MP3 format.   This makes the device cheaper to obtain while maintaining the quality of a typical audio player.

Glancing at the VS1000, it looks like a scary bunch of connections, but in actually we'll be talking to with with a simple 3 wire serial interface to our Propeller.    The module even provides an easy way to attach headphones or amplified speaker connection.

Need an easy way to convert your MP3 files to OGG for this project?  I used this website for my examples.


Step 3: Making the Connections

Using the schematic in the second image, make the following connections to your Pocket Mini Computer:
  • 5v to Pin 32 of the VSI Module
  • Gnd to PIn 16 of the VSI Module
  • P12 to Pin 18 of the VSI Module
  • P13 to Pin 19 of the VSI Module
This establishes communication between the Module and the Pocket Mini Computer.


Next, make the following connections to a small amplifier or pair of headphones.
Important!  Always check audio levels before putting on a pair of headphones or earbuds.
  • Audio Right to Pin 26 of the VSI Module
  • Audio Left to Pin 27 of the VSI Module
  • Gnd to Pin 28 of the VSI Module
I used an inexpensive audio cable I purchased from the dollar store.  After cutting off one end, I soldered "breadboard friendly" wires to the audio lines so that it could be plugged into my experiment easily.



Step 4: Audio Playback Using BASIC

The Pocket Mini Computer uses a BASIC Interpreter, called COLOR BASIC.  

If you are building this project using your own Propeller board, you'll want to obtain and install COLOR BASIC.
You can obtain the Spin source code for COLOR BASIC from here:

https://www.dropbox.com/sh/qwhixzvtlrvp1u1/y-JshwklWj/PropellerBASIC


Once you've successfully make the connections in the last step and have the BASIC boot screen started, type in the following program:

5 CLS
10 SERIAL 12,13,0,115200
20 A=INKEY
30 IF A > 0 THEN DISPLAY A
40 IF A > 0 THEN TX A
50 B=RX
60 IF B > 0 THEN DISPLAY B
70 GOTO 20


You've just typed in a simple terminal program which runs in BASIC.    
RUN the program and try the following commands:
  • c - switch to continuous play mode
  • C - cancel play, return to play loop, responds with c
  • + - volume up, responds with two-byte current volume level
  • - - volume down, responds with two-byte current volume level
  • = - pause on, responds with =
  • > - play (normal speed), responds with >
  • n - next song, responds with n
  • p - previous song, responds with p 

Using BASIC to control an audio player is pretty cool.   Bet you never thought it would be this easy.


Step 5: A Better VGA .OGG Player

In the last step, we used a simple 8 line terminal program to communicate with the VS1000 module.

Let's expand on the idea bit and create a much nicer program:

Type in the following program and RUN it:

10 REDEFINE 33,255,255,255,255,255,255,255,255
20 COLOR 255,0
30 CLS
40 PRINT "!!!!!!!!!!!!!!!!!!!!"
50 PRINT "! OGG Music Player !"
60 PRINT "!!!!!!!!!!!!!!!!!!!!"
70 PRINT "! (N)ext Song             !"
80 PRINT "! (P)revious Song      !"
90 PRINT "! (>)Play (=)Pause    !"
100 PRINT "! (+/-) Volumn           !"
110 PRINT "!!!!!!!!!!!!!!!!!!!!"
120 SERIAL 12,13,0,115200
130 A=INKEY
140 IF A > 0 THEN TX A
150 GOTO 130


I've still kept this program very simple and straight-forward, feel free to add some color and your own flash to it.