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

Keywords: Match:
Build DeJaneiro -- a Browser-controlled MP3 Player
Kevin Dankwardt, of K Computing (Nov. 29, 2000)

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 (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


(Click here for further information)


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.

4 Legal Reasons to Control Internet Access
The Internet is obviously a valuable resource for many organizations. However, many are exposed to legal liability concerns because they fail to control Internet access. Learn if you're safe in this white paper.

Rapidly Resolve J2EE Application Problems
Whether you are in the process of building J2EE applications or have J2EE applications already running in production, you must ensure that they deliver the expected ROI. Learn how in this white paper.

Load Testing 2.0 for Web 2.0
There are many unknowns in stress testing Web 2.0 applications. Find out how to test the performance of Web 2.0 in this white paper.

Build Better Games Online
For the game infrastructure providers, life is complex. Making money from games has become more complicated. Why? Find out in this white paper.

Building a Virtual Infrastructure from Servers to Storage
This white paper discusses the virtual storage solutions that reduce cost, increase storage utilization, and address the challenges of backing up and restoring Server environments.

Gaining Faster Wireless Connections with WiMAX
Welcome to what is quickly becoming the hyperconnected world where anything that would benefit from being connected to the network will be connected. Learn more in this white paper.

Is Your Desktop a Security Threat?
The new wave of sophisticated crimeware not only targets specific companies, but also targets desktops and laptops as backdoor entryways into those business’ operations and resources. Learn how to stay safe in this white paper.

Increasing SAN Reliability by 100 Percent
Storage area networks (SAN) are a strong part of storage plans. Learn how to increase your reliability and uptime by 100 percent in this case study.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
GOLD SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Check out the latest Linux powered...

mobile phones!

other cool
gadgets



BREAKING NEWS

• Linux video camera geo-tags, writes to SATA drives
• Garmin Nav devices run Gnome Linux
• Ten LiMo phones this month?
• It's a Yankee Doodle Linux phone
• Wind River to host "Developer Day"
• Dev boards gain Linux support
• 802.11n zooms ahead
• Low-power mini-ITX board runs Linux
• Pico-ITX board bears twins
• Mass-market WiFi router invites Linux hackers
• LiMo phone specialist buys app stack
• "PDA phone" runs Linux
• ST, NXP spin phone chip JV
• Military-grade USB key supports Linux
• USB Linux systems expand


Most popular stories -- past 30 days:
• World's cheapest Linux-based laptop?
• Ubuntu ported to a PDA
• 64-way chip gains Linux IDE, dev cards, design wins
• Embedded PowerPC dev kits come with Linux
• Rapid time-to-evaluation -- a key goal for silicon providers
• Embedded Linux is doomed. DOOOMED!
• Rugged PDA available with Linux
• Netflix Player runs Linux
• Miniature Linux PC targets military apps
• $7 SoC runs Linux
• Android Developer Challenge announces first-round winners
• Dual-core ARM SoC clocks to 1.2GHz


Linux-Watch headlines:
• Microsoft tactics push India toward Linux
• Bell, SuperMicro sued over GPL
• "Business intelligence" software goes GPL
• Will Atom bomb?
• LF Summit videos posted
• Linux gains "embedded" maintainers
• Virtualization on tap in SLES and RHEL upgrades
• Linux gets security black eye
• Verizon chooses Linux "platform of choice"
• Hats off to Fedora 9


Also visit our sister site:


Sign up for LinuxDevices.com's...

news feed

Home  |  News  |  Articles  |  Polls  |  Forum  |  About  |  Contact
 

Ziff Davis Enterprise Home | Contact Us | Advertise | Link to Us | Reprints | Magazine Subscriptions | Newsletters
Tech RSS Feeds | White Papers | ROI Calculators | Tech Podcasts | Tech Video | VARs | Channel News

Baseline | Careers | Channel Insider | CIO Insight | DesktopLinux | DeviceForge | DevSource | eSeminars |
eWEEK | Enterprise Network Security | LinuxDevices | Linux Watch | Microsoft Watch | Mid-market | Networking | PDF Zone |
Publish | Security IT Hub | Strategic Partner | Web Buyer's Guide | Windows for Devices

Developer Shed | Dev Shed | ASP Free | Dev Articles | Dev Hardware | SEO Chat | Tutorialized | Scripts |
Code Walkers | Web Hosters | Dev Mechanic | Dev Archives | igrep

Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2008 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Linux is a registered trademark of Linus Torvalds. All other marks are the property of their respective owners.