summaryrefslogtreecommitdiffstats
path: root/DOCS/xml/en/cd-dvd.xml
blob: 0652fbe057a308cb11824d94e647b091759badb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter id="cd-dvd">
<title>CD/DVD usage</title>

<sect1 id="drives">
<title>CD/DVD drives</title>

<para>
Modern CD-ROM drives can attain very high head speeds, yet some CD-ROM drives
are capable of running at reduced speeds. There are several reasons that might
make you consider changing the speed of a CD-ROM drive:
</para>

<itemizedlist>
<listitem><para>
  There have been reports of read errors at high speeds, especially
  with badly pressed CD-ROMs. Reducing the speed can prevent data loss under
  these circumstances.
</para></listitem>

<listitem><para>
  Many CD-ROM drives are annoyingly loud, a lower speed may reduce the noise.
</para></listitem>
</itemizedlist>

<!-- ********** -->

<sect2 id="drives_linux">
<title>Linux</title>

<para>
You can reduce the speed of IDE CD-ROM drives with <command>hdparm</command>,
<command>setcd</command> or <command>cdctl</command>. It works like this:
<screen>hdparm -E <replaceable>[speed]</replaceable> <replaceable>[cdrom device]</replaceable></screen>
<screen>setcd -x <replaceable>[speed]</replaceable> <replaceable>[cdrom device]</replaceable></screen>
<screen>cdctl -bS <replaceable>[speed]</replaceable></screen>
</para>

<para>
If you are using SCSI emulation, you might have to apply the settings to the
real IDE device, not the emulated SCSI device.
</para>

<para>
If you have root privileges the following command may also help:
<screen>echo file_readahead:2000000 &gt; /proc/ide/<replaceable>[cdrom device]</replaceable>/settings</screen>
</para>

<para>
This sets prefetched file reading to 2MB, which helps with scratched CD-ROMs.
If you set it to too high, the drive will continuously spin up and down, and
will dramatically decrease the performance.
It is recommended that you also tune your CD-ROM drive
with <command>hdparm</command>:
<screen>hdparm -d1 -a8 -u1 <replaceable>[cdrom device]</replaceable></screen>
</para>

<para>
This enables DMA access, read-ahead, and IRQ unmasking (read the
<command>hdparm</command> man page for a detailed explanation).
</para>

<para>
Please refer to
"<filename>/proc/ide/<replaceable>[cdrom device]</replaceable>/settings</filename>"
for fine-tuning your CD-ROM.
</para>

<para>
SCSI drives do not have a uniform way of setting these parameters (Do you know
one? Tell us!) There is a tool that works for
<ulink url="http://das.ist.org/~georg/">Plextor SCSI drives</ulink>.
</para>
</sect2>

<!-- ********** -->

<sect2 id="drives_freebsd">
<title>FreeBSD</title>

<para>speed:
<screen>
cdcontrol [-f <replaceable>device</replaceable>] speed <replaceable>[speed]</replaceable>
</screen>
</para>

<para>DMA:
<screen>
sysctl hw.ata.atapi_dma=1
</screen>
</para>

</sect2>

</sect1>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<sect1 id="dvd">
<title>DVD playback</title>

<para>
For the complete list of available options, please read the man page.
The syntax to play a standard DVD is as follows:
<screen>
mplayer dvd://<replaceable>&lt;track&gt;</replaceable> [-dvd-device <replaceable>&lt;device&gt;</replaceable>]
</screen>
</para>

<para>
Example:
<screen>mplayer dvd://1 -dvd-device /dev/hdc</screen>
</para>

<para>
If you have compiled <application>MPlayer</application> with dvdnav support, the
syntax is the same, except that you need to use dvdnav:// instead of dvd://.
</para>

<para>
The default DVD device is <filename>/dev/dvd</filename>. If your setup
differs, make a symlink or specify the correct device on the command
line with the <option>-dvd-device</option> option.
</para>

<para>
<application>MPlayer</application> uses <systemitem>libdvdread</systemitem> and
<systemitem>libdvdcss</systemitem> for DVD playback and decryption. These two
libraries are contained in the
<application>MPlayer</application> source tree, you do not have
to install them separately. You can also use system-wide versions of the two
libraries, but this solution is not recommended, as it can result in bugs,
library incompatibilities and slower speed.
</para>

<note><para>
In case of DVD decoding problems, try disabling supermount, or any other such
facilities. Some RPC-2 drives may also require setting the region code.
</para></note>

<formalpara>
<title>DVD structure</title>
<para>
DVD disks have 2048 bytes per sector with ECC/CRC. They usually have an UDF
filesystem on a single track, containing various files (small .IFO and .BUP
files and big (1GB) .VOB files). They are real files and can be copied/played
from the mounted filesystem of an unencrypted DVD.
</para>
</formalpara>

<para>
The .IFO files contain the movie navigation information (chapter/title/angle
map, language table, etc) and are needed to read and interpret the .VOB content
(movie). The .BUP files are backups of them. They use
<emphasis role="bold">sectors</emphasis> everywhere, so you need to use raw
addressing of sectors of the disc to implement DVD navigation or decrypt the
content.
</para>

<para>
DVD support needs raw sector-based access to the device. Unfortunately you must
(under Linux) be root to get the sector address of a file. That's why we don't
use the kernel's filesystem driver at all, instead we reimplement it in
userspace. <systemitem>libdvdread</systemitem> 0.9.x does this.
The kernel UDF filesystem driver
is not needed as they already have their own builtin UDF filesystem driver.
Also the DVD does not have to be mounted as only the raw sector-based access is
used.
</para>

<para>
Sometimes <filename>/dev/dvd</filename> cannot be read by users, so the
<systemitem>libdvdread</systemitem> authors implemented an emulation layer
which transfers sector addresses to filenames+offsets, to emulate raw
access on top of a mounted filesystem or even on a hard disk.
</para>

