Batch Burner with Queues - BBQ

Screenshot

BBQ is new interface to compat-disc burning, designed specifically for audio CDs. BBQ is based on three principles:

If you want to effortlessly burn albums without the hassle of a GUI, BBQ may be for you. This documentation is a work in progress. BBQ is heavily taylored for my uses and I'm in the progress of making it usable by the public as part of the open sourcing process. BBQ has worked extremely well for me, but your mileage may vary.

Sourceforge Project Page - download BBQ here - updated 2004-07-14: VoiceXML interface now included! plus .bbqrc support

Platform Support

Currently, BBQ has been tested on FreeBSD and Linux. Other platforms can be supported if they have a command-line burning and disc information program.

How to Use BBQ

Installation and Configuration

BBQ depends on:
Program FreeBSD Ports Location Gentoo Linux Location Use
perl /usr/ports/lang/perl5 /usr/portage/dev-lang/perl required
lame /usr/ports/audio/lame /usr/portage/media-sound/lame MP3 decoding
vorbis-tools /usr/ports/audio/vorbis-tools /usr/portage/media-sound/vorbis-tools Ogg decoding
burncd, cdcontrol (included in base) N/A burning on an IDE drive on FreeBSD
cdrtools /usr/ports/sysutils/cdrtools /usr/portage/app-cdr/cdrtools burning on Linux or using SCSI
cdtool N/A /usr/portage/media-sound/cdtool required to use BBQ on Linux
eject N/A /usr/portage/sys-apps/eject required to eject on Linux
sudo /usr/ports/security/sudo /usr/portage/sys-admin/sudo used to run bbq2d as root
MP3::Info /usr/ports/audio/p5-MP3-Info /usr/portage/dev-perl/MP3-Info for CD-Text (bbq1d) and MP3List

TODO: make packages

BBQ assumes you have a root music directory with one directory per album. MP3List.pl assumes the folders are named as Artist-Title-Year-Source, with spaces replaced with underscores. If your collection isn't named like this, you can still use BBQ, just not MP3List.

This guide will assume your music is stored in ~/music. Change to that directory and type the following:

mkdir _queue _burn _cache

