Anda di halaman 1dari 6

MP3 Radio

The Truly Mobile & Wireless Music Solution


Michael Backman, Richard Bannon
Department of Computer Science and Engineering
University of Washington, Seattle, WA
{mbackman, rbannon}@cs.washington.edu

Abstract You can buy special cables which make it


possible to connect an MP3 player to a regular
In the last few years, MP3 players have made it stereo. This helps to solve the headphone
possible to take your whole music collection with problem, although it is a limited solution. You
you anywhere. Despite this convenience, you still have to pack around cables with you if you
are still limited to listening to your music through want to listen to your MP3 music on different
headphones. MP3 Radio makes use of Intel’s stereos. Also, many of these wire kits don’t
Personal Server and newly developed Slappy allow you to connect your MP3 player to a car
card, along with a Bluetooth enabled cell phone, stereo. We are living in the wireless age and for
allowing you to listen to your music on any that reason, a solution should exist to this
stereo with an FM tuner. MP3 Radio is problem which doesn’t involve wires and that
designed to be a ubiquitous music device that is works on any stereo. This is exactly what we
always on. The device is, conveniently, had in mind in designing MP3 Radio. Before we
controlled with a cell phone, which most go into what MP3 Radio is, we will give a typical
everyone already carries with them everywhere. scenario describing how someone might use it.
The cell phone interface provides lets the user
browse through their music and create play lists, Joe is a typical MP3 radio user. After he
similar to a typical MP3 player. Our purchases the kit, he loads his entire collection
implementation does provide the convenience of of music onto the MP3 radio server using a
an MP3 player as well as the added benefit of standard 802.11 wireless networking connection.
being able to listen to it on a regular stereo Joe then installs the MP3 radio client software
anywhere. The main goals of MP3 Radio were onto his Bluetooth enabled cell phone. Once he
portability and ease of use. As you will see in finishes these two tasks, he is ready to begin
this paper, we were able to achieve both of using his MP3 Radio. He opens the MP3 Radio
these goals. This project also shows the application on his phone. The phone
practicality of Bluetooth enabled cell phones in automatically searches for other Bluetooth
controlling other Bluetooth devices. Finally, we devices within range of his phone. The MP3
see that a device such as Intel’s Personal Radio server shows up in a selection dialog
Server can be a powerful mobile device when along with his laptop, which is also within range.
used in conjunction with other mobile devices. Next, Joe selects the MP3 Radio device and a
dialog which says, “Connecting…” pops up
momentarily. The MP3 Radio client application
1. Introduction starts in the “Browse” view and Joe can see that
the application is receiving details of his music
Digital music in the form of MP3 files has application from the MP3 Radio server. After a
exploded in popularity the last few years. Today few seconds, an alphabetical list of, first folders,
it is possible to store your whole music collection then music files is displayed on the phone. He
on an MP3 player the size of a deck of cards can scroll down the list and using the up and
and take it with you anywhere. MP3 players are down key on the phone. When Joe hits enter on
still limited in one facet: you are limited to a folder, the phone application displays the
listening to your music through headphones. contents of that folder. Joe also sees that the
“Option” key has a number of commands in it
which allow him to add songs to his current play phone control. He is used to having his cell
list and play songs directly. Joe spends some phone with him and he is happy that he doesn’t
time creating a play list of the songs that he have to carry a bulky MP3 player on his person
wants to listen to. He then navigates to the to listen to his music anywhere.
“Playlist” view and sees that he can save his
current play list and load play lists that are MP3 radio uses three radio protocols to achieve
already saved. Joe is ready to listen to music on its completely wireless functionality. The first is
his MP3 Radio. used to transfer music files to the MP3 Radio
server and operates with a standard Wi-Fi radio.
The first thing Joe does is plugs his headphones The second radio allows the client application
into the MP3 Radio server. Joe switches the running on the cell phone to communicate with
MP3 radio application to the “Player” view. He the server application running on the MP3 Radio
sees that from within this view he can control the server. This radio uses the Bluetooth protocol.
playback of his music. He chooses the “Shuffle” Lastly, the music is broadcast with an FM radio
command and then hits “Play.” His headphones so that any stereo equipped with an FM radio
come to life, playing one of his favorite songs. can tune in and listen.
After playing around a little, Joe is convinced
that his MP3 Radio has all of the functionality of The most challenging aspect of the design of
his old MP3 player. Joe is pleased that he isn’t MP3 Radio was implementing the
loosing any functionality with his new music communication between the server and the
player. Now it’s time to test out the feature client using the Bluetooth protocol stack. The
which persuaded him to buy MP3 Radio: MP3 Radio server runs Linux for an operating
broadcasting his music over FM radio. system and the phone application is designed to
run on cell phones running Symbian OS. Much
Joe unplugs his headphones and places the of the difficulty in implementing the Bluetooth
MP3 Radio server in his briefcase. Next, he communication was introduced because the two
walks into his living room and turns his stereo on devices are running different operating systems.
and dials in 88.7 MHz on the FM tuner. Sure
enough, the same song that he was just listening Another challenge was simply designing
to with his headphones comes to life on his applications using the Nokia Series 60 SDK,
home stereo. It’s almost time for Joe to head off which are the development tools that are
to work so Joe decides to make a new play list required to write applications for the Symbian
of his favorite driving music. cell phone. The Nokia Series 60 SDK is
designed to plug into a third party development
When Joe gets into his car, he turns on the environment. The SDK is compatible with
stereo and tunes into 88.7 MHz. Before he pulls several common development environments
out of his driveway, he pulls out his phone and including: Visual Studio, Borland C++Builder and
opens up the MP3 Radio application. He Metrowerks CodeWarrior. Initially, the only
navigates to the “Playlist” view, loads his driving development environment that we could get to
play list and then goes to the “Player” view and correctly compile a C++ program into a Symbian
hits play. The car stereo starts playing his Installation System (SIS) file, which is the type of
driving music. The music sounds particularly file that applications are archived into for
good in his car because he has a several- installation on the Symbian OS phone, was
thousand dollar car stereo. When Joe gets to Borland C++BuilderX. Borland’s development
work, he just leaves his MP3 Radio going. In his environment was great except that the compiler
office, Joe turns on his little table-top stereo and gave horrendously vague error messages, which
tunes in the correct FM station. Again, the made development nearly impossible except in
stereo comes to life with his driving music. extremely small steps. After struggling with this
long enough, we decided to try to get the SDK to
Joe is really pleased with his new MP3 Radio. plug into a different development environment.
He can take his music with him and listen to it Eventually, we were able to get the SDK working
anywhere without having to pack around a semi-correctly with Metrowerks CodeWarrior
bunch of cables. He usually leaves his MP3 development environment. We still had to rely
server in his brief case and just forgets about it. on Borlands C++BuilderX to actually build the
He only needs to charge the device once every (SIS) file. CodeWarrior provided us with much
two or three days. Joe especially likes the cell more descriptive error messages so we were
able to make much better progress in designing maintained to be a large inspiration for our
the client application for the cell phone. project.

