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
32 - Media information is shown using CDDB
34 - Will scan for a CD-ROM drive with a CD-DA loaded in it.
36 -----------------------------------------------------------------
38 -----------------------------------------------------------------
40 Much of what I write in this section can be found elsewhere. See for
41 example http://www.pctechguide.com/08cd-rom.htm, or the libcdio
44 The Sony and Philips Corporations invented and Compact Disc (CD) in
45 the early 1980s. The specifications for the layout is often referred
46 to by the color of the cover on the specification.
48 The first type of CD specification that was produced was the Compact
49 Disc Digital Audio (CD-DA) or just plain ``audio CD'' and is commonly
50 called the ``Red Book''. Music CD's are recorded in this format which
51 basically allows for around 74 minutes of audio per disc and for that
52 information to be split up into *tracks*. Tracks are broken up into
53 "sectors" and each sector contains 2,352 bytes. To play one 44.1 kHz
54 CD-DA sampled audio second, 75 sectors are used.
56 A CD can hold at most 99 such tracks. Between the tracks CD
57 specifications require a ``2 second'' in gap (called a @term{lead-in
58 gap}. This is unused space with no ``data'' similar to the space
59 between tracks on an old phonograph. The word ``second'' here really
60 refers to a measure of space and not really necessarily an amount of
61 time. However in the special case here where you have an audio CD, the
62 amount of time to play a gap of this size will take 2 seconds. Note
63 this is independent of how fast your CD drive can read a sector.
65 The beginning (or inner edge) of the CD is supposed to have a ``2
66 second'' lead-in gap and there is supposed to be another ``2 second''
67 *lead-out* gap at the end (or outer edge) of the CD.
69 CD-DA ``Red Book'' Specification
71 One can create and then write or "burn" a CD in the CD-DA format
72 and in this process sometimes one writes the bytes that will appear as
73 a file on a hard disk. This is called a "CD disk image". This
74 plugin may be able to play this file just the same as if it were
77 As there are a number of CD-burning programs, there are a number of
78 CD-image formats. This plugin uses libcdio which currently understands
79 the BIN/CUE disk-image format used by a popular DOS/Window mastering
80 tool and a limited subset of the proprietary and unpublished form at
81 used by the Nero burning software. Over time however perhaps more
82 disk-image formats will be recognized.
84 Audio CD Identification Information (CDDB)
86 The Philips Red-Book specification allows for a Compact Disc to have a
87 Media Catalog Number or MCN written on it, and probably this
88 was how they CD's would be identified. Alas, very few audio discs
89 actually have a Medium Catalog Number on the box, and the way the code
90 is written on CD is *not* uniform across all discs!
92 However the listening community wanted a way to identify an audio CD,
93 so a database of CD information was gathered by basically making a
94 ``signature'' or hash from the number of tracks on a disk and a
95 checksum of the bytes of the tracks. This is referred to as CDDB
96 information. Using the hash the database gives information about the
97 titles of the tracks, the CD album name, year it was published and so
98 on. This plugin has the ability to show this information courtesy of
99 libcddb written by Kris Verbeeck.
102 -----------------------------------------------------------------
104 -----------------------------------------------------------------
106 the vlc CD-DA plugin, identifies itself in the vlc GUI as CDDAX. It
107 also registers itelf to handle a class of MRL's that start with
110 The CDDAX MRL takes the following form:
112 cddax://[path to file or CD-DA device][@[Tt]number]]
114 A simple cddax:// runs the default item: track 1 using the default CD
115 device (perhaps /dev/cdrom). The default default device is
118 It is however also possible to specify both Compact Disc device/filename
119 and item explicitly in the MRL.
121 For example cddax://dev/cdrom2 specifies using device /dev/cdrom2 which
122 might useful if as I have /dev/cdrom is a burner and the /dev/cdrom2
123 is a read-only device. And cddax://test_cdda.cue specifies the
124 "cuesheet" file for a CD-DA image on disk created say with cdrdao.
125 (test_cdda.bin is the corresponding bin file, but using that won't
128 After the optional device name or file name, you can name the track
129 number unit which preceded by a @ or an @ and T in either case. A MRL
130 which ends in an @ is like not adding it at all.
132 Some examples of MRLS are given below. In the examples, we assume the
133 following configuration setting:
135 cdda.default_device:/dev/cdrom
137 cddax:// - track 1 of device: /dev/cdrom
138 cddax://@ - same as above
139 cddax:///dev/cdrom - probably same as above
140 cddax:///dev/cdrom2 - track 1 of /dev/cdrom2
141 cddax:///dev/cdrom2@ - same as above
142 cddax://dev/cdrom2@53 - track 53 from /dev/cdrom2
143 cddax://dev/cdrom2@T53 - Same as above
144 cddax://dev/cdrom2@t53 - Same as above
145 cddax://@2 - track 2 from default device
146 cddax://3 - track 3 from default device
147 cddax:///tmp/ntsc.cue - track 1 from /tmp/ntsc.bin, (a bin/cue
149 cddax:///tmp/ntsc.cue@ - same as above
150 cddax://tmp/ntsc.cue@ - track 1 of tmp/ntsc.bin. NOT the
151 the same as above unless the cwd is /.
152 cddax://ntsc.nrg - track 1 of ntsc.nrg (a nero disk image)
153 cddax://tmp/ntsc.nrg@5 - track 5 of /tmp/ntsc.nrg
156 cddax://@x - x is not a number
158 cddax:/ - must start cddax://
160 -----------------------------------------------------------------
161 Configuration settings:
162 -----------------------------------------------------------------
164 Configuration settings in vlc are generally put in ~/.vlc/vlcrc. A
165 description of the ones specific to CDDAX are listed below.
168 cddax-cddb-title-format
170 This gives a format used in the playlist title string when CDDB is consulted.
171 Similar to the Unix date command, there are format specifiers
172 that start with a percent sign for which various information is filled
173 in dynamically. The control specifiers are given as below
175 %a : The album artist
176 %A : The album information
181 %m : The CD-DA Media Catalog Number (MCN)
182 %n : The number of tracks on the CD
183 %p : The artist/performer/composer in the track
184 %T : The track number
185 %s : Number of seconds in this track
187 %Y : The year 19xx or 20xx
196 This gives a format used in the playlist title string when CDDB is
197 *NOT* consulted. Similar to the Unix date command, there are format
198 specifiers that start with a percent sign for which various
199 information is filled in dynamically. The control specifiers are
203 %m : The CD-DA Media Catalog Number (MCN)
204 %n : The number of tracks on the CD
205 %T : The track number
206 %s : Number of seconds in this track
215 # email given on cddb requests
216 # string, default: me@home
221 # Do we use CDDB to retrieve CD information?
227 # Contact CDDB via the HTTP protocol?
233 # numeric, default: 8880
238 # The server CDDB contacts to get CD info
239 # string, default: freedb.freedb.org
244 An integer (interpreted as a bit mask) which shows additional
245 debugging information see the section below on debugging for more
246 information about the bits that can be set.
251 What to use if no drive specified. If null, we'll scan for CD
252 drives with a CD-DA loaded in it.
256 -----------------------------------------------------------------
257 Troubleshooting Guide
258 -----------------------------------------------------------------
260 This gives higher-level troubleshooting. More detailed and
261 lower-level information is given in the next section DEBUGGING.
263 Problem: I don't get anything playing. I can't even get a playlist of
265 Determination: start at step 1.
267 Problem: Okay, I something plays menu now. But I don't see information
268 about the CD in the playlist.
269 Determination: start at step 5.
271 1. Do you even have the plugin loaded?
273 When you run the vlc GUI, under Settings/Preferences you should see
274 a "plugins" expandable list and under that another "access" list do
275 you see a expandalbe entry under "access" labeled "cddax"? If so,
278 a) If no "cddax" expandable list, thent the CDDAX plugin isn't
279 loaded. Does a shared object exist? The plugin shared object is
280 called "libcddax_plugin.so" It should be in the directory that has
281 ...vlc/access. If this isn't around you need to build and install
284 b) if libcddax_plugin.so is in the fileystem, there might be a
285 loader error; perhaps libcdio is not installed or
286 are the wrong version. Use ldd on the file to see that it has all
287 of the libraries dependencies satisfied. Also you might be able
288 check if there was an attempt to load it by tracking system
289 calls. On Linux and other OS's) "strace" can be used to see if the
290 file gets accessed. On Solaris use "truss".
292 For example on Linux, amonst the many line of output when I run
293 "strace -e trace=file vlc" I see this amongst lots of other
297 stat64("/usr/local/lib/vlc/access/libcddax_plugin.so", {st_mode=S_IFREG|0755, st_size=238921, ...}) = 0
298 open("/usr/local/lib/vlc/access/libcddax_plugin.so", O_RDONLY) = 5
300 The parameters inside the calls may be different depending on where
301 vlc is installed and what release is installed. If the the file is
304 There may also be a message may under "setup/logs".
306 2. (There plugin was loaded and preferences found). In the "cddax" tab
307 of preference. An important selection is "cddax-device." If this is
308 set to the empty string, CDDAX will try to scan your drives for a
309 suitable device if the driver has the capability to scan for
310 drives. However you can set the device to something of your
311 choosing. On GNU/Linux, this may be "/dev/cdrom" and on Solaris it
312 may be "/vol/dev/aliases/cdrom0". If you set this field, make sure
313 these are correct for your particular setup. For example, I
314 generally play out of the DVD device and this is called /dev/dvd
315 rather than /dev/cdrom.
317 3. (CD-DA Setup devices seems correct and there is a CD in the
318 drive). Bring up the playlist. If you specified only a drive and
319 no track, you should see in the playlist a list of tracks on the CD.
321 a. If not something's wrong like step 2. Another tack may be to try
322 to read a disk image of a CD and thus elimate any problems with
323 hardware. If this works, then this is a hardware problem.
325 4. (You have a list of entries describing the CD-DA or disk-file of
328 There should be at least one "track" listed for the CD-DA and track
329 1 will end with the digit 1. If there are NO tracks listed then
330 there may be a problem with the that particular medium. So as in
331 step 3 you can try a known good sample and perhaps burn a CD from
334 5. <<Fill in info about CDDB hacking>>
336 -----------------------------------------------------------------
338 -----------------------------------------------------------------
340 **General vlc debugging...
342 Before delving to things specific to this plugin, some preparation may
343 be in order. You'll probably want to configure vlc with "--enable-debug".
344 plugin with debug information. Instead of "make'ing" with "make", use
345 "make debug" and instead of installing using "make install" use "make
348 I use gdb to debug. Debugging vlc with the entire suite of plugins
349 under gdb is slow because it has to read in symbol tables from all the
350 plugins. There are two ways to make loading faster when debugging. The
351 simplest is just to go to the plugin directory and remove unused
352 plugins. Another approach is create a new directory and make
353 (symbolic) links into the complete plugin directory. Another way to
354 speed up gdb loading is to attach the debugger after vlc has started up
357 gdb -p *pid-of-vlc-process*
361 It's a fact of life that this plugin may be in an incomplete state
362 and/or will have bugs. So to facilitate tracking down problems we let
363 you see what's going on dynamically. Various debugging settings will
364 cause output to appear on vlc's plugin log and/or "standard error"
365 (assuming you've run vlc in a way that you can capture this).
367 You think of debug switches as a bit mask, that you specifiy as an
368 integers the various "bit" values (given in decimal) are listed below.
370 name value description
371 ---------- ----- -----------
372 META 1 Meta information
373 EVENT 2 Trace keyboard events
375 EXT 8 Calls from external routines
378 SEEK 64 Seeks to set location
379 CDIO 128 Debugging from CDIO
380 CDDB 256 CDDB debugging
384 The tool cd-info from libcdio can be used to show the contents and
385 analyze the contents of a CD.
387 The tool cd-read from libcdio can be used to show the sectors of
388 the CD or CD image or extract sectors.
390 $Id: intf-cdda.txt,v 1.3 2003/12/02 03:33:22 rocky Exp $