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

Keywords: Match:
Building a solid-state mini-ITX Linux recording studio
by Henry Kingman (June 1, 2004)

This simple embedded Linux project builds a dedicated music recording and editing computer that uses a CompactFlash card instead of a hard drive, to eliminate hard disk chatter. The project is simple because it starts with an embedded Linux distribution: a "Live CD" released last week by the Agnula Project.


The finished system, with a 12-pack of harmonicas for "scale"
(Click to enlarge)


The Agnula project aims to create a GNU/Linux audio distribution that can meet the needs of professional recordists. It offers a Red-Hat based "ReMuDi" version, as well as a Debian based "DeMuDi" version. Live CDs are only available in the latter version, currently.

Installing the live Agnula/DeMuDi CD image onto a CompactFlash, instead of running it from the CD, results in the following benefits:
  1. It frees up the CD drive, which can now be used to burn CDs

  2. CompactFlash read speeds are generally faster than CDs', resulting in a little more snap, and less chance of drive spin-up introducing unwanted noise.

  3. Since the iso image is compressed, using the cloop filesystem, we'll get nearly 3GB of the best, latest audio applications -- along with a real-time Linux kernel -- in just 650MB of Flash storage space that is mounted read-only, to maximize the life of the CF card. The system will use a ramdisk filesystem for the ultimate in disk I/O, but a second read-write partition on the card provides file storage for "keepers." With a 2GB flash card, the second partition can hold two CDs worth of data, or one CD worth of wav files, and one CD iso image.
Okay, let's build some hardware.

Hardware

Parts list:
  1. VIA MII 12000 motherboard, which comes with IDE cables
  2. 512 MB of DDR266 SDRAM, the fastest the above VIA board can handle, in a "low profile" package (mini-ITX cases have low headroom!)
  3. 2GB SanDisk "Ultra" CompactFlash card -- they claim 10MB/sec read/write, but despite many tuning attempts, mine tops out at about 7MB/s. Still better than 1.50 from my CD. And no seek time!
  4. 3.5-inch IDE - CompactFlash adapter
  5. DVD/CD-R/RW combo drive
  6. Slimline CD to 3.5-inch IDE adapter
  7. (optional) Slimline Floppy drive
  8. (optional) Slimline to desktop floppy cable adapter
  9. Morex case with DC-DC converter and power brick
  10. Creative Labs Soundblaster Live! soundcard (emu10k1 type). I asked M-Audio to supply a Delta 44, but it did not arrive in time. The VIA has pretty good built-in audio, but Agnula never seems to get along with integrated audio chipsets very well, in my limited experience. The add-in Live! card works much better for full-duplex (recording and playing back at the same time)


The 1200MHz MII 12000 is VIA's first mini-ITX board with a full-speed floating point unit (FPU), for better multimedia performance
(Click to enlarge)


System preparation

The VIA board has a CompactFlash slot on a Ricoh CardBus chip, and it may have been possible to boot the system from this slot, with some work, by building an initrd image with PCMCIA and ide_cs modules. Way too much work!

IDE-CompactFlash adapters (the one I used is shown at right) are about $20. Some adapters are fancier, and come with floppy-bay cases, lights, and everything. CompactFlash cards are designed to respond to IDE commands, and the IDE-CompactFlash adapter has no electronics. It simply passes the CF pins to the IDE connector pins. It has a single jumper switch, which I closed to make the CF card the master. I connected it to the primary IDE bus, so it would appear in the system as /dev/hda.

My adapter used a floppy connector, and the Morex case only had three, so I had to use a splitter with the unused harddrive cable. I also had to fabricate a thingee out of some angle brackets to hold the adapter and card securely in the drive bay.


The CF-IDE adapter, installed in the drive bay. Note that if this system had a hard drive, it would be inches away from the sound card, with it's cable wrapping around. Not good from an RF interference standpoint!
(Click to enlarge)


I set up the combo drive as the master on the secondary drive /dev/hdc.

First boot

First, we use another machine to download the Agnula/DeMuDi Live CD 1.1.1 image (mirrors here and here) and burn it onto a CD, which we then boot on the new machine. The Live CD uses the excellent Knoppix system to detect hardware and boot on a ramdisk into a KDE/Debian environment.