The Bemused user interface is almost identical


3. Related Work to the popular Winamp media player. The
graphical skins that can be loaded into Bemused
Mp3 players have become popular in the last are basically ports from Winamp skins. Mp3
years. Units are getting smaller and cheaper Radio currently has no such fancy interface, only
and song storage is growing. These players, a simple list driven one much more like the iPod.
such as the extremely successful iPod, are
focused around portability, taking the market The Mp3 Radio Server was built from scratch.
from older portable media players such as the Madplay was chosen to be the Mp3 decoder,
CD, minidisk, and cassette. and integrated into the application. All we
needed to do was receive messages from the
Mp3 Radio expands on this idea by introducing phone and process them accordingly. No large
remote access and broadcasting to the portable overhead was needed, just a simple message
music market. The other players that have handler and the decoder. The complexity of
come out all require the unit to be listened to on Bemused just wasn’t necessary.
headphones or by plugging into some other
system. The controls are all still on the unit
since it is designed to be used on the person. 4. Approach
Mp3 Radio allows the user to leave the unit by
any FM receiver, or even keep it in a pocket. The Mp3 Radio project was developed in three
There are no wires needed to connect to the large chunks. The user interface had to be
receiver and no need to control playback with designed on the Nokia phone and created to
buttons on the unit. All controls are done with a communicate with the personal server.
cell phone. Secondly, the Bluetooth connection itself had to
be implemented and data streamed across.
There is one popular project called Bemused [1] Thirdly, the personal server had handle Mp3
that is very similar to ours. Bemused is an open playback which was controlled via the messages
source project that was created, just as ours, to received on Bluetooth.
control a music collection from a cell phone over
Bluetooth. They are based off of the series 60 The first part we created was the Mp3 aspect.
phone models running Symbian OS. The The Slappy audio card hooked up to the
difference is on the server end. Bemused was personal server could handle the sound output
written to interface with everyday PCs, and FM broadcast, but it needed .wav files to do
controlling popular music playback programs so. An Mp3 decoder was needed to convert files
such as Winamp [2] or Windows Media Player. from .mp3 to .wav. We looked for compatible
[3] Mp3 Radio uses Intel’s Personal Server, decoders, but most decoders out there run on
which doesn’t have the functionality of a regular floating point algorithms. Unfortunately, our
PC. The biggest problem is that it has no personal server has no floating point support, so
floating point math support, which most Mp3 a fixed point decoder was needed. After much
decoders use. A fixed point solution had to be searching, we found the perfect decoder.
found. The Bemused server is also written to be
usable on many platforms, while Mp3 Radio Madplay is a command line based Mp3 player
needs only to be targeted to the Personal used on UNIX systems. It uses fixed point
Server. algorithms and we could modify it to our own
design because the project is open source. The
Bemused, while feature rich and compatible, next step was to integrate Bluetooth to the
was too much for an application such as ours. decoder. We first created a separate Bluetooth
What we needed was something that would run communication program and verified its
fast and not carry the extra weight of features operation, and then put the two together. We
and overhead that came with Bemused. The replaced Madplay’s keyboard input with the
floating point decoder alone was enough to put Bluetooth message pump. Messages coming
the Bemused project out of our reach, although it
from the phone would now simply emulate the
regular keyboard commands of Madplay. The Symbian OS required many more new
classes and libraries to get Bluetooth working.
When this was done, the Bluetooth data pipe The poor development environments made this
was created. Bluetooth was chosen as a task even harder with vague error messages
medium mostly because that is what is readily and uninformative warnings. We eventually
available on cell phones. However, Bluetooth switched the phone code over to C++ just
was also designed for close proximity wireless because we weren’t getting anywhere with a
networking, which is exactly what we needed. Java implementation and the development
environment was a bit better. There weren’t
Most of our time on this part of the project was really any tradeoffs to this decision, except a
spent learning how to use the Bluetooth protocol minor setback in progress, but that was quickly
stack. Once we got things running, it was simply made up in the more efficient work we could do
a matter of deciding on messages to be sent with C++. The phone, however, continues to
across and integrating with the phone and plague us with problems whenever trying to
decoder. develop something on it.