As of 20040714, BBQ uses a single configuration file for bbq1d, bbq2d, and bfi. A sample .bbqrc is here: bbqrc.linux or bbqrc.bsd copy it to ~/music/.bbqrc (creating the music directory if it doesn't exist), and edit it to your needs. Specifically, edit the following lines:

our $root = "/home/jeff/music";
our $cache_dir = "$root/_cache";
our $xterm = 1;     # Set if have an xterm window
our $cdtext = 1;    # Write cd-text?

$root should be where your albums are, one album per directory. Edit the bbq2d configuration as well:

our $root = "/home/jeff/music";
our $cache_dir = "$root/_cache";
#our $device = "0,0,0";
our $device = "/dev/acd0";
#our $method = "cdrecord";        # cdrecord (Linux or SCSI)
our $method = "burncd";           # burncd (FreeBSD IDE)
our $cdctl_cmd = "cdcontrol";     # cdcontrol (FreeBSD)
#our $cdctl_cmd = "cdinfo";       # cdinfo (Linux's cdtool), implies "eject"
our $speed = 12;

# [...]
sub notify { print "\cG"; }

$root is where your audio collection is, $cache_dir is where decoded audio will be stored. The cache directory is by default, a part of the root, but you can place it on a different partition or drive if desired. Under Linux, set $method to cdrecord. Under BSD, you can use either cdrecord or burncd (ATAPI only). Read the corresponding documentation for information on determining the correct $device, $speed and flags. $cdctl_cmd is the command used to determine if a disc is in the drive, set this to cdcontrol on FreeBSD, cdinfo on Linux (and download the cdtool program, as well as eject.)

Optionally, change notify to do something to get your attention. The default is to print a console beep, which usually requires the PC speaker. You can change this to a command to play an attention-grabbing noise if you want. Lastly, you can customize the burncd or cdrecord parameters. Multisession is encouraged because you can burn data to failed audio discs. DAO is required to burn CD-Text, some older burners only allow multisession in TAO mode (which might be a good reason to use it). Uncomment the correct flags set.

If all goes well, BBQ is now configured and can burn CDs.

Burning an Album

Run bbq1d.pl and bbq2d.pl (as root if needed). If you're using X, the daemons can be ran in separate xterms and the window title will change to reflect the status of burning. You can put this in ~/.xinitrc to start both daemons in windows as in the screenshot at the top of this page:

xterm -geom 55x9+100+20 -e sudo perl ~/music/bbq1d.pl &
xterm -geom 55x9+450+20 -e sudo perl ~/music/bbq2d.pl &

If working correctly, bbq1d and bbq2d should sit idle without any output for now. Both daemons should be running concurrently.

bbq1d.pl prepares the audio data for burning. This amounts to decoding compressed MP3s and Oggs into raw PCM audio data. bbq1d reads from directories specified as _burn/album_name and writes the raw data to _cache/album_name, then tells bbq2d to burn by touching _queue/position-album_name. As of version 20040710, bbq1d creates CD-Text files from the IDv1 tags as well. After queued for burning, _burn/album_name is removed.

bbq2d.pl takes the raw PCMs and burns them using an external burning program, such as burncd or cdrecord. This is accomplished by burning the discs in order from _queue. After burning, _queue/position-album_name and _cache/album_name is removed. The album name is appended to burned.txt for logging purposes.

Basic Interface

There are many ways to select which album you want to burn:

Pick an album (ls), and type touch _burn/Album_Directory. This is the simplest way to tell BBQ to burn an album; mp3list is not required. bbq1d should detect your touch and start decompressing your MP3s, and when its done bbq2d should prompt you that your album is ready to burn. bbq2d will continously beep (or do whatever notify is set to) until a blank CD-R is detected. This is the only indication BBQ has that it is ready to burn.

Advanced Interfaces

If your collection supports it, run mp3list.pl. This will enable you to use bfi, cd.cgi, and vxml.cgi -- alternate interfaces that rely on the CD number instead of name. In all, mp3list generates a HTML list suitable for printing (complete with album number, average bitrate, genre, duration, and size), a plain-text number-to-name CDSINDEX mapping file used by BFI, and VoiceXML grammar files for the VXML interface.

bfi is the Burner Functional Interface which lets you select albums to burn based on their unique number, via standard input. BFI can be used interactively to browse the list, or non-interactively: echo cd_number | bfi.

cd.cgi is a CGI interface to BFI. Using it, one can queue albums remotely anywhere a web browser is available, given only their number. Usage: http://your_web_site/cd.cgi/cd_number. Renaming cd.cgi is encouraged as there is no authentication.

vxml.cgi is a VoiceXML interface that lets you queue albums over telephone networks using DTMF touchtones. Requires sox to convert MP3 quality to telephone quality and a VXML host. Once vxml.cgi is setup, call and enter the album code to burn it.

Full Automation

Aside from selecting the album, the only manual labor involved in burning with BBQ is the insertion and removal of blank and burned CD-Rs. If you have access to a robotic arm, this labor can, in theory, be eliminated. All thats required of the arm is to remove discs when the tray ejects and replace them with blank ones. No propretiary serial interface, no connection at all from the mechanism to the computer is required.

burned.txt can be consulted to determine which CD is which for labelling purposes. Unfortunately, labelling and wrapping (in a Connelly Case) still has to be done manually, but neither of those tasks require a significant amount of time.

Note: This is only an idea, hasn't been built yet.

Miscellaneous

The Connelly Case and eConnelly economy case are low-cost alternatives to the jewel case/digipak case/paper sleeve. Connelly cases can be made with standard letter-size or legal-sized paper and make a perfect complement to discs burned with BBQ. View Connelly Case Photo Tutorial

Another tutorial by Jorge Gallegos Carrasco: Maximize Your CD Case Storage.

TODO

Author

Jeff Connelly. Feedback welcome.

http://bbq.sourceforge.net

SourceForge.net Logo