Next, we use fdisk to created two type 83 (Linux) partitions on the CF card. I made /dev/hda1 650MB, just large enough to contain the A/DeMuDi Live CD image. The other partition fills the remainder of the card:
Disk /dev/hda: 
2048 MB, 2048901120 bytes 64 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 316 637024+ 83 Linux
/dev/hda2 317 992 1362816 83 Linux
After writing the partition table, we use mkfs-ext2 to create ext2 filesystems on both partitions. We then use rebuildfstab to make Knoppix aware of the new drive.
root@ttyp1# mkfs.ext2 /dev/hda1 
root@ttyp1# mkfs.ext2 /dev/hda2
root@ttyp1# rebuildfstab -r
Because we want to treat the CF card as gently as possible, we edit /etc/fstab, adding the "noatime" option to prevent the system from continually recording each time a file is accessed:
# Added by KNOPPIX 
/dev/hda1 /mnt/hda1 ext2 noatime,noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda2 /mnt/hda2 ext2 noatime,noauto,users,exec 0 0
Then we mount both partitions:
root@ttyp1# mount /mnt/hda1 
root@ttyp1# mount /mnt/hda2
Now it's time to copy the compressed cloop file system from the CDROM to the CF card. Issuing the mount command shows us it's mounted at /cdrom. Next, ls /cdrom shows it contains a KNOPPIX directory and a boot directory. We're going to copy the KNOPPIX directory, but we'll build our own special boot directory. Like this:
root@ttyp1# cp -ar /cdrom/KNOPPIX /mnt/hda1 
root@ttyp1# mkdir /mnt/bootimage
root@ttyp1# mount -t vfat -o loop /cdrom/KNOPPIX/boot.img /mnt/bootimage
root@ttyp1# mkdir /mnt/hda1/boot
root@ttyp1# cp -ar /mnt/bootimage/* /mnt/hda1/boot
We're almost done! The only thing left to do is to make the CF card bootable, using some special lilo magic. CD to /mnt/hda1/boot and type vi lilo.conf and do something like this, which worked for me:
lba32 # if your CF card uses it 
boot=/dev/hda # install lilo in master boot record of CF disk
backup=/dev/null # don't bother to backup the old MBR
prompt # lets you pick among several kernels, if you like
timeout=30 # wait 3 seconds before booting, to allow add'l options
vga=791 # use cool framebuffer console, with boot penguin logo
root=/dev/hda1 # where to look for the root filesystem
image=/boot/vmlinuz # location of kernel
label=Knoppix # name of kernel
initrd=/boot/miniroot.gz # location of initial boot image
read-only # in case of errors, mount read-only
append="ramdisk_size=100000 init=/etc/init lang=us apm=power-off
hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi
nomce quiet BOOT_IMAGE=/KNOPPIX/KNOPPIX" # for info on these, lookup
"knoppix cheatcodes"
Once the file is set up to your liking, force a symbolic link to overwrite the /boot directory in your ramdisk filesystem, and run lilo:
root@ttyp1# ln -sf /mnt/hda1/boot /
root@ttyp1# lilo -C /mnt/hda1/boot/lilo.conf
Added Knoppix *
Assuming all went well, go ahead and reboot without the CD, and you should be welcomed by a nice embedded Linux audio distribution.


A/Demudi starts jack automatically, and offers nearly every Linux audio application imaginable -- and many general purpose applications, too
(Click to enlarge)


Additional configuration options

Knoppix Live CDs have some interesting features for saving configuration and user files. When you boot A/DeMuDi from a CF disk according to the method above, you will only be able to mount /dev/hda1 as read-only, as Knoppix takes full control of the partition containing the root filesystem. However, /dev/hda2 will be writeable. So, you might want to investigate the options under the KDE ==> KNOPPIX ==> Configure menu, and then consider adding home=scan and myconfig=scan to your lilo.conf file and rerunning lilo according to the instructions above.

Especially interesting is the ability to save your /home/knoppix and other files using an AES encrypted filesystem. This is rather swell, as it means that even if the RIAA should seize your computer, they wouldn't be able to find those Grey Album samples in your home directory without typing in the proper 20-letter or longer password or buying some serious super-computer time. This would be especially nifty if you could get it to work using the hardware PadLock Ace AES engine in the C5P core C3 chips from VIA. This is left as an excercise for the (much geekier than I) reader.

Also nice would be the capability to edit the cloop compressed files in /KNOPPIX/KNOPPIX directly. This would save minor annoyances such as always having to edit /etc/fstab to add the "noatime" option to /dev/hda2. Cloop compressed filesystems are created with some flags to mkisofs that add compression; there ought to be some way to edit the files mounted under /dev/cloop, and remake the /KNOPPIX/KNOPPIX CD-ROM image, but I have not yet investigated doing so. It might require a full set of Knoppix build scripts, though, I don't know.

General notes

The A/DeMuDi kernel is based on Linux 2.4.24 -- just recent enough to include pretty good support for the chipsets used on the VIA board. Support for several VIA mini-ITX chips was added right around 2.4.23.

I did have trouble with Ethernet chip onboard the bleeding-edge VIA MII 12000 board. It worked on the initial boot, using the via-rhine driver, but afterwards failed with an error message about an invalid MAC address.

The VIA board came with a CD of drivers, including source code for a new Ethernet driver. The kernel headers were unfortunately not included on the A/DeMuDi CD, though, so I was unable to build the driver. I wrote to someone at Agnula.org, who promptly sent me the kernel config file. Eventually, I'll build the driver and stash it somewhere on /dev/hda2.