Finally, we tackled the phone user interface. The personal server was also a large source of
The phone we chose to use was the Nokia 6600. headaches. Connecting applications over
Our main requirement for the phone was that it Bluetooth worked every 3rd or 4th time we would
had a Bluetooth interface. The 6600 was try, or the server would randomly lose power, or
chosen because there were others here who reset. Our programs connect via Bluetooth just
had already done some development work with fine to other systems, so we believe the
the phone so we would have someone to talk to Bluetooth hardware on the server itself may be a
if we had any problems. bit buggy. These problems with the server
severely slowed development progress
The user interface design was modeled loosely throughout the project.
after the iPod interface. A basic phone
application was created to handle the device
discovery and connection. Then a list of the 6. Evaluation
usual playback commands are implemented to
list songs, play, stop, or skip to the next or We evaluated the Mp3 radio in 3 categories:
previous song. When a command is selected, a program robustness and stability, usability, and
message is sent across the Bluetooth music quality.
connection to the server.
We wanted the system to run smoothly. The
Putting the three pieces together, we have a server shouldn’t crash, the phone shouldn’t get
phone interface which efficiently talks to the hung up on its programming, and messages
personal server and has control over all basic should stream between the two without
music playback functions. unrecoverable loss or large delay. Mp3 Radio
passed in most of this area. The message
transport was flawless. To this day we have
5. Implementation never lost a packet or gotten corrupt data that
we have noticed. The Bluetooth protocols do a
Our largest obstacle in the project was good job of getting data across, and fast too.
Bluetooth. The protocol stack is very complex Everything going through the pipe does so
and figuring out how it all worked was quite a without noticeable latency. The phone did pretty
task. Dealing with connecting Bluetooth across well. No hang-ups or crashes have happened,
two different operating systems only made although if the connection attempts fail, the
matters worse. The personal server runs Linux, phone will block out Bluetooth for a time while it
which handles Bluetooth fairly well once things fixes itself internally. If this happens, Bluetooth
get going. The phone was much more can be turned off on the phone and then
complicated. switched back on to clear things up faster.
However, while the program is running,
[Richard, check out what I’m saying here…] everything goes very smoothly. Lastly is the
personal server. Nothing about our
programming has been causing problems, but
the server itself is a bit stubborn. Random As far as extending playlist control, it would be
resets or power failures, and Bluetooth nice to have full control over playlists. Using the
connectivity issues have constantly been a phone, a user should be able to create new lists,
bother. load saved ones, and modify them on the fly.
Currently,
The second category we aimed for was usability.
Does the player work well for what it was [what CAN we do?]
designed? Like the scenario in the introduction
above, can you just throw the server in a Another feature of our project that could be done
briefcase and tune any radio around you to the in the future is a file transfer system. Currently,
right frequency to hear your music? The answer there is no way to add or remove music from the
is yes. Our player passed with flying colors. compact flash except by removing the memory
Getting music to and from your player requires card and reading it on some other device. We
some more wired interfacing right now, but all need some sort of front end for the users to
music playback is completely mobile and access the files with.
wireless. Mp3 Radio passes the usability test.
There are two routes to take on this, either a
The last category was music quality. How good network approach or a web approach. A front
is the sound that comes from the player? The end could be built that would create an SSH
answer is about what you would expect from an session to the personal server via its wireless
FM broadcast. The signal is good and clear if connection, or even use FTP protocols to
your server is near the radio, but once you go transfer files in and out. This approach would be
about 20 feet away, the signal begins to die efficient and secure, but it is downfall is
down. That is the nature of radio broadcast, but portability. The goal of Mp3 Radio is portability.
for what it would be used for, the 20 radius is Taking your music anywhere means a user
acceptable. On a related note, plugging shouldn’t be confined to a single computer with
headphones into the server works perfectly, installed software to transfer files.
although not within our project goals.
A better approach is a web solution. The
personal server runs an Apache web server, so
7. Conclusion and Future Work why not take advantage of that? A web
application could be created that would let you
The next thing this project needs is features. upload and manage files from any internet
Our Mp3 Radio project only implements the connection.
minimal functions of a music player such as play,
stop, next, and previous. Other players have Another thing to consider would be a peer to
things like fast forward, reverse, much more peer connection. Perhaps users could
playlist control, or current song information. exchange files directly from personal server to
Much of this is supported in some way or personal server. This introduces more security
another by Madplay; it would just be a matter of issues and would be a whole other project, but
extending the project. Unfortunately, we didn’t would be an interesting thing to tackle.
have the time to do that.
Something we could have done better if we did
Seeing the song play time displayed on the the project over again, would be to learn
phone, along with the bit rate and other common Symbian. A guide to programming in Symbian
Mp3 header information, would be a definite would have been a great thing to have, but we
plus, and should be one of the first things to learned it all the hard way, and spent many
improve on the phone’s interface. Real time frustrating hours not getting anywhere. Similarly,
song information would mean sending constant another valuable lesson can be learned here.
updates to the phone, which may or may not Start early.
affect the efficiency of the player. However, it is
likely that the extra messages will not be too
much of a burden, and some packet loss would 8. Acknowledgements
definitely be acceptable since the data could
easily be interpolated.
A warm thanks to Trevor Pering from Intel personal server the following command is
Research, who has been invaluable in helping needed to run the application:
with everything concerning the personal server.
> ./madplay –r /mnt/cf1/Music/*.mp3
Thank you to Don Patterson and Nik Livic for
help figuring out how to program to the Nokia -r is a repeat flag. This will cause the playlist to
phone. loop when it reaches its end instead of closing
the player.

9. References The directory is the path to the compact flash


card which contains the music in a directory
[1] Bemused. http://bemused.sf.net called Music.
[2] Winamp. http://winamp.com
[3] Windows Media Player. The player is instructed to play all files in that
http://www.microsoft.com/windows/windowsmedi directory (*.mp3) by default. However, the
a/default.aspx player ideally will start up and automatically wait
for a playlist to come from the phone before
playing any songs.
10. Appendices
10.1 – Personal Server Codebase

The code base for Mp3 radio came from the


Madplay source. We took the Madplay player
and added the necessary code to it to support
Bluetooth connections and handle any new
messages and functions we needed. The three
files modified from the Madplay directory are the
following:

 madplay.c – The Madplay entry point.


Modified to open and close Bluetooth
connections before and after running the main
player.
 player.c – The bulk of music playback.
Modified to support Bluetooth input instead of
keyboard input to control playback as well as
where all of our new functions to handle
playlists on the fly and any other things we
needed Madplay to do.
 player.h – Extended the player struct to
include some Bluetooth and current directory
information.

The code can be compiled simply by running


“make”. However, strange things have
happened when “make clean” is not run before
recompiling the player. It is recommended to run
“make clean” before each build.

10.2 – Running the Mp3 Radio Server

Making the program will produce the executable


“madplay”. Once this file is moved to the