Build DeJaneiro -- a Browser-controlled MP3 Player
By Rick Lehrbaum
2000-11-29
Article Rating:    / 0
| 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 PageIn 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 requiredYou 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! - Download the GoAhead webserver, xaudio, busybox, ash, the SysLinux floppy image, and the DeJaneiro web pages.
- Copy the SysLinux floppy image to a floppy disk doing something like "dd if=/dev/fd0 of=/empty_dos_image bs=1440k count=1"
- 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
- Create a file called "boot.msg" and put a simple ASCII message inside. You will see this when you boot with the floppy
- Create a work space directory on your development system. In this directory create subdirectories called etc, dev, bin, tmp, lib, web, and proc.
- 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.
- 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.
- 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.
- 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.
- 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".
- Copy the DeJaneiro web files to the web directory. Add a small MP3 file to the MP3 directory.
- The tmp and proc directories are to be empty.
- 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.
- 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.
- Umount the file and then compress it: "gzip -9 initrd.img" should do it.
- Copy the compressed file "initrd.img.gz" to the floppy calling it "initrd.img".
- 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".
- Copy the kernel "zImage" to the floppy calling it "vmlinuz".
- Boot the floppy
- 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
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. | |
|
|