<para>
<systemitem>libdvdread</systemitem> even accepts the mountpoint instead of
the device name for raw access and checks <filename>/proc/mounts</filename>
to get the device name. It was developed for Solaris, where device names
are dynamically allocated.
</para>

<formalpara>
<title>DVD decryption</title>
<para>
DVD decryption is done by <systemitem>libdvdcss</systemitem>. The method
can be specified through the <envar>DVDCSS_METHOD</envar> environment
variable, see the manual page for details.
</para>
</formalpara>

<para>
RPC-1 DVD drives only protect region settings through software. RPC-2 drives
have a hardware protection that allows 5 changes only. It might be
needed/recommended to upgrade the firmware to RPC-1 if you have a RPC-2 DVD
drive. You can try finding firmware upgrades for your drive on the internet,
<ulink url="http://forum.rpc-1.com/dl_all.php">this firmware forum</ulink>
may be a good starting point for your search.
If there is no firmware upgrade available for your device, use the
<ulink url="http://linvdr.org/projects/regionset/">regionset tool</ulink>
to set the region code of your DVD drive (under Linux).
<emphasis role="bold">Warning</emphasis>: You can only set the region 5 times.
</para>
</sect1>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<sect1 id="vcd">
<title>VCD playback</title>

<para>
For the complete list of available options, please read the man page. The
Syntax for a standard Video CD (VCD) is as follows:
<screen>mplayer vcd://<replaceable>&lt;track&gt;</replaceable> [-cdrom-device <replaceable>&lt;device&gt;</replaceable>]</screen>
Example:
<screen>mplayer vcd://2 -cdrom-device /dev/hdc</screen>
The default VCD device is <filename>/dev/cdrom</filename>. If your setup
differs, make a symlink or specify the correct device on the command line
with the <option>-cdrom-device</option> option.
</para>

<note><para>
At least Plextor and some Toshiba SCSI CD-ROM drives have horrible performance
reading VCDs. This is because the CDROMREADRAW <systemitem>ioctl</systemitem>
is not fully implemented for these drives. If you have some knowledge of SCSI
programming, please <ulink url="../../tech/patches.txt">help us</ulink>
implement generic SCSI support for VCDs.
</para></note>

<para>
In the meantime you can extract data from VCDs with
<ulink url="http://ftp.ntut.edu.tw/ftp/OS/Linux/packages/X/viewers/readvcd/">readvcd</ulink>
and play the resulting file with <application>MPlayer</application>.
</para>

<formalpara>
<title>VCD structure</title>
<para>
A Video CD (VCD) is made up of CD-ROM XA sectors, i.e. CD-ROM mode 2
form 1 and 2 tracks:
<itemizedlist>
<listitem><para>
  The first track is in mode 2 form 2 format which means it uses L2
  error correction. The track contains an ISO-9660 filesystem with 2048
  bytes/sector. This filesystem contains VCD metadata information, as
  well as still frames often used in menus. MPEG segments for menus can
  also be stored in this first track, but the MPEGs have to be broken up
  into a series of 150-sector chunks. The ISO-9660 filesystem may
  contain other files or programs that are not essential for VCD
  operation.
</para></listitem>

<listitem><para>
  The second and remaining tracks are generally raw 2324 bytes/sector
  MPEG (movie) tracks, containing one MPEG PS data packet per
  sector. These are in mode 2 form 1 format, so they store more data per
  sector at the loss of some error correction. It is also legal to have
  CD-DA tracks in a VCD after the first track as well.
  On some operating systems there is some trickery that goes on to make
  these non-ISO-9660 tracks appear in a filesystem. On other operating
  systems like GNU/Linux this is not the case (yet). Here the MPEG data
  <emphasis role="bold">cannot be mounted</emphasis>. As most movies are
  inside this kind of track, you should try <option>vcd://2</option>
  first.
</para></listitem>

<listitem><para>
  There exist VCD disks without the first track (single track and no filesystem
  at all). They are still playable, but cannot be mounted.
</para></listitem>

<listitem><para>
  The definition of the Video CD standard is called the
  Philips "White Book" and it is not generally available online as it
  must be purchased from Philips. More detailed information about Video
  CDs can be found in the
  <ulink url="http://www.vcdimager.org/pub/vcdimager/manuals/0.7/vcdimager.html#SEC4">vcdimager documentation</ulink>.
</para></listitem>
</itemizedlist>
</para>
</formalpara>

<formalpara>
<title>About .DAT files</title>
<para>
The ~600 MB file visible on the first track of the mounted VCD is not a real
file! It is a so called ISO gateway, created to allow Windows to handle such
tracks (Windows does not allow raw device access to applications at all).
Under Linux you cannot copy or play such files (they contain garbage). Under
Windows it is possible as its iso9660 driver emulates the raw reading of
tracks in this file. To play a .DAT file you need the kernel driver which can
be found in the Linux version of PowerDVD. It has a modified iso9660 filesystem
(<filename>vcdfs/isofs-2.4.X.o</filename>) driver, which is able to emulate the
raw tracks through this shadow .DAT file. If you mount the disc using their
driver, you can copy and even play .DAT files with
<application>MPlayer</application>. But it will not
work with the standard iso9660 driver of the Linux kernel! Use
<option>vcd://</option> instead. Alternatives for VCD copying are the
new <ulink url="http://www.elis.rug.ac.be/~ronsse/cdfs/">cdfs</ulink> kernel
driver (not part of the official kernel) that shows CD sessions as image files
and <ulink url="http://cdrdao.sf.net/">cdrdao</ulink>, a bit-by-bit
CD grabbing/copying application.
</para>
</formalpara>
</sect1>
</chapter>