Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Forum

  Home arrow Linux For Devices Articles arrow Build DeJaneiro -- a Browser-controlled MP3 Player

Build DeJaneiro -- a Browser-controlled MP3 Player
By Rick Lehrbaum

Rate This Article: Add This Article To:

Foreword: This "mini how-to" by Kevin Dankwardt, of K Computing, explains how to create a home-made MP3 player appliance based on Embedded Linux. Its embedded software (kernel, utilities, and application) image is small enough to fit on a floppy, so you could easily install it in a DiskOnChip Flash device (

target="_blank">article) within a compact, appliance-like system (article). You control the resulting MP3 player using a web browser on a separate computer.

This project is used as an instructional exercise in K Computing's Embedded Linux training seminars. Although the procedures provided are minimal, it was felt that members of the Embedded Linux community would appreciate the challenge of working from a minimum of guidance. If you have any comments or questions, please feel free to contact K Computing at dejaneiro@kcomputing.com. Enjoy!



DeJaneiro -- a web-controlled MP3 player appliance


DeJaneiro Control Page

In the above image we show the control page for DeJaneiro. In this diagram, we show the envisioned scenario. The idea is that DeJaneiro is a piece of stereo equipment. But, instead of having knobs and such, DeJaneiro is controlled via a web browser running on your home computer, or perhaps, a remote or handheld device. In this project, we use a PC to simulate the stereo equipment pictured in the diagram.

Hardware/software required

You will require . . .
  • x86 PC, both for development and to serve as the target hardware for DeJaneiro
  • Sound card
  • Network card -- assuming you want to control the MP3 player from another computer
  • Linux kernel -- we use 2.2.14; get it here
  • GoAhead webserver -- get it here
  • Xaudio -- MP3 playing software; get it here
  • Embedded website -- web pages, directory setup, and cgi scripts for DeJaneiro interface; get them here
  • Linux libraries -- you know . . .
  • BusyBox -- small footprint utility package; get it here
  • Ash -- available with most Linux distributions.
  • Formatted floppy image with SysLinux boot loader
You may also want to take a look here, for some of the above.

Ready, set, . . .

There are a number of different ways to put together this project. We've chosen to use an approach that is both illustrative of many of the issues involved in developing an Embedded Linux system, and is relatively straightforward to accomplish.

Below are step-by-step instructions. We've attempted to include just enough instructions so that you can figure out what we mean. On the other hand, we've omitted some of the details intentionally, in order that you'll have the opportunity to work some of it out on your own. Good luck!
  1. Download the GoAhead webserver, xaudio, busybox, ash, the SysLinux floppy image, and the DeJaneiro web pages.
  2. Copy the SysLinux floppy image to a floppy disk doing something like "dd if=/dev/fd0 of=/empty_dos_image bs=1440k count=1"
  3. Create a SysLinux configuration file, called syslinux.cfg and put it on the floppy. Its contents could be:

      default linux
      prompt 0
      display boot.msg
      F1 boot.msg
      label linux
      kernel vmlinuz
      append initrd=initrd.img root=/dev/ram ramdisk_size=8192

  4. Create a file called "boot.msg" and put a simple ASCII message inside. You will see this when you boot with the floppy
  5. Create a work space directory on your development system. In this directory create subdirectories called etc, dev, bin, tmp, lib, web, and proc.
  6. In the etc directory put an empty group file, an empty passwd file, a hosts file with the line "127.0.0.1 localhost loopback dejaneiro", an inittab file with the two lines "console::sysinit:/etc/rc.sysinit" and "console::respawn:/bin/sh", a nsswitch.conf file with the line "hosts:files" and a rc.sysinit file with lines to insert your sound and network drivers (if needed), an ifconfig to configure your network, and "/bin/webs &" to start the web server. Make sure that the rc.sysinit file has the execute permission set.
  7. In the dev directory, create device files that you'll need. Use the same major and minor numbers as found on your development system. We suggest you create console, dsp, null, mixer, and tty. Use the mknod command.
  8. Make busybox and include cat, cp, date, false, grep, head, hostname, init, kill, ln, ls, lsmod, mkdir, mknod, mount, more, mv, ps, pwd, rm, sed, sort, tail, tar, tee, true, touch, uname, uniq, wc, yes, whoami, and any other commands you would like to have.
  9. In the bin directory put ash, busybox, cut, expr, ifconfig, insmod, webs (the GoAhead web server), and rxaudio. Make links to ash called "sh" and "bash". Make the links to BusyBox for the commands you included.
  10. In the lib directory put the dynamic libraries that you will need. Use the "ldd" command on the executables in bin to find out the libraries to include. Add to the list libnss_files.so.2 which won't show up with "ldd".
  11. Copy the DeJaneiro web files to the web directory. Add a small MP3 file to the MP3 directory.
  12. The tmp and proc directories are to be empty.
  13. Create an empty, 8MB file with "dd if=/dev/zero of=initrd.img bs=8M count=1". After creating the file, make an ext2 file system on it using mkfs.
  14. Mount that file as a loop back file and copy your subdirectories to it using find and cpio. A command from the directory above these, like "find . -print0 | cpio -p0dm ../initrd_directory" should do it.
  15. Umount the file and then compress it: "gzip -9 initrd.img" should do it.
  16. Copy the compressed file "initrd.img.gz" to the floppy calling it "initrd.img".
  17. Make a new kernel with "make menuconfig". Make sure to include sound and networking support and drivers for your sound and network cards. Be careful to choose only those options you need. The resulting kernel should be somewhere around 375K. Make a kernel of type "zImage".
  18. Copy the kernel "zImage" to the floppy calling it "vmlinuz".
  19. Boot the floppy
  20. Connect to it from a web browser -- use port 8081.
