comparison DOCS/cd-dvd.html @ 8554:559217c44624

Reviewed and reworked (again), added some information about SCSI CD-ROMs.
author diego
date Tue, 24 Dec 2002 18:28:11 +0000
parents 2222dd8d8b18
children 553653787cea
comparison
equal deleted inserted replaced
8553:d952b097c720 8554:559217c44624
17 <P>Modern CD-ROM drives can attain very high head speeds, yet some CD-ROM drives 17 <P>Modern CD-ROM drives can attain very high head speeds, yet some CD-ROM drives
18 are capable of running at reduced speeds. There are several reasons that might 18 are capable of running at reduced speeds. There are several reasons that might
19 make you consider changing the speed of a CD-ROM drive:</P> 19 make you consider changing the speed of a CD-ROM drive:</P>
20 20
21 <UL> 21 <UL>
22 <LI>There have been reports of read errors at these high speeds, especially 22 <LI>There have been reports of read errors at high speeds, especially
23 with badly pressed CD-ROMs. Reducing the speed can prevent data loss under 23 with badly pressed CD-ROMs. Reducing the speed can prevent data loss under
24 these circumstances.</LI> 24 these circumstances.</LI>
25 <LI>Many CD-ROM drives are annoyingly loud, a lower speed may reduce the 25 <LI>Many CD-ROM drives are annoyingly loud, a lower speed may reduce the
26 noise.</LI> 26 noise.</LI>
27 </UL> 27 </UL>
28 28
29 <P>You can reduce the drive speed with hdparm or a program called setcd. 29 <P>You can reduce the speed of IDE CD-ROM drives with <CODE>hdparm</CODE> or a
30 It works like this:</P> 30 program called <CODE>setcd</CODE>. It works like this:</P>
31 31
32 <P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>hdparm -E [speed] [cdrom device]</CODE></P> 32 <P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>hdparm -E [speed] [cdrom device]</CODE></P>
33 33
34 <P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>setcd -x [speed] [cdrom device]</CODE></P> 34 <P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>setcd -x [speed] [cdrom device]</CODE></P>
35 35
42 <P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>echo file_readahead:2000000 &gt; /proc/ide/[cdrom device]/settings</CODE></P> 42 <P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>echo file_readahead:2000000 &gt; /proc/ide/[cdrom device]/settings</CODE></P>
43 43
44 <P>This sets prefetched file reading to 2MB, which helps with scratched CD-ROMs. 44 <P>This sets prefetched file reading to 2MB, which helps with scratched CD-ROMs.
45 If you set it to too high, the drive will continuously spin up and down, and 45 If you set it to too high, the drive will continuously spin up and down, and
46 will dramatically decrease the performance. 46 will dramatically decrease the performance.
47 It is recommended that you also tune your CD-ROM drive with hdparm:</P> 47 It is recommended that you also tune your CD-ROM drive with
48 <CODE>hdparm</CODE>:</P>
48 49
49 <P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>hdparm -d1 -a8 -u1 (cdrom device)</CODE></P> 50 <P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>hdparm -d1 -a8 -u1 (cdrom device)</CODE></P>
50 51
51 <P>This enables DMA access, read-ahead, and IRQ unmasking (read the hdparm man 52 <P>This enables DMA access, read-ahead, and IRQ unmasking (read the
52 page for a detailed explanation).</P> 53 <CODE>hdparm</CODE> man page for a detailed explanation).</P>
53 54
54 <P>Please refer to "<CODE>/proc/ide/[cdrom device]/settings</CODE>" for 55 <P>Please refer to "<CODE>/proc/ide/[cdrom device]/settings</CODE>" for
55 fine-tuning your CD-ROM.</P> 56 fine-tuning your CD-ROM.</P>
57
58 <P>SCSI drives do not have a uniform way of setting these parameters (Do you
59 know one? Tell us!) There is a tool that works for
60 <A HREF="http://das.ist.org/~georg/">Plextor SCSI drives</A>.</P>
56 61
57 <P>FreeBSD:</P> 62 <P>FreeBSD:</P>
58 63
59 <P>&nbsp;&nbsp;&nbsp;&nbsp;Speed: <CODE>cdcontrol [-f device] speed [speed]</CODE></P> 64 <P>&nbsp;&nbsp;&nbsp;&nbsp;Speed: <CODE>cdcontrol [-f device] speed [speed]</CODE></P>
60 <P>&nbsp;&nbsp;&nbsp;&nbsp;DMA: <CODE>sysctl hw.ata.atapi_dma=1</CODE></P> 65 <P>&nbsp;&nbsp;&nbsp;&nbsp;DMA: <CODE>sysctl hw.ata.atapi_dma=1</CODE></P>
68 73
69 <P>MPlayer uses <CODE>libdvdread</CODE> and <CODE>libdvdcss</CODE> for 74 <P>MPlayer uses <CODE>libdvdread</CODE> and <CODE>libdvdcss</CODE> for
70 DVD decryption and playback. These two libraries are contained in the 75 DVD decryption and playback. These two libraries are contained in the
71 <CODE>libmpdvdkit2/</CODE> subdirectory of the MPlayer source tree, you 76 <CODE>libmpdvdkit2/</CODE> subdirectory of the MPlayer source tree, you
72 do not have to install them separately. We opted for this solution because 77 do not have to install them separately. We opted for this solution because
73 we had to fix a libdvdread bug, and apply a patch which adds <B>cracked CSS 78 we had to fix a <CODE>libdvdread</CODE> bug and apply a patch which adds
74 keys caching support</B> to libdvdcss. This results in a large speed increase 79 <B>cracked CSS keys caching support</B> to libdvdcss. This results in a large
75 because the keys do not have to be cracked every time before playing.</P> 80 speed increase because the keys do not have to be cracked every time before
81 playing.</P>
76 82
77 <P>MPlayer can also use system-wide <CODE>libdvdread</CODE> and 83 <P>MPlayer can also use system-wide <CODE>libdvdread</CODE> and
78 <CODE>libdvdcss</CODE> libraries, but this solution is <B>not</B> recommended, 84 <CODE>libdvdcss</CODE> libraries, but this solution is <B>not</B> recommended,
79 as it can result in bugs, library incompatibilities, and slower speed.</P> 85 as it can result in bugs, library incompatibilities and slower speed.</P>
80 86
81 <H4>DVD Navigation support (dvdnav)</H4> 87 <H4>DVD Navigation support (dvdnav)</H4>
82 88
83 <P>Support for DVD navigation via <CODE>dvdnav</CODE> was being worked on, but 89 <P>Support for DVD navigation via <CODE>dvdnav</CODE> was being worked on, but
84 it was never finished properly and is therefore <B>not recommended</B>!</P> 90 it was never finished properly and it is currently unmaintained. Who knows, it
91 might even compile.</P>
85 92
86 <H4>Old-style DVD support - OPTIONAL</H4> 93 <H4>Old-style DVD support - OPTIONAL</H4>
87 94
88 <P>Useful if you want to play encoded VOBs from <B>hard disk</B>. Compile and 95 <P>Useful if you want to play encoded VOBs from <B>hard disk</B>. Compile and
89 install <B>libcss</B> 0.0.1 (not newer) for this (If MPlayer fails to 96 install <B>libcss</B> 0.0.1 (not newer) for this (If MPlayer fails to
91 you need to be root, use a suid root MPlayer binary or let MPlayer call the 98 you need to be root, use a suid root MPlayer binary or let MPlayer call the
92 suid-root fibmap_mplayer wrapper program.</P> 99 suid-root fibmap_mplayer wrapper program.</P>
93 100
94 <H4>DVD structure</H4> 101 <H4>DVD structure</H4>
95 102
96 <P>DVD disks use all 2048 b/s sectors with ecc/crc. They usually have an UDF 103 <P>DVD disks have 2048 bytes per sector with ECC/CRC. They usually have an UDF
97 filesystem on a single track, containing various files (small .IFO and .BUK 104 filesystem on a single track, containing various files (small .IFO and .BUK
98 files and big (1GB) .VOB files). They are real files and can be copied/played 105 files and big (1GB) .VOB files). They are real files and can be copied/played
99 from a mounted file system of an unencrypted DVD.</P> 106 from the mounted filesystem of an unencrypted DVD.</P>
100 107
101 <P>The .IFO files contain the movie navigation informations (chapter/title/angle 108 <P>The .IFO files contain the movie navigation information (chapter/title/angle
102 map, language table, etc) and is needed to read and interpret the .VOB content 109 map, language table, etc) and are needed to read and interpret the .VOB
103 (movie). The .BUK files are backups of them. They use <B>sectors</B> everywhere, 110 content (movie). The .BUK files are backups of them. They use <B>sectors</B>
104 so you need to use raw addressing of sectors of the disc to implement DVD 111 everywhere, so you need to use raw addressing of sectors of the disc to
105 navigation. It's also needed to decrypt the content.</P> 112 implement DVD navigation or decrypt the content.</P>
106 113
107 <P>The whole old-style DVD support with libcss needs therefore a mounted DVD 114 <P>The whole old-style DVD support with <CODE>libcss</CODE> therefore needs a mounted DVD
108 filesystem and a raw sector-based access to the device. Unfortunately you must 115 filesystem and raw sector-based access to the device. Unfortunately you must
109 be root (under Linux) to get the sector address of a file. You got the 116 (under Linux) be root to get the sector address of a file. You have the
110 following choices:</P> 117 following choices:</P>
111 118
112 <UL> 119 <UL>
113 <LI>Force the user to be root or use a suid-root mplayer binary.</LI> 120 <LI>Be root or use a suid-root mplayer binary.</LI>
114 <LI>Let MPlayer call the suid-root fibmap_mplayer wrapper program to access 121 <LI>Let MPlayer call the suid-root fibmap_mplayer wrapper program to access
115 the DVD (used in the old-style DVD playback over libcss).</LI> 122 the DVD (used in the old-style DVD playback over <CODE>libcss</CODE>).</LI>
116 <LI>Don't use the kernel's filesystem driver at all and re-implement it in 123 <LI>Don't use the kernel's filesystem driver at all and reimplement it in
117 userspace. libdvdread 0.9.x and libmpdvdkit does this (New-style DVD 124 userspace. <CODE>libdvdread</CODE> 0.9.x and <CODE>libmpdvdkit</CODE> do this (new-style DVD
118 support). The kernel udf filesystem drivers isn't needed as they already 125 support). The kernel UDF filesystem driver is not needed as they already
119 have their own, built-in udf fs driver. Also the dvd, doesn't needs to be 126 have their own builtin UDF filesystem driver. Also the DVD does not have to
120 mounted as only the raw sector-based access is used.</LI> 127 be mounted as only the raw sector-based access is used.</LI>
121 </UL> 128 </UL>
122 129
123 <P>Sometimes /dev/dvd can't be read by users, so the libdvdread authors 130 <P>Sometimes <CODE>/dev/dvd</CODE> cannot be read by users, so the <CODE>libdvdread</CODE>
124 implemented an emulation layer which transfers sector addresses to 131 authors implemented an emulation layer which transfers sector addresses to
125 filenames+offsets, to emulate raw access on the top of a mounted filesystem 132 filenames+offsets, to emulate raw access on top of a mounted filesystem
126 or even on a hard disk.</P> 133 or even on a hard disk.</P>
127 134
128 <P>libdvdread even accepts the mountpoint instead of the device name for raw 135 <P><CODE>libdvdread</CODE> even accepts the mountpoint instead of the device name for raw
129 access and checks in <CODE>/proc/mounts</CODE> to get the device name. It was 136 access and checks <CODE>/proc/mounts</CODE> to get the device name. It was
130 developed for Solaris, where device names are dynamically allocated.</P> 137 developed for Solaris, where device names are dynamically allocated.</P>
131 138
132 <P>The default DVD device is <CODE>/dev/dvd</CODE>. If your setup differs, 139 <P>The default DVD device is <CODE>/dev/dvd</CODE>. If your setup differs,
133 make a symlink, or specify the correct device on the command line with the 140 make a symlink, or specify the correct device on the command line with the
134 <CODE>-dvd-device</CODE> option.</P> 141 <CODE>-dvd-device</CODE> option.</P>
135 142
136 <H4>DVD authentication</H4> 143 <H4>DVD authentication</H4>
137 144
138 <P>The authentication and decryption method of the new-style DVD support is done 145 <P>The authentication and decryption method of the new-style DVD support is done
139 using a patched libdvdcss (see above). The method can be specified over the 146 using a patched <CODE>libdvdcss</CODE> (see above). The method can be specified through the
140 environment variable <CODE>DVDCSS_METHOD</CODE> which can be set to 147 environment variable <CODE>DVDCSS_METHOD</CODE>, which can be set to
141 <CODE>key</CODE>, <CODE>disk</CODE> or <CODE>title</CODE>.</P> 148 <CODE>key</CODE>, <CODE>disk</CODE> or <CODE>title</CODE>.</P>
142 149
143 <P>If nothing is specified it tries the following methods 150 <P>If nothing is specified it tries the following methods
144 (default: key, title request):</P> 151 (default: key, title request):</P>
145 152
147 <LI><B>bus key:</B> This key is negotiated during authentication (a long mix 154 <LI><B>bus key:</B> This key is negotiated during authentication (a long mix
148 of ioctls and various key exchanges, crypto stuff) and is used to encrypt 155 of ioctls and various key exchanges, crypto stuff) and is used to encrypt
149 the title and disk keys before sending them over the unprotected bus 156 the title and disk keys before sending them over the unprotected bus
150 (to prevent eavesdropping). The bus key is needed to get and predecrypt the 157 (to prevent eavesdropping). The bus key is needed to get and predecrypt the
151 crypted disk key.</LI> 158 crypted disk key.</LI>
152 <LI><B>cached key:</B> MPlayer looks for eventually already cracked 159 <LI><B>cached key:</B> MPlayer looks for already cracked
153 title keys which are stored in the <CODE>~/.mplayer/DVDKeys</CODE> directory 160 title keys which are stored in the <CODE>~/.mplayer/DVDKeys</CODE> directory
154 (fast ;).</LI> 161 (fast ;).</LI>
155 <LI><B>key:</B> If no cached key is available, MPlayer tries to 162 <LI><B>key:</B> If no cached key is available, MPlayer tries to
156 decrypt the disk key with a set of included player keys.</LI> 163 decrypt the disk key with a set of included player keys.</LI>
157 <LI><B>disk:</B> If the key method fails (e.g. no included player keys), 164 <LI><B>disk:</B> If the key method fails (e.g. no included player keys),
158 MPlayer will crack the disk key using a brute force algorithm. 165 MPlayer will crack the disk key using a brute force algorithm.
159 This process is CPU intensive and requires 64 MB of memory (16M 32bit 166 This process is CPU intensive and requires 64 MB of memory (16M 32Bit
160 entries hash table) to store temporary data. This method should always 167 entries hash table) to store temporary data. This method should always
161 work (slow).</LI> 168 work (slow).</LI>
162 <LI><B>title request:</B> With the disk key MPlayer requests the crypted title 169 <LI><B>title request:</B> With the disk key MPlayer requests the crypted title
163 keys, which are inside <I>hidden sectors</I> using <CODE>ioctl()</CODE>. 170 keys, which are inside <I>hidden sectors</I> using <CODE>ioctl()</CODE>.
164 The region protection of RPC-2 drives is performed in this step and may 171 The region protection of RPC-2 drives is performed in this step and may
165 fail on such drives. If it succeeds, the title keys will be decrypted with 172 fail on such drives. If it succeeds, the title keys will be decrypted with
166 the bus and disk key.</LI> 173 the bus and disk key.</LI>
167 <LI><B>title:</B> This method is used if the title request failed and does 174 <LI><B>title:</B> This method is used if the title request failed and does
168 not rely on any key exchange with the DVD drive. It uses a crypto attack to 175 not rely on any key exchange with the DVD drive. It uses a crypto attack to
169 guess the title key directly (by finding a repeating pattern in the 176 guess the title key directly (by finding a repeating pattern in the
170 decrypted VOB content and guessing that that the plain text for first 177 decrypted VOB content and guessing that the plain text corresponding to the
171 encrypted bytes are a continuation of that pattern). 178 first encrypted bytes is a continuation of that pattern).
172 The method is also known as "known plaintext attack" or "DeCSSPlus". 179 The method is also known as "known plaintext attack" or "DeCSSPlus".
173 In rare cases this may fail because there is not enough encrypted data on 180 In rare cases this may fail because there is not enough encrypted data on
174 the disk to perform a statistical attack or because the key changes in the 181 the disk to perform a statistical attack or because the key changes in the
175 middle of a title. On the other hand it is the only way to decrypt a DVD 182 middle of a title. This method is the only way to decrypt a DVD stored on a
176 stored on a hard disk or a DVD with the wrong region on an RPC2 drive 183 hard disk or a DVD with the wrong region on an RPC2 drive (slow).</LI>
177 (slow).</LI>
178 </OL> 184 </OL>
179 185
180 <P>RPC-1 DVD drives only protect region settings over software DVD players. 186 <P>RPC-1 DVD drives only protect region settings through software.
181 RPC-2 drives have a hardware protection that allows 5 changes only. It might 187 RPC-2 drives have a hardware protection that allows 5 changes only. It might
182 be needed/recommended to upgrade the firmware to RPC-1 if you have a RPC-2 DVD 188 be needed/recommended to upgrade the firmware to RPC-1 if you have a RPC-2 DVD
183 drive. Firmware upgrades can be found 189 drive. Firmware upgrades can be found on this
184 <A HREF="http://perso.club-internet.fr/farzeno/firmware/">here</A>. If there is 190 <A HREF="http://www.firmware-flash.com">firmware page</A>. If there is
185 no firmware upgrade available for your device, use the 191 no firmware upgrade available for your device, use the
186 <A HREF="http://www.linuxtv.org/download/dvd/dvd_disc_20000215.tar.gz">regionset 192 <A HREF="http://www.linuxtv.org/download/dvd/dvd_disc_20000215.tar.gz">regionset
187 tool</A> to set the region code of your DVD-drive (under Linux). 193 tool</A> to set the region code of your DVD drive (under Linux).
188 <B>Warning:</B> You can only set the region 5 times.</P> 194 <B>Warning:</B> You can only set the region 5 times.</P>
189 195
190 196
191 <H2><A NAME="vcd">4.3 VCD playback</A></H2> 197 <H2><A NAME="vcd">4.3 VCD playback</A></H2>
192 198
193 <P>For the complete list of available options, please read the man page. 199 <P>For the complete list of available options, please read the man page.
194 The Syntax for a standard Video CD (VCD) is as followed: 200 The Syntax for a standard Video CD (VCD) is as follows:</P>
195 <CODE>mplayer -vcd &lt;track&gt; [-cdrom-device &lt;device&gt;]</CODE>.<BR> 201
196 Example: <CODE>mplayer -vcd 2 -cdrom-device /dev/hdc</CODE></P> 202 <P><CODE>mplayer -vcd &lt;track&gt; [-cdrom-device &lt;device&gt;]</CODE></P>
203
204 <P>Example: <CODE>mplayer -vcd 2 -cdrom-device /dev/hdc</CODE></P>
205
206 <P>The default VCD device is <CODE>/dev/cdrom</CODE>. If your setup differs,
207 make a symlink or specify the correct device on the command line with the
208 <CODE>-cdrom-device</CODE> option.</P>
209
210 <P><B>Note:</B> At least Plextor and some Toshiba SCSI CD-ROM drives have
211 horrible performance reading VCDs. This is because the the CDROMREADRAW ioctl
212 is not fully implemented for these drives. If you have some knowledge of SCSI
213 programming, please <A HREF="tech/patches.txt">help us</A> implement generic
214 SCSI support for VCDs.</P>
197 215
198 <H4>VCD structure</H4> 216 <H4>VCD structure</H4>
199 217
200 <P>VCD disks consists of 2 or more track:</P> 218 <P>VCD disks consist of one or more tracks:</P>
201 219
202 <UL> 220 <UL>
203 <LI>The first track is a few MB 2048 bytes/sector data track, with an iso9660 221 <LI>The first track is a small 2048 bytes/sector data track with an iso9660
204 filesystem, usualy containing win32 VCD player programs and maybe other infos 222 filesystem, usually containing Windows VCD player programs and maybe other
205 (jpegs, text, etc).</LI> 223 information (images, text, etc).</LI>
206 <LI>The second and other tracks are raw 2324 bytes/sector mpeg tracks, without 224 <LI>The second and other tracks are raw 2324 bytes/sector MPEG (movie) tracks,
207 any filesystem but raw mpeg ps data, one packet per sector. they contain the 225 containing one MPEG PS data packet per sector instead of a filesystem.
208 movie(s)... The tracks <B>can't be mounted</B>! It is similar to audio 226 Similar to audio CD tracks, these tracks <B>cannot be mounted</B> (Did you
209 tracks (e.g. You never mounted an audio cd to play it, or did you? No). 227 ever mount an audio CD to play it?). As most movies are inside this track,
210 As most movies are inside track too, you should try <CODE>-vcd 2</CODE> 228 you should try <CODE>-vcd 2</CODE> first.</LI>
211 first.</LI> 229 <LI>There exist VCD disks without the first track (single track and no
212 <LI>There exist VCD disks without the first track too (single track and no 230 filesystem at all). They are still playable, but cannot be mounted.</LI>
213 filesystems at all). They are still playable, but can't be mounted.</LI>
214 </UL> 231 </UL>
215 232
216 <P>About .DAT files:</P> 233 <H4>About .DAT files:</H4>
217 234
218 <P>The ~600 MB file visible on the first track of the mounted vcd isn't a real 235 <P>The ~600 MB file visible on the first track of the mounted VCD is not a real
219 file! It's a so called iso gateway, created to allow Windows to handle such 236 file! It is a so called ISO gateway, created to allow Windows to handle such
220 tracks (Windows doesn't allow raw device access to applications at all). 237 tracks (Windows does not allow raw device access to applications at all).
221 Under linux, you cannot copy or play such files (they contain garbage). 238 Under Linux you cannot copy or play such files (they contain garbage). Under
222 Under Windows it is possible as its iso9660 driver emulates the raw reading of 239 Windows it is possible as its iso9660 driver emulates the raw reading of
223 tracks in this file. To play a .DAT file you need a kernel driver which can be 240 tracks in this file. To play a .DAT file you need the kernel driver which can
224 found in the Linux version of PowerDVD. It has a modified iso9660 filesystem 241 be found in the Linux version of PowerDVD. It has a modified iso9660
225 (vcdfs/isofs-2.4.X.o) driver, which is able to emulate the 242 filesystem (<CODE>vcdfs/isofs-2.4.X.o</CODE>) driver, which is able to emulate
226 raw tracks through this shadow .DAT file. If you mount the disc using their 243 the raw tracks through this shadow .DAT file. If you mount the disc using
227 driver, you can copy and even play .DAT files with mplayer. But it <B>won't 244 their driver, you can copy and even play .DAT files with mplayer. But it
228 work</B> with the standard iso9660 driver of the kernel! It is recommended to 245 <B>will not work</B> with the standard iso9660 driver of the Linux kernel!
229 use the <CODE>-vcd</CODE> option instead. Alternate options for VCD copy are 246 Use the <CODE>-vcd</CODE> option instead. Alternatives for VCD copying are
230 the new cdfs kernel driver (shows CD <I>sessions</I> as image files) and 247 the new <A HREF="http://www.elis.rug.ac.be/~ronsse/cdfs/">cdfs</A> kernel
231 cdrdao (a bit-to-bit cd grabber/copier application).</P> 248 driver (not part of the official kernel) that shows CD <I>sessions</I>
232 249 as image files and <A HREF="http://cdrdao.sourceforge.net/">cdrdao</A>, a
233 <P>The default VCD device is <CODE>/dev/cdrom</CODE>. If your setup differs, 250 bit-by-bit CD grabbing/copying application.</P>
234 make a symlink, or specify the correct device on the command line with the
235 <CODE>-cdrom-device</CODE> option.</P>
236 251
237 </BODY> 252 </BODY>
238 </HTML> 253 </HTML>