1 This file documents the ``Extended'' VLC CD-DA Plugin
3 Copyright (C) 2003 Rocky Bernstein (rocky@panix.com)
5 Permission is granted to copy, distribute and/or modify this document
6 under the terms of the GNU Free Documentation License, Version 1.1 or
7 any later version published by the Free Software Foundation; with the
8 Invariant Sections being ``Free Software'' and ``Free Software Needs
9 Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
10 and with the Back-Cover Texts as in (a) below.
12 (a) The Free Software Foundation's Back-Cover Text is: ``You have
13 freedom to copy and modify this GNU Manual, like GNU software. Copies
14 published by the Free Software Foundation raise funds for GNU
19 Features over the older VLC CD-DA plugin
21 Internally I think this is much much cleaner. It uses the
22 libcdio for disk reading and libcddb to get CDDB information.
25 - Can specify device as well as track.
26 - Because we use the libcdio library, the "device" can be a disk image
27 to be burned (e.g. a cdrdao bin/cue pair and some primitive Nero
31 - Can customize the what to show in the play-list title and author.
32 - Duration of each track is shown
33 - Media information is shown using CDDB
35 - Will scan for a CD-ROM drive with a CD-DA loaded in it.
37 -----------------------------------------------------------------
39 -----------------------------------------------------------------
41 Much of what I write in this section can be found elsewhere. See for
42 example http://www.pctechguide.com/08cd-rom.htm, or the libcdio
45 The Sony and Philips Corporations invented and Compact Disc (CD) in
46 the early 1980s. The specifications for the layout is often referred
47 to by the color of the cover on the specification.
49 The first type of CD specification that was produced was the Compact
50 Disc Digital Audio (CD-DA) or just plain ``audio CD'' and is commonly
51 called the ``Red Book''. Music CD's are recorded in this format which
52 basically allows for around 74 minutes of audio per disc and for that
53 information to be split up into *tracks*. Tracks are broken up into
54 "sectors" and each sector contains 2,352 bytes. To play one 44.1 kHz
55 CD-DA sampled audio second, 75 sectors are used.
57 A CD can hold at most 99 such tracks. Between the tracks CD
58 specifications require a ``2 second'' in gap (called a @term{lead-in
59 gap}. This is unused space with no ``data'' similar to the space
60 between tracks on an old phonograph. The word ``second'' here really
61 refers to a measure of space and not really necessarily an amount of
62 time. However in the special case here where you have an audio CD, the
63 amount of time to play a gap of this size will take 2 seconds. Note
64 this is independent of how fast your CD drive can read a sector.
66 The beginning (or inner edge) of the CD is supposed to have a ``2
67 second'' lead-in gap and there is supposed to be another ``2 second''
68 *lead-out* gap at the end (or outer edge) of the CD.
70 CD-DA ``Red Book'' Specification
72 One can create and then write or "burn" a CD in the CD-DA format
73 and in this process sometimes one writes the bytes that will appear as
74 a file on a hard disk. This is called a "CD disk image". This
75 plugin may be able to play this file just the same as if it were
78 As there are a number of CD-burning programs, there are a number of
79 CD-image formats. This plugin uses libcdio which currently understands
80 the BIN/CUE disk-image format used by a popular DOS/Window mastering
81 tool and a limited subset of the proprietary and unpublished form at
82 used by the Nero burning software. Over time however perhaps more
83 disk-image formats will be recognized.
85 Audio CD Identification Information (CDDB)
87 The Philips Red-Book specification allows for a Compact Disc to have a
88 Media Catalog Number or MCN written on it, and probably this
89 was how they CD's would be identified. Alas, very few audio discs
90 actually have a Medium Catalog Number on the box, and the way the code
91 is written on CD is *not* uniform across all discs!
93 However the listening community wanted a way to identify an audio CD,
94 so a database of CD information was gathered by basically making a
95 ``signature'' or hash from the number of tracks on a disk and a
96 checksum of the bytes of the tracks. This is referred to as CDDB
97 information. Using the hash the database gives information about the
98 titles of the tracks, the CD album name, year it was published and so
99 on. This plugin has the ability to show this information courtesy of
100 libcddb written by Kris Verbeeck.
103 -----------------------------------------------------------------
105 -----------------------------------------------------------------
107 the vlc CD-DA plugin, identifies itself in the vlc GUI as CDDAX. It
108 also registers itelf to handle a class of MRL's that start with
111 The CDDAX MRL takes the following form:
113 cddax://[path to file or CD-DA device][@[Tt]number]]
115 A simple cddax:// runs the default item: track 1 using the default CD
116 device (perhaps /dev/cdrom). The default default device is
119 It is however also possible to specify both Compact Disc device/filename
120 and item explicitly in the MRL.
122 For example cddax://dev/cdrom2 specifies using device /dev/cdrom2 which
123 might useful if as I have /dev/cdrom is a burner and the /dev/cdrom2
124 is a read-only device. And cddax://test_cdda.cue specifies the
125 "cuesheet" file for a CD-DA image on disk created say with cdrdao.
126 (test_cdda.bin is the corresponding bin file, but using that won't
129 After the optional device name or file name, you can name the track
130 number unit which preceded by a @ or an @ and T in either case. A MRL
131 which ends in an @ is like not adding it at all.
133 Some examples of MRLS are given below. In the examples, we assume the
134 following configuration setting:
136 cdda.default_device:/dev/cdrom
138 cddax:// - track 1 of device: /dev/cdrom
139 cddax://@ - same as above
140 cddax:///dev/cdrom - probably same as above
141 cddax:///dev/cdrom2 - track 1 of /dev/cdrom2
142 cddax:///dev/cdrom2@ - same as above
143 cddax://dev/cdrom2@53 - track 53 from /dev/cdrom2
144 cddax://dev/cdrom2@T53 - Same as above
145 cddax://dev/cdrom2@t53 - Same as above
146 cddax://@2 - track 2 from default device
147 cddax://3 - track 3 from default device
148 cddax:///tmp/ntsc.cue - track 1 from /tmp/ntsc.bin, (a bin/cue
150 cddax:///tmp/ntsc.cue@ - same as above
151 cddax://tmp/ntsc.cue@ - track 1 of tmp/ntsc.bin. NOT the
152 the same as above unless the cwd is /.
153 cddax://ntsc.nrg - track 1 of ntsc.nrg (a nero disk image)
154 cddax://tmp/ntsc.nrg@5 - track 5 of /tmp/ntsc.nrg
157 cddax://@x - x is not a number
159 cddax:/ - must start cddax://
161 -----------------------------------------------------------------
162 Configuration settings:
163 -----------------------------------------------------------------
165 Configuration settings in vlc are generally put in ~/.vlc/vlcrc. A
166 description of the ones specific to CDDAX are listed below.
169 cddax-cddb-title-format
171 This gives a format used in the playlist title string when CDDB is consulted.
172 Similar to the Unix date command, there are format specifiers
173 that start with a percent sign for which various information is filled
174 in dynamically. The control specifiers are given as below
176 %a : The album artist
177 %A : The album information
182 %m : The CD-DA Media Catalog Number (MCN)
183 %n : The number of tracks on the CD
184 %p : The artist/performer/composer in the track
185 %T : The track number
186 %s : Number of seconds in this track
188 %Y : The year 19xx or 20xx
197 This gives a format used in the playlist title string when CDDB is
198 *NOT* consulted. Similar to the Unix date command, there are format
199 specifiers that start with a percent sign for which various
200 information is filled in dynamically. The control specifiers are
204 %m : The CD-DA Media Catalog Number (MCN)
205 %n : The number of tracks on the CD
206 %T : The track number
207 %s : Number of seconds in this track
216 # email given on cddb requests
217 # string, default: me@home
222 # Do we use CDDB to retrieve CD information?
228 # Contact CDDB via the HTTP protocol?
234 # numeric, default: 8880
239 # The server CDDB contacts to get CD info
240 # string, default: freedb.freedb.org
245 An integer (interpreted as a bit mask) which shows additional
246 debugging information see the section below on debugging for more
247 information about the bits that can be set.
252 What to use if no drive specified. If null, we'll scan for CD
253 drives with a CD-DA loaded in it.
257 -----------------------------------------------------------------
258 Troubleshooting Guide
259 -----------------------------------------------------------------
261 This gives higher-level troubleshooting. More detailed and
262 lower-level information is given in the next section DEBUGGING.
264 Problem: I don't get anything playing. I can't even get a playlist of
266 Determination: start at step 1.
268 Problem: Okay, I something plays menu now. But I don't see information
269 about the CD in the playlist.
270 Determination: start at step 5.
272 1. Do you even have the plugin loaded?
274 When you run the vlc GUI, under Settings/Preferences you should see
275 a "plugins" expandable list and under that another "access" list do
276 you see a expandable entry under "access" labeled "cddax"? If so,
279 a) If no "cddax" expandable list, then the CDDAX plugin isn't
280 loaded. Does a shared object exist? The plugin shared object is
281 called "libcddax_plugin.so" It should be in the directory that has
282 ...vlc/access. If this isn't around you need to build and install
285 b) if libcddax_plugin.so is in the filesystem, there might be a
286 loader error; perhaps libcdio is not installed or
287 are the wrong version. Use ldd on the file to see that it has all
288 of the libraries dependencies satisfied. Also you might be able
289 check if there was an attempt to load it by tracking system
290 calls. On Linux and other OS's) "strace" can be used to see if the
291 file gets accessed. On Solaris use "truss".
293 For example on Linux, among the many line of output when I run
294 "strace -e trace=file vlc" I see this along with a lot of other
298 stat64("/usr/local/lib/vlc/access/libcddax_plugin.so", {st_mode=S_IFREG|0755, st_size=238921, ...}) = 0
299 open("/usr/local/lib/vlc/access/libcddax_plugin.so", O_RDONLY) = 5
301 The parameters inside the calls may be different depending on where
302 vlc is installed and what release is installed. If the the file is
305 There may also be a message may under "setup/logs".
307 2. (There plugin was loaded and preferences found). In the "cddax" tab
308 of preference. An important selection is "cddax-device." If this is
309 set to the empty string, CDDAX will try to scan your drives for a
310 suitable device if the driver has the capability to scan for
311 drives. However you can set the device to something of your
312 choosing. On GNU/Linux, this may be "/dev/cdrom" and on Solaris it
313 may be "/vol/dev/aliases/cdrom0". If you set this field, make sure
314 these are correct for your particular setup. For example, I
315 generally play out of the DVD device and this is called /dev/dvd
316 rather than /dev/cdrom.
318 3. (CD-DA Setup devices seems correct and there is a CD in the
319 drive). Bring up the playlist. If you specified only a drive and
320 no track, you should see in the playlist a list of tracks on the CD.
322 a. If not something's wrong like step 2. Another tack may be to try
323 to read a disk image of a CD and thus eliminate any problems with
324 hardware. If this works, then this is a hardware problem.
326 4. (You have a list of entries describing the CD-DA or disk-file of
329 There should be at least one "track" listed for the CD-DA and track
330 1 will end with the digit 1. If there are NO tracks listed then
331 there may be a problem with the that particular medium. So as in
332 step 3 you can try a known good sample and perhaps burn a CD from
335 5. <<Fill in info about CDDB hacking>>
337 -----------------------------------------------------------------
339 -----------------------------------------------------------------
341 **General vlc debugging...
343 Before delving to things specific to this plugin, some preparation may
344 be in order. You'll probably want to configure vlc with "--enable-debug".
345 plugin with debug information. Instead of "make'ing" with "make", use
346 "make debug" and instead of installing using "make install" use "make
349 I use gdb to debug. Debugging vlc with the entire suite of plugins
350 under gdb is slow because it has to read in symbol tables from all the
351 plugins. There are two ways to make loading faster when debugging. The
352 simplest is just to go to the plugin directory and remove unused
353 plugins. Another approach is create a new directory and make
354 (symbolic) links into the complete plugin directory. Another way to
355 speed up gdb loading is to attach the debugger after vlc has started up
358 gdb -p *pid-of-vlc-process*
362 It's a fact of life that this plugin may be in an incomplete state
363 and/or will have bugs. So to facilitate tracking down problems we let
364 you see what's going on dynamically. Various debugging settings will
365 cause output to appear on vlc's plugin log and/or "standard error"
366 (assuming you've run vlc in a way that you can capture this).
368 You think of debug switches as a bit mask, that you specify as an
369 integers the various "bit" values (given in decimal) are listed below.
371 name value description
372 ---------- ----- -----------
373 META 1 Meta information
374 EVENT 2 Trace keyboard events
376 EXT 8 Calls from external routines
379 SEEK 64 Seeks to set location
380 CDIO 128 Debugging from CDIO library routines
381 CDDB 256 debugging from CDDB library routines
385 The tool cd-info from libcdio can be used to show the contents and
386 analyze the contents of a CD.
388 The tool cd-read from libcdio can be used to show the sectors of
389 the CD or CD image or extract sectors.
391 $Id: intf-cdda.txt,v 1.4 2003/12/18 12:35:26 rocky Exp $