Meanwhile, I used a PCMCIA Ethernet card I had lying around. It's very convenient to be able to use your various PC cards -- and CF cards -- in your desktop system! The MII 12000 has nearly every I/O interface you could ever imagine, including four USB ports, FireWire, S-Video, RCA-Video, S/PDIF (only for native audio chipset), CF and PCMCIA CardBus slots (supporting single and double-height cards of each type), IrDA, and on and on and on...


I decided that the VIA's MII 12000's 18 back panel connectors were not enough, so I routed harddrive cables out the back, for good measure. The system fans on the right are unused.
(Click to enlarge)


Once I had installed the PCMCIA card, I made a script to start the network:
#!/bin/bash 
/sbin/ifconfig eth0 192.168.1.120 netmask 255.255.255.0 up
/sbin/route add default gw 192.168.1.254
echo "nameserver 192.168.1.254" >> /etc/resolv.conf
exit 0
I put this in /dev/hda2, and type sh /mnt/hda2/network.sh to bring up the net, should I need it.

I have only had a chance to record a couple of simple things so far. But, I have to say, Agnula/DeMuDi is really impressive! It would have taken me a very long time to get a system configured in anything close to as functional a state. I had previously made some attempts to get jack and ardour working, but doing so requires quite a bit of kernel patching, as jack requires the low-latency and kernel pre-emption patches, yet does not yet seem to work with kernel 2.6, which includes these as configure-time options.

I used the desktop version of the C3 for this project, which uses a very quiet "fan-sink" fan. Someone with more professional requirements should consider using one of VIAs boards based on the fanless Eden processor. The Eden is the exact same processor as the C3 on the board I used, but tested and prepared differently for greater heat tolerance, in order to support fanless operation at slightly reduced clock speeds. With an Eden-based VIA board, you should be able to create a completely solid-state recording system without a single moving part, other than the CD-burner, floppy drive, and the power switches.

Older VIA motherboards should work fine, too; although, the C5P-based C3s, found in MII 12000 and newer VIA boards, are the first to feature a full-speed floating point unit, which probably helps out with multimedia operations quite a bit.

If you'd like to try out Agnula, but you're not too sure you want to spend upwards of $150 on a 2GB CompactFlash card, be aware that you can also install the Live A/DeMuDi 1.1.1 CD onto a harddrive, either natively (on an uncompressed, read-write, normal filesystem), or onto a cloop filesystem much as I have described above, but using a normal harddrive in place of the CompactFlash card. The Agnula Website has instruction on the former approach; the above howto should be helpful in case you want to try the latter route, which will result in a quieter system, since the drive could tuned with hdparm to spin down except when launching applications.

Have fun! . . .



About the author -- Henry Kingman has edited LinuxDevices.com for nearly a year. Prior to that, he spent a year sitting in a cool basement learning guitar, bass, and harmonica. He likes old-time fiddle tunes, and lots of other stuff, too.




Related Stories:

(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
HOWTOs: from DevShed & IBM DeveloperWorks:



BREAKING NEWS

• Debian gains installer for Marvell Feroceon
• Open source awards open for nominations
• Atom-based ECX board runs Linux
• Tiny boards gain Linux cross-tools support
• Cross-platform tools vendor announces awards, earnings
• Little thin client runs Linux
• $7 Soc runs Linux
• Linux wins big in financial trading
• Linux-based remote access equipment adds monitoring
• Dual-core ARM SoC clocks to 1.2GHz
• Verizon Wireless, seven others join Linux phone org
• Android Developer Challenge announces first-round winners
• Low-end RAID controllers support Linux
• Wind River joins open source high-availability group
• Thin clients bulk up on software


Most popular stories -- past 30 days:
• Ubuntu ported to ARM
• Linux still top embedded OS
• Linux gains new architecture support
• Linux 2.6.25 release bolsters ARM
• Linux-based diskless notebook costs under $300
• Low-cost MP3 player gains fancy Linux port
• Dutch UMPC runs Ubuntu Linux
• Mini-notebook boasts Linux, near-fullsize keyboard
• PC/104 module runs x86 Linux on 1.85 Watts
• Low-cost Linux-based NAS device supports RAID 1
• Free router distro gains wild WiFi features


Linux-Watch headlines:
• Verizon chooses Linux "platform of choice"
• Hats off to Fedora 9
• Running a small business on desktop Linux
• Sun launches OpenSolaris
• Via tiptoes toward openness
• Linux certification comes to Italy
• Installing Ubuntu Hardy Heron as a web hosting server
• Black Duck Buys Koders
• Open source conference co-locates with Ubuntu show
• Ubuntu 8.04 ready to challenge Windows


Also visit our sister site:


Sign up for LinuxDevices.com's...

news feed

Home  |  News  |  Articles  |  Polls  |  Forum  |  About  |  Contact
 
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.