. . . Now, enjoy the music!



Author's bio: Kevin Dankwardt is founder and President of K Computing, a Silicon Valley training and consulting firm. He has spent most of the last 9 years designing, developing, and delivering technical training for such subjects as Unix system programming, Linux device drivers, real-time programming, and
parallel-programming for various organizations world-wide. He received his Ph.D. in Computer Science, in 1988. He may be contacted at k@kcomputing.com.



Talk back! Do you have questions or comments on this article? talkback here




Discuss Build DeJaneiro -- a Browser-controlled MP3 Player
 
>>> Be the FIRST to comment on this article!
 
 
 
>>> More Linux For Devices Articles Articles          >>> More By Rick Lehrbaum
 



FUEL Database on MontaVista Linux
Whether building a mobile handset, a car navigation system, a package tracking device, or a home entertainment console, developers need capable software systems, including an operating system, development tools, and supporting libraries, to gain maximum benefit from their hardware platform and to meet aggressive time-to-market goals.

Breaking New Ground: The Evolution of Linux Clustering
With a platform comprising a complete Linux distribution, enhanced for clustering, and tailored for HPC, Penguin Computing¿s Scyld Software provides the building blocks for organizations from enterprises to workgroups to deploy, manage, and maintain Linux clusters, regardless of their size.

Data Monitoring with NightStar LX
Unlike ordinary debuggers, NightStar LX doesn¿t leave you stranded in the dark. It¿s more than just a debugger, it¿s a whole suite of integrated diagnostic tools designed for time-critical Linux applications to reduce test time, increase productivity and lower costs. You can debug, monitor, analyze and tune with minimal intrusion, so you see real execution behavior. And that¿s positively illuminating.

Virtualizing Service Provider Networks with Vyatta
This paper highlights Vyatta's unique ability to virtualize networking functions using Vyatta's secure routing software in service provider environments.

High Availability Messaging Solution Using AXIGEN, Heartbeat and DRBD
This white paper discusses a high-availability messaging solution relying on the AXIGEN Mail Server, Heartbeat and DRBD. Solution architecture and implementation, as well as benefits of using AXIGEN for this setup are all presented in detail.

Understanding the Financial Benefits of Open Source
Will open source pay off? Open source is becoming standard within enterprises, often because of cost savings. Find out how much of a financial impact it can have on your organization. Get this methodology and calculator now, compliments of JBoss.

Embedded Hardware and OS Technology Empower PC-Based Platforms
The modern embedded computer is the jack of all trades appearing in many forms.

Data Management for Real-Time Distributed Systems
This paper provides an overview of the network-centric computing model, data distribution services, and distributed data management. It then describes how the SkyBoard integration and synchronization service, coupled with an implementation of the OMG¿s Data Distribution Service (DDS) standard, can be used to create an efficient data distribution, storage, and retrieval system.

7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
PLATINUM SPONSORS

 
 

 
 

 
 

GOLD SPONSORS


(Become a sponsor)

(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Check out the latest Linux powered...

Mobile phones!

MIDs, UMPCs
& tablets

Mobile devices

Other cool
gadgets

Resource Library

• Unix, Linux Uptime and Reliability Increase: Patch Management Woes Plague Windows Yankee Group survey finds IBM AIX Unix is highest in ...
• Scalable, Fault-Tolerant NAS for Oracle - The Next Generation For several years NAS has been evolving as a storage ...
• Managing Software Intellectual Property in an Open Source World This whitepaper draws on the experiences of the Black Duck ...
• Open Source Security Myths Dispelled Is it risky to trust mission-critical infrastructure to open source ...
• Bringing IT Operations Management to Open Source & Beyond Download this IDC analyst report to learn how open source ...


BREAKING NEWS

• NAS system houses 2.5-inch drives for up to 6TB
• Atom SBC boasts special low-power mode
• Android leaps to rugged handheld, and more phones
• Simulator runs Android apps on Ubuntu
• Fanless industrial PC taps Atom
• Router platform runs OpenWRT Linux
• Feature-packed UMPC survives four-foot drops
• UMPC pioneer gives up the ghost
• Biodegradable, solar-powered netbook runs Linux
• Hypervisor rev'd for higher reliability
• Eurotech spins Atom development kits
• Home media server to demo on Intel Atom platform
• Atom boards feature fanless DC operation
• Low-cost pluggable NAS adds Linux support
• Taiwan open source conference sets agenda


Most popular stories -- past 90 days:
• Linux boots in 2.97 seconds
• Tiniest Linux system, yet?
• Linux powers "cloud" gaming console
• Report: T-Mobile sells out first 1.5 million G1s
• Open set-top box ships
• E17 adapted to Linux devices, demo'd on Treo650
• Android debuts
• First ALP Linux smartphone?
• Cortex-A8 gaming handheld runs Linux
• Ubuntu announces ARM port


DesktopLinux headlines:
• Simulator runs Android apps on Ubuntu
• Hypervisor rev'd for higher reliability
• Pluggable NAS now supports Linux desktops
• Moblin v2 beta targets netbooks
• Linux-ready netbook touted as "Student rugged"
• USB display technology heading for Linux
• Ubuntu One takes baby step to the cloud
• Game over for Linux netbooks?
• Linux Foundation relaunches Linux web site
• Dell spins lower-cost netbook


Also visit our sister site:


Sign up for LinuxForDevices.com's...

news feed


Or, follow us on Twitter...