etree.org | linux, introduction
This webpage is intended as a very simple quick-start guide for burning audio CD's under Linux.
As the software used is mostly open source and has been ported to other *NIX variants, this
webpage can likely be used with few changes for these other OS's.
Andy McFadden's CD-Recordable FAQ
For detailed information on burning CDs under Linux and on recordable CDs in general,
please check the following URL's:
etree.org | linux, required software
- Shorten - You will need to either build
yourself a copy of shorten from the source
code, or download a precompiled binary version. See the shnutils shorten page for the source
code and pre-compiled binary packages for your platform of
choice. The code is quite portable and should build on any
UNIX-like OS with an ANSI C compiler.
- md5sum - According to etree seeding
guidelines, all of the .shnf directories you will encounter are
accompanied by a .md5 file. You can use the md5sum program
to check the integrity of the files you have downloaded by
comparing them with the data in the .md5 file. When the sums
check out, you can be sure you have a bit-for-bit exact copy of
the file as it was originally generated.
On Red Hat Linux, md5sum is part of the "textutils"
package, which will likely be installed on your system already.
On Debian it is part of the "dpkg" package and as such will be
installed on all systems.
- cdrecord - This is the application which
does the actual CD-R writing. It is capable of creating audio,
data and mixed-mode CD-R's (e.g. data and audio together), and in
recent versions can burn DAO (disc-at-once).
etree.org | linux, optional software
The programs mentioned above are an absolute must if you want to check and burn audio CD-R's from Shorten files.
The software listed below is optional, but highly recommended.
- Perl - Most of the handy
labor-saving scripts that this page refers to are written
in Perl. You'll need the Perl interpreter to run them. You
probably already have it, but please install it if you do
- etree-scripts -
A collection of scripts (md5check, shn2mp3,
flacify, unshn, burn-shns,
make-toc) which will hopefully make your life a lot
easier. These are written and maintained by Caleb Epstein
<etree-bklyn at sneakemail dot com>.
- mkisofs - Used to create ISO-9660
filesystems (e.g. data CD-R's). This is now part of the
cdrecord source code tar file, but can be installed
separately on some systems. If you plan on creating data
CD-R's (e.g. if you want to archive your .shn files), this is a
- Arson - a KDE front end to various CD
burning and ripping tools. It can burn audio CDs from SHN,
Ogg, and MP3 files in addition to WAV. It can also burn data
CDs as well as VCD and SVCD. Very nice.
Toaster (aka gtoaster) - This is a GUI
application which can be used to burn data or audio CD-R's. It
has a set of features similar to Adaptec EZ-CD Creator under
Windows. It can be difficult to configure, but is quite
powerful and easy to use once you have it up and
- gcombust - Another Gnome-based GUI
burning application. It's not quite as feature-rich as
gtoaster, but easier to configure. As with
gtoaster, this application is being actively developed,
so you can expect many new features and bugfixes in newer
- cdrdao - Yet another CD-R burning
application which can also do DAE (digital audio extraction).
It has some advanced features that cdrecord doesn't
offer, specifically the ability to add silence or pre-gaps to
tracks, burn CD-TEXT discs, burn multiple .wav files as a
single track, or burn a single .wav file as multiple tracks
(e.g. if it was never track-split). On the negative side of
the ledger, you need to create a table-of-contents (TOC) file
as input to cdrdao, so it isn't as easy to use as
- cdparanoia - Digital Audio Extraction
(DAE) application for Linux. If you are going to be copying
audio CDs, you need this program. Note that cdrdao has
the "Paranoia" library built into it and can do the same
reliable DAE as cdparanoia can.
grip - Grip is a GTK-based (GUI) CD-player and
CD-ripper. It has the cdparanoia
ripping capabilities built-in but can also use external
rippers. This is the moral equivalent of EAC for *NIX.
- shntool -
shntool is a utility to determine the length (both time and
file size) of the .wav's contained within .shn's, as well as
whether those .wav's were properly cut on sector boundaries.
You can also use it to fix improperly sector-aligned
xmms-shn - The xmms-shn plugin allows you to play
Shorten files in XMMS
without having to un-Shorten them first, similar to ShnAmp, the
Shorten Plugin for Winamp for Windows.
- a tool for working with sets of SHN audio files and the
standard UNIX "make" utility to automate the process of burning
archive CD-Rs, audio CD-Rs and the encoding of lossy MP3 and
etree.org | linux, config
OK, you have the software and you have a PC with a CD-R burner running Linux. You're almost done! Now you need
to set everything up.
First you want to make sure you have the appropriate device drivers compiled and/or installed.
If you have an IDE/ATAPI burner, you will need to load the ide-scsi kernel module. This will make your
IDE burner look like a SCSI device, and we'll treat you like you have a SCSI burner from now on. When using the
ide-scsi module, it may be necessary to add a line of the following format to your /etc/lilo.conf file:
append = "hdx=ide-scsi"
where you replace the x in hdx with the appropriate drive letter corresponding to your burner (it
will be a letter from a-d). This can can usually be found by examining the messages when your system boots up or
reviewing them with the dmesg command. You should see something like this:
hdc: HITACHI GD-2000, ATAPI CDROM drive
You will need to run lilo and reboot after changing lilo.conf.
If your burner is a SCSI device, you need to have the
appropriate driver for your SCSI card either compiled in to the
kernel or loaded as a module. If you do, you should see messages
similar to the one below when you boot up or load the SCSI card
module (or when you load ide-scsi if you have an IDE
(scsi0:0:5:0) Synchronous at 20.0 Mbyte/sec, offset 8.
Model: CD-R PX-W124TS
Type: CD-ROM ANSI SCSI
For both IDE and SCSI drives, you must also have the SCSI Generic (sg) module available. All of these
modules should be part of the standard kernel installation on your system. If they aren't available, you'll
need to reconfigure and recompile your kernel so that they are.
Note the string scsi0:0:5:0 from the kernel message above. These last three numbers are
the SCSI bus, target, and LUN (Logical Unit) number for the burner device. Make a note of these.
Now you should be able to run cdrecord and have it talk to your burner device. While logged in as root,
try this command:
cdrecord -eject dev=bus,target,lun
Where you replace bus, target, and lun in the command with the three numbers from the kernel
message mentioned above (e.g. 0,5,0). If all is working correctly, this will eject the tray on your CD recorder.
If it is a slot-loading unit, try putting in a disc and then typing this command. It should eject the disc.
If this all worked OK, you can set some handy environment variables which will save you typing when you want to run
cdrecord. You can do this by editing the file /etc/profile or your own ~/.profile. The variables you should
Where you replace bus, target, and lun with the appropriate numbers and speed with the speed
of your burner (e.g. 8 for an 8x burner). These settings will take effect the next time you login to your machine. You
can also copy these lines to your shell prompt to get the settings in your current environment so you can start burning.
etree.org | linux, cd-r burning
You should now be ready to burn a CD-R! You'll need some .shn's to use, so make sure you download a show before continuing.
Also, make sure you have some blanks CD-R's. Put one in your burner.
I'd also suggest reading the .txt file which accompanies the show you're planning to burn before you start. Sometimes
a show will require one or more 80 minute blank CD-R's (instead of the standard 74 minute) or one or more discs may be
severly under-time, in which case you may want to pad them with some filler tracks. In either case, it is better to be
prepared than to end up with a disc that is useless or only has a couple of short tracks on it.
etree.org | linux, cd-r burning with etree.org scripts
If you have the etree-scripts installed, you should be able to type:
which will produce output similar to:
/usr/local/bin/md5check: checking file bandYY-MM-DDd1.md5
/usr/local/bin/md5check: file bandYY-MM-DDd1.md5: OK
/usr/local/bin/md5check: checking file bandYY-MM-DDd2.md5
/usr/local/bin/md5check: file bandYY-MM-DDd2.md5: OK
/usr/local/bin/md5check: checking file bandYY-MM-DDd3.md5
/usr/local/bin/md5check: file bandYY-MM-DDd3.md5: OK
If all is well (e.g. no FAILED messages or missing files), go ahead and type (while logged in as root):
You will see messages as each .shn file which makes up disc 1 of the show is extracted (which will take a while),
then you'll see the messages produced by cdrecord
Note that the burn-shns script does all its work in the directory
/var/tmp/burn, which it creates if it doesn't exist. You may want to
use a different directory on a different filesystem (e.g. if /var
doesn't have 750 MB free space on your system). If so, you can set the environment variable BURN_DIR
to the directory you wish to use instead and that will be used instead of /var/tmp/burn. You can add
this setting to /etc/profile as you did with the
CDR_DEVICE and CDR_SPEED
etree.org | linux, cd-r burning without etree.org scripts
If you don't have etree-scripts installed (you masochist, you!), you can do more or less the same thing as
above as follows:
md5sum -c -v bandYY-MM-DDd1.md5
If md5sum complains about the -v command line argument (on Red Hat it will), use:
md5sum -c -v.
Assuming the sums check out, now type:
cd /var/tmp/burn # Or whichever dir you want to use
rm -f *.wav # Get rid of any old WAV files there
for file in /some/dir/bandYY-MM-DD.shnf/bandYY-MM-DDd1.shnf/*.shn
do shorten -x $file $(basename $file .shn).wav
This command will extract all the SHN files for disc 1 of that show. Now you can burn them by typing the command below (make
sure you are logged in as root):
cdrecord -v -pad -dao -eject *.wav
This will burn the CD for you in DAO mode and eject it when it is complete.
Slightly More Advanced...
The burn-shns script takes most of the work out of burning a CD-R's worth of Shorten files, but it isn't very smart.
You may run into situations where you can't use it, or where you will need to be a little more careful in how you invoke it.
Non-Standard Directory Structure or File Naming...
For example, you may encounter a show which is not "etree-compliant" in terms of the directory structure or file naming
conventions. If you get a show which has all of the tracks for all discs in the same top level directory, you need to
invoke burn-shns a little more carefully. Like this:
This would run burn-shns on the .shn files with d1 in their names.
If you happened to run it as burn-shns /some/dir/groupYY-MM-DD.shnf, it would
try to un-shorten all of the files for the entire show and burn them together on one CD; this is a sure way to
create a coaster.
Filling Under-Time Discs...
If you want to burn a disc from one show and add filler from another show, you may need to get a little fancier.
You could just run:
burn-shns /path/to/show/undertime-disc.shnf /path/to/filler/filler.shnf
But this may not work as you'd expect. The tracks for undertime-disc,
if they are called e.g. undertime-disct01.shn will appear on the CD-R you
burn after the tracks named e.g. fillert01.shn. This is because
burn-shns just invokes cdrecord with *.wav. Since this shell
wildcarding will pass the filenames in alphabetical order to cdrecord, the filer tracks come first.
To get around this, you can use the script unshn to uncompress the .shn files you want, and then invoke
cdrecord "by hand" like this:
cdrecord -v -pad -dao -eject undertime*.wav filler*.wav
etree.org | linux, cd-r copying
Once you're able to burn your own CD-R's, you'll probably build up a collection pretty quickly. If you burn straight
from .shn files, you can be sure you'll get a perfect disc every time. Sometimes however, you may need to take a
disc of audio or data and make a copy of it (e.g. if you're trading someone a show that you don't have the .shn's for
any more, or for which you've never had them).
Copying Audio CD-R's (DAE)...
DAE, or digital audio extraction, is the process of extracting the audio from a redbook audio CD into .wav files on your
computer's hard drive. DAE is notoriously tricky and error prone, and can introduce artifacts (clicks, pops, jitter)
into the audio despite the digital nature of the extraction.
Luckily there is an excellent application, cdparanoia, which does reliable DAE with error detection and correction.
It is the analog to the highly regarded EAC program for Windows.
Copying Data CD-R's...
Copying a data CD (e.g. an ISO-9660 filesystem, possibly a .shn archive disc) is a ridiculously easy process. Put the
disc you want to copy into your CD-ROM drive. Put a blank CD-R into your burner. If you have only one drive, swap discs
in between the two commands below:
cp /dev/cdrom data.bin
cdrecord -v -data -pad data.bin
Note that depending on your CD-ROM drive and how the data CD you're copying was burned, the
cp command above may generate an I/O error at the very end of the process.
Just do a quick ls and verify that the size looks correct. This error should
Also note that, because data CD's have error correction built in to them, there is no need to use an error-correcting extraction
process to copy them. Using cp or
dd is fine.
If you have two drives, you may even be able to copy discs on the fly. This is not recommended and will
not documented here.
etree.org | linux credits
This page written and maintained by Caleb Epstein
Adapted from the original etree.org Linux SHN HOWTO which was written by Scott Nichols.
What is etree.org? |
Mailing Lists |
Discussion Forums |
SHN's in Circ. |
Server Team |
Link to Us |
Contents designed & maintained by the etree.org Server Team
© 1998-2002, etree.org, except
where noted. All Rights Reserved.
Read our terms of service and privacy