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.
170 This gives a format used in the playlist title string.
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 **
190 ** Only available if CDDB is enabled
192 The default if CDDB is enabled is
200 # email given on cddb requests
201 # string, default: me@home
206 # Do we use CDDB to retrieve CD information?
212 # Contact CDDB via the HTTP protocol?
218 # numeric, default: 8880
223 # The server CDDB contacts to get CD info
224 # string, default: freedb.freedb.org
229 An integer (interpreted as a bit mask) which shows additional
230 debugging information see the section below on debugging for more
231 information about the bits that can be set.
236 What to use if no drive specified. If null, we'll scan for CD
237 drives with a CD-DA loaded in it.
241 -----------------------------------------------------------------
242 Troubleshooting Guide
243 -----------------------------------------------------------------
245 This gives higher-level troubleshooting. More detailed and
246 lower-level information is given in the next section DEBUGGING.
248 Problem: I don't get anything playing. I can't even get a playlist of
250 Determination: start at step 1.
252 Problem: Okay, I something plays menu now. But I don't see information
253 about the CD in the playlist.
254 Determination: start at step 5.
256 1. Do you even have the plugin loaded?
258 When you run the vlc GUI, under Settings/Preferences you should see
259 a "plugins" expandable list and under that another "access" list do
260 you see a expandalbe entry under "access" labeled "cddax"? If so,
263 a) If no "cddax" expandable list, thent the CDDAX plugin isn't
264 loaded. Does a shared object exist? The plugin shared object is
265 called "libcddax_plugin.so" It should be in the directory that has
266 ...vlc/access. If this isn't around you need to build and install
269 b) if libcddax_plugin.so is in the fileystem, there might be a
270 loader error; perhaps libcdio is not installed or
271 are the wrong version. Use ldd on the file to see that it has all
272 of the libraries dependencies satisfied. Also you might be able
273 check if there was an attempt to load it by tracking system
274 calls. On Linux and other OS's) "strace" can be used to see if the
275 file gets accessed. On Solaris use "truss".
277 For example on Linux, amonst the many line of output when I run
278 "strace -e trace=file vlc" I see this amongst lots of other
282 stat64("/usr/local/lib/vlc/access/libcddax_plugin.so", {st_mode=S_IFREG|0755, st_size=238921, ...}) = 0
283 open("/usr/local/lib/vlc/access/libcddax_plugin.so", O_RDONLY) = 5
285 The parameters inside the calls may be different depending on where
286 vlc is installed and what release is installed. If the the file is
289 There may also be a message may under "setup/logs".
291 2. (There plugin was loaded and preferences found). In the "cddax" tab
292 of preference. An important selection is "cddax-device." If this is
293 set to the empty string, CDDAX will try to scan your drives for a
294 suitable device if the driver has the capability to scan for
295 drives. However you can set the device to something of your
296 choosing. On GNU/Linux, this may be "/dev/cdrom" and on Solaris it
297 may be "/vol/dev/aliases/cdrom0". If you set this field, make sure
298 these are correct for your particular setup. For example, I
299 generally play out of the DVD device and this is called /dev/dvd
300 rather than /dev/cdrom.
302 3. (CD-DA Setup devices seems correct and there is a CD in the
303 drive). Bring up the playlist. If you specified only a drive and
304 no track, you should see in the playlist a list of tracks on the CD.
306 a. If not something's wrong like step 2. Another tack may be to try
307 to read a disk image of a CD and thus elimate any problems with
308 hardware. If this works, then this is a hardware problem.
310 4. (You have a list of entries describing the CD-DA or disk-file of
313 There should be at least one "track" listed for the CD-DA and track
314 1 will end with the digit 1. If there are NO tracks listed then
315 there may be a problem with the that particular medium. So as in
316 step 3 you can try a known good sample and perhaps burn a CD from
319 5. <<Fill in info about CDDB hacking>>
321 -----------------------------------------------------------------
323 -----------------------------------------------------------------
325 **General vlc debugging...
327 Before delving to things specific to this plugin, some preparation may
328 be in order. You'll probably want to configure vlc with "--enable-debug".
329 plugin with debug information. Instead of "make'ing" with "make", use
330 "make debug" and instead of installing using "make install" use "make
333 I use gdb to debug. Debugging vlc with the entire suite of plugins
334 under gdb is slow because it has to read in symbol tables from all the
335 plugins. There are two ways to make loading faster when debugging. The
336 simplest is just to go to the plugin directory and remove unused
337 plugins. Another approach is create a new directory and make
338 (symbolic) links into the complete plugin directory. Another way to
339 speed up gdb loading is to attach the debugger after vlc has started up
342 gdb -p *pid-of-vlc-process*
346 It's a fact of life that this plugin may be in an incomplete state
347 and/or will have bugs. So to facilitate tracking down problems we let
348 you see what's going on dynamically. Various debugging settings will
349 cause output to appear on vlc's plugin log and/or "standard error"
350 (assuming you've run vlc in a way that you can capture this).
352 You think of debug switches as a bit mask, that you specifiy as an
353 integers the various "bit" values (given in decimal) are listed below.
355 name value description
356 ---------- ----- -----------
357 META 1 Meta information
358 EVENT 2 Trace keyboard events
360 EXT 8 Calls from external routines
363 SEEK 64 Seeks to set location
364 CDIO 128 Debugging from CDIO
365 CDDB 256 CDDB debugging
369 The tool cd-info from libcdio can be used to show the contents and
370 analyze the contents of a CD.
372 The tool cd-read from libcdio can be used to show the sectors of
373 the CD or CD image or extract sectors.
375 $Id: intf-cdda.txt,v 1.2 2003/12/01 04:05:29 rocky Exp $