Mercurial > mplayer.hg
annotate DOCS/xml/en/cd-dvd.xml @ 10910:eb339c10228e
Lol! This command will try to change xfer_mode, and not a cdrom spin speed. Removed.
author | lumag |
---|---|
date | Sun, 21 Sep 2003 12:59:13 +0000 |
parents | dc8057623941 |
children | 49b1a67e7381 |
rev | line source |
---|---|
9675 | 1 <?xml version="1.0" encoding="iso-8859-1"?> |
2 <chapter id="cd-dvd"> | |
3 <title>CD/DVD usage</title> | |
4 | |
5 <sect1 id="drives"> | |
6 <title>CD/DVD drives</title> | |
7 <para> | |
8 Linux documentation excerpt: | |
9 </para> | |
10 | |
11 <para> | |
12 Modern CD-ROM drives can attain very high head speeds, yet some CD-ROM drives | |
13 are capable of running at reduced speeds. There are several reasons that might | |
14 make you consider changing the speed of a CD-ROM drive: | |
15 </para> | |
16 | |
17 <itemizedlist> | |
18 <listitem><para> | |
19 There have been reports of read errors at high speeds, especially | |
20 with badly pressed CD-ROMs. Reducing the speed can prevent data loss under | |
21 these circumstances. | |
22 </para></listitem> | |
23 | |
24 <listitem><para> | |
25 Many CD-ROM drives are annoyingly loud, a lower speed may reduce the noise. | |
26 </para></listitem> | |
27 </itemizedlist> | |
28 | |
29 <para> | |
30 You can reduce the speed of IDE CD-ROM drives with <command>hdparm</command> or a | |
31 program called <command>setcd</command>. It works like this: | |
9776
861a40949bf3
fixes, some by Dmitry Baryshkov <lumag@qnc.ru>, some by me
nicolas
parents:
9675
diff
changeset
|
32 <screen>hdparm -E <replaceable>[speed]</replaceable> <replaceable>[cdrom device]</replaceable></screen> |
861a40949bf3
fixes, some by Dmitry Baryshkov <lumag@qnc.ru>, some by me
nicolas
parents:
9675
diff
changeset
|
33 <screen>setcd -x <replaceable>[speed]</replaceable> <replaceable>[cdrom device]</replaceable></screen> |
9675 | 34 </para> |
35 | |
36 <para> | |
10910
eb339c10228e
Lol! This command will try to change xfer_mode, and not a cdrom spin speed. Removed.
lumag
parents:
10656
diff
changeset
|
37 If you have root privileges the following command may also help: |
9776
861a40949bf3
fixes, some by Dmitry Baryshkov <lumag@qnc.ru>, some by me
nicolas
parents:
9675
diff
changeset
|
38 <screen>echo file_readahead:2000000 > /proc/ide/<replaceable>[cdrom device]</replaceable>/settings</screen> |
9675 | 39 </para> |
40 | |
41 <para> | |
42 This sets prefetched file reading to 2MB, which helps with scratched CD-ROMs. | |
43 If you set it to too high, the drive will continuously spin up and down, and | |
44 will dramatically decrease the performance. | |
45 It is recommended that you also tune your CD-ROM drive with <command>hdparm</command>: | |
46 <screen>hdparm -d1 -a8 -u1 <replaceable>cdrom device</replaceable></screen> | |
47 </para> | |
48 | |
49 <para> | |
50 This enables DMA access, read-ahead, and IRQ unmasking (read the <command>hdparm</command> | |
51 man page for a detailed explanation). | |
52 </para> | |
53 | |
54 <para> | |
9776
861a40949bf3
fixes, some by Dmitry Baryshkov <lumag@qnc.ru>, some by me
nicolas
parents:
9675
diff
changeset
|
55 Please refer to "<filename>/proc/ide/<replaceable>cdrom device</replaceable>/settings"</filename> |
9675 | 56 for fine-tuning your CD-ROM. |
57 </para> | |
58 | |
59 <para> | |
60 SCSI drives do not have a uniform way of setting these parameters (Do you know one? | |
61 Tell us!) There is a tool that works for | |
62 <ulink url="http://das.ist.org/~georg/">Plextor SCSI drives</ulink>. | |
63 </para> | |
64 | |
65 <para>FreeBSD:</para> | |
9776
861a40949bf3
fixes, some by Dmitry Baryshkov <lumag@qnc.ru>, some by me
nicolas
parents:
9675
diff
changeset
|
66 <para>Speed: <command>cdcontrol [-f <replaceable>device</replaceable>] speed <replaceable>speed</replaceable></command></para> |
9675 | 67 <para>DMA: <command>sysctl hw.ata.atapi_dma=1</command></para> |
68 </sect1> | |
69 | |
70 <sect1 id="dvd"> | |
71 <title>DVD playback</title> | |
72 <para> | |
73 For the complete list of available options, please read the man page. | |
74 The Syntax for a standard Digital Versatile Disc (DVD) is as follows: | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
9776
diff
changeset
|
75 <screen>mplayer dvd://<replaceable><track></replaceable> [-dvd-device <replaceable><device></replaceable>]</screen> |
9675 | 76 </para> |
77 | |
78 <para> | |
79 Example: | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
9776
diff
changeset
|
80 <screen>mplayer dvd://1 -dvd-device /dev/hdc</screen> |
9675 | 81 </para> |
82 | |
83 <para> | |
84 The default DVD device is <filename>/dev/dvd</filename>. If your setup | |
85 differs, make a symlink or specify the correct device on the command | |
86 line with the <option>-dvd-device</option> option. | |
87 </para> | |
88 | |
89 <formalpara> | |
90 <title>New-style DVD support (mpdvdkit2)</title> | |
91 <para> | |
92 <application>MPlayer</application> uses <systemitem>libdvdread</systemitem> and | |
93 <systemitem>libdvdcss</systemitem> for DVD decryption and playback. These two | |
94 libraries are contained in the <filename class="directory">libmpdvdkit2/</filename> | |
95 subdirectory of the MPlayer source tree, you do not have to install them separately. | |
96 We opted for this solution because we had to fix a <systemitem>libdvdread</systemitem> | |
97 bug and apply a patch which adds | |
98 <emphasis role="bold">cracked CSS keys caching support</emphasis> to | |
99 <systemitem>libdvdcss</systemitem> This results in a large speed increase because the | |
100 keys do not have to be cracked every time before playing. | |
101 </para> | |
102 </formalpara> | |
103 | |
104 <para> | |
105 <application>MPlayer</application> can also use system-wide <systemitem>libdvdread</systemitem> | |
106 and <systemitem>libdvdcss</systemitem> libraries, but this solution is | |
107 <emphasis role="bold">not</emphasis> recommended, as it can result in bugs, | |
108 library incompatibilities and slower speed. | |
109 </para> | |
110 | |
111 <formalpara> | |
112 <title>Old-style DVD support - OPTIONAL</title> | |
113 <para> | |
114 Useful if you want to play encoded VOBs from <emphasis role="bold">hard disk</emphasis>. | |
115 Compile and install <emphasis role="bold">libcss</emphasis> 0.0.1 (not newer) for this | |
116 (If MPlayer fails to detect it, use the <option>-csslib /path/to/libcss.so</option> | |
117 option). To use it, you need to be root, use a suid root MPlayer binary or let | |
118 MPlayer call the suid-root fibmap_mplayer wrapper program. | |
119 </para> | |
120 </formalpara> | |
121 | |
122 <formalpara> | |
123 <title>DVD structure</title> | |
124 <para> | |
125 DVD disks have 2048 bytes per sector with ECC/CRC. They usually have an UDF | |
126 filesystem on a single track, containing various files (small .IFO and .BUK | |
127 files and big (1GB) .VOB files). They are real files and can be copied/played | |
128 from the mounted filesystem of an unencrypted DVD. | |
129 </para> | |
130 </formalpara> | |
131 | |
132 <para> | |
133 The .IFO files contain the movie navigation information (chapter/title/angle | |
134 map, language table, etc) and are needed to read and interpret the .VOB content | |
135 (movie). The .BUK files are backups of them. They use | |
136 <emphasis role="bold">sectors</emphasis> everywhere, so you need to use raw | |
137 addressing of sectors of the disc to implement DVD navigation or decrypt the | |
138 content. | |
139 </para> | |
140 | |
141 <para> | |
142 The whole old-style DVD support with <systemitem>libcss</systemitem> therefore | |
143 needs a mounted DVD filesystem and raw sector-based access to the device. | |
144 Unfortunately you must (under Linux) be root to get the sector address of a | |
145 file. You have the following choices: | |
146 | |
147 <itemizedlist> | |
148 <listitem><para> | |
149 Be root or use a suid-root <application>MPlayer</application> binary. | |
150 </para></listitem> | |
151 | |
152 <listitem><para> | |
153 Let <application>MPlayer</application> call the suid-root fibmap_mplayer | |
154 wrapper program to access the DVD (used in the old-style DVD playback over | |
155 <systemitem>libcss</systemitem>). | |
156 </para></listitem> | |
157 | |
158 <listitem><para> | |
159 Don't use the kernel's filesystem driver at all and reimplement it in | |
160 userspace. <systemitem>libdvdread</systemitem> 0.9.x and <systemitem>libmpdvdkit</systemitem> | |
161 do this (new-style DVD support). The kernel UDF filesystem driver is not | |
162 needed as they already have their own builtin UDF filesystem driver. | |
163 Also the DVD does not have to be mounted as only the raw sector-based | |
164 access is used. | |
165 </para></listitem> | |
166 </itemizedlist> | |
167 </para> | |
168 | |
169 <para> | |
170 Sometimes <filename>/dev/dvd</filename> cannot be read by users, so the | |
171 <systemitem>libdvdread</systemitem> authors implemented an emulation layer | |
172 which transfers sector addresses to filenames+offsets, to emulate raw | |
173 access on top of a mounted filesystem or even on a hard disk. | |
174 </para> | |
175 | |
176 <para> | |
177 <systemitem>libdvdread</systemitem> even accepts the mountpoint instead of | |
178 the device name for raw access and checks <filename>/proc/mounts</filename> | |
179 to get the device name. It was developed for Solaris, where device names | |
180 are dynamically allocated. | |
181 </para> | |
182 | |
183 <para> | |
184 The default DVD device is <filename>/dev/dvd</filename>. If your setup differs, | |
185 make a symlink, or specify the correct device on the command line with the | |
186 <option>-dvd-device</option> option. | |
187 </para> | |
188 | |
189 <formalpara> | |
190 <title>DVD authentication</title> | |
191 <para> | |
192 The authentication and decryption method of the new-style DVD support is done | |
193 using a patched <systemitem>libdvdcss</systemitem> (see above). The method can | |
194 be specified through the environment variable <envar>DVDCSS_METHOD</envar>, | |
195 which can be set to key, disk or title. | |
196 </para> | |
197 </formalpara> | |
198 | |
199 <para> | |
200 If nothing is specified it tries the following methods (default: key, | |
201 title request): | |
202 </para> | |
203 | |
204 <orderedlist> | |
205 <listitem><para> | |
206 <emphasis role="bold">bus key</emphasis>: This key is negotiated during | |
207 authentication (a long mix of ioctls and various key exchanges, crypto | |
208 stuff) and is used to encrypt the title and disk keys before sending them | |
209 over the unprotected bus (to prevent eavesdropping). The bus key is needed | |
210 to get and predecrypt the crypted disk key. | |
211 </para></listitem> | |
212 | |
213 <listitem><para> | |
214 <emphasis role="bold">cached key</emphasis>: <application>MPlayer</application> | |
215 looks for already cracked title keys which are stored in the | |
216 <filename class="directory">~/.mplayer/DVDKeys</filename> directory (fast ;). | |
217 </para></listitem> | |
218 | |
219 <listitem><para> | |
220 <emphasis role="bold">key</emphasis>: If no cached key is available, | |
221 <application>MPlayer</application> tries to decrypt the disk key with a set | |
222 of included player keys. | |
223 </para></listitem> | |
224 | |
225 <listitem><para> | |
226 <emphasis role="bold">disk</emphasis>: If the key method fails | |
227 (e.g. no included player keys), <application>MPlayer</application> | |
228 will crack the disk key using a brute force algorithm. This process | |
229 is CPU intensive and requires 64 MB of memory (16M 32Bit entries hash | |
230 table) to store temporary data. This method should always work (slow). | |
231 </para></listitem> | |
232 | |
233 <listitem><para> | |
234 <emphasis role="bold">title request</emphasis>: With the disk key | |
235 <application>MPlayer</application> requests the crypted title keys, | |
236 which are inside <emphasis>hidden sectors</emphasis> using <systemitem>ioctl()</systemitem>. | |
237 The region protection of RPC-2 drives is performed in this step and may fail on such drives. | |
238 If it succeeds, the title keys will be decrypted with the bus and disk key. | |
239 </para></listitem> | |
240 | |
241 <listitem><para> | |
242 <emphasis role="bold">title</emphasis>: This method is used if the title | |
243 request failed and does not rely on any key exchange with the DVD drive. | |
244 It uses a crypto attack to guess the title key directly (by finding a | |
245 repeating pattern in the decrypted VOB content and guessing that the | |
246 plain text corresponding to the first encrypted bytes is a continuation | |
247 of that pattern). The method is also known as "known plaintext attack" | |
248 or "DeCSSPlus". In rare cases this may fail because there is not | |
249 enough encrypted data on the disk to perform a statistical attack or because | |
250 the key changes in the middle of a title. This method is the only way to | |
251 decrypt a DVD stored on a hard disk or a DVD with the wrong region on an | |
252 RPC2 drive (slow). | |
253 </para></listitem> | |
254 </orderedlist> | |
255 | |
256 <para> | |
257 RPC-1 DVD drives only protect region settings through software. RPC-2 drives | |
258 have a hardware protection that allows 5 changes only. It might be | |
259 needed/recommended to upgrade the firmware to RPC-1 if you have a RPC-2 DVD | |
260 drive. Firmware upgrades can be found on this | |
261 <ulink url="http://www.firmware-flash.com">firmware page</ulink>. If there is | |
262 no firmware upgrade available for your device, use the | |
263 <ulink url="http://www.linuxtv.org/download/dvd/dvd_disc_20000215.tar.gz">regionset tool</ulink> | |
264 to set the region code of your DVD drive (under Linux). | |
265 <emphasis role="bold">Warning</emphasis>: You can only set the region 5 times. | |
266 </para> | |
267 </sect1> | |
268 | |
269 <sect1 id="vcd"> | |
270 <title>VCD playback</title> | |
271 <para> | |
272 For the complete list of available options, please read the man page. The Syntax for a | |
273 standard Video CD (VCD) is as follows: | |
10203 | 274 <screen>mplayer vcd://<replaceable><track></replaceable> [-cdrom-device <replaceable><device></replaceable>]</screen> |
9675 | 275 Example: |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
9776
diff
changeset
|
276 <screen>mplayer vcd://2 -cdrom-device /dev/hdc</screen> |
9675 | 277 The default VCD device is <filename>/dev/cdrom</filename>. If your setup |
278 differs, make a symlink or specify the correct device on the command line | |
279 with the <option>-cdrom-device</option> option. | |
280 </para> | |
281 | |
282 <note><para> | |
283 At least Plextor and some Toshiba SCSI CD-ROM drives have horrible performance | |
284 reading VCDs. This is because the the CDROMREADRAW <systemitem>ioctl</systemitem> | |
285 is not fully implemented for these drives. If you have some knowledge of SCSI | |
286 programming, please <ulink url="../../tech/patches.txt">help us</ulink> | |
287 implement generic SCSI support for VCDs. | |
288 </para></note> | |
289 | |
290 <para> | |
291 In the meantime you can extract data from VCDs with | |
292 <ulink url="http://140.132.1.204/OS/Linux/packages/X/viewers/readvcd/">readvcd</ulink> | |
293 and play the resulting file with <application>MPlayer</application>. | |
294 </para> | |
295 | |
296 <formalpara> | |
297 <title>VCD structure</title> | |
298 <para>VCD disks consist of one or more tracks:</para> | |
299 </formalpara> | |
300 | |
301 <itemizedlist> | |
302 <listitem><para> | |
303 The first track is a small 2048 bytes/sector data track with an iso9660 | |
304 filesystem, usually containing Windows VCD player programs and maybe other | |
305 information (images, text, etc). | |
306 </para></listitem> | |
307 | |
308 <listitem><para> | |
309 The second and other tracks are raw 2324 bytes/sector MPEG (movie) | |
310 tracks, containing one MPEG PS data packet per sector instead of a | |
311 filesystem. Similar to audio CD tracks, these tracks <emphasis role="bold">cannot | |
312 be mounted</emphasis> (Did you ever mount an audio CD to play it?). | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
9776
diff
changeset
|
313 As most movies are inside this track, you should try <option>vcd://2</option> first. |
9675 | 314 </para></listitem> |
315 | |
316 <listitem><para> | |
317 There exist VCD disks without the first track (single track and no filesystem | |
318 at all). They are still playable, but cannot be mounted. | |
319 </para></listitem> | |
320 </itemizedlist> | |
321 | |
322 <formalpara> | |
323 <title>About .DAT files</title> | |
324 <para> | |
325 The ~600 MB file visible on the first track of the mounted VCD is not a real | |
326 file! It is a so called ISO gateway, created to allow Windows to handle such | |
327 tracks (Windows does not allow raw device access to applications at all). | |
328 Under Linux you cannot copy or play such files (they contain garbage). Under | |
329 Windows it is possible as its iso9660 driver emulates the raw reading of | |
330 tracks in this file. To play a .DAT file you need the kernel driver which can | |
331 be found in the Linux version of PowerDVD. It has a modified iso9660 filesystem | |
332 (<filename>vcdfs/isofs-2.4.X.o</filename>) driver, which is able to emulate the | |
333 raw tracks through this shadow .DAT file. If you mount the disc using their | |
9776
861a40949bf3
fixes, some by Dmitry Baryshkov <lumag@qnc.ru>, some by me
nicolas
parents:
9675
diff
changeset
|
334 driver, you can copy and even play .DAT files with <application>MPlayer</application>. But it will not |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
9776
diff
changeset
|
335 work with the standard iso9660 driver of the Linux kernel! Use |
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
9776
diff
changeset
|
336 <option>vcd://</option> instead. Alternatives for VCD copying are the |
9675 | 337 new <ulink url="http://www.elis.rug.ac.be/~ronsse/cdfs/">cdfs</ulink> kernel |
338 driver (not part of the official kernel) that shows CD sessions as image files and | |
339 <ulink url="http://cdrdao.sourceforge.net/">cdrdao</ulink>, a bit-by-bit | |
340 CD grabbing/copying application. | |
341 </para> | |
342 </formalpara> | |
343 </sect1> | |
344 </chapter> |