Configuring and Using CD, DVD, and CD-RW Drives


Linux provides support for using a variety of CD and DVD devices and media. This section shows how to determine what device has been assigned to your CD drive and how to get additional drive information if the drive supports recording on optical media.

AT Attachment Packet Interface, or ATAPI, IDE-based CD drives, are recognized during installation and work through the ide-cd kernel module. A symbolic link named /dev/cdrom will be created and will point to your CD's device (perhaps /dev/hdb or /dev/hdc). You can use many different types of CD drives with Linux, and you can easily replace, add, or upgrade your system to use a new drive. Part of a successful configuration involves the proper installation of the hardware and being able to determine the drive's device when using Linux.

Checking Drive Assignment

Linux recognizes CD and DVD drives upon booting if they are attached to your computer's motherboard with proper cabling and if they are assigned as either a master or slave on an IDE channel. Look through your kernel boot message for the drive device assignment, such as

hdd: DVDROM 10X, ATAPI CD/DVD-ROM drive


If you have a DVD-capable drive, you generally should also have a symbolic link named /dev/dvd that points to your drive's device because many DVD clients, such as xine or vlc, look for /dev/dvd by default. If you have a CD-RW drive, the Fedora installer inserts a kernel argument into your boot loader's configuration file that specifies use of the idescsi kernel. For example,

append="hdb=ide-scsi"


A similar entry in the grub boot loader's /etc/grub.conf file would look like this:

kernel boot/vmlinuz-6.5-1.358 ro root=/dev/hda2 hdb=ide-scsi


The first CD-RW drive is assigned to the device /dev/scd0 (although it might still be initially recognized while booting as an IDE device), with subsequent drives assigned to /dev/scd1, and so on. To initialize your drive for use, the following modules should be loaded:

Module         Size Used by  Not tainted sg           30244  0 (autoclean) sr_mod         15192  0 (autoclean) cdrom         27872  0 (autoclean) [sr_mod] ide-scsi        8128  0 scsi_mod        96572  2 [sr_mod ide-scsi]


Look for kernel message output regarding the device such as this:

Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0 sr0: scsi3-mmc drive: 0x/32x writer cd/rw xa/form2 cdda tray Uniform CD-ROM driver Revision: 3.12


Your ATAPI-based CD-RW drive will then work as a SCSI device under emulation, and the symbolic link /dev/cdrom should point to /dev/scd0. You can also use the cdrecord command (included with Red Hat's multimedia software packages) to acquire SCSI device information about your drive for later use during a burn operation like this:

# cdrecord -scanbus Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling Linux sg driver version: 3.1.22 Using libscg version 'schily-0.5' scsibus0:     0,0,0   0) 'HL-DT-ST' 'RW/DVD GCC-4120B' '2.01' Removable CD-ROM     0,1,0   1) *     0,2,0   2) *     0,3,0   3) *     0,4,0   4) *     0,5,0   5) *     0,6,0   6) *     0,7,0   7) *


The pertinent information0,0,0 in the example (SCSI bus, device ID, and Logical Unit Number, or lun)can then be used during a burn operation like this:

# cdrecord -v speed=8 dev=0,0,0 -data -eject file_name.img


In this example, a CD-ROM data image named file_name.img is created on a CD-R or CD-RW media at a speed of 8, and the new disk will be ejected after the write operation has completed. See "Burning CDs in Fedora" in Chapter 10, "Multimedia Applications," for other ways to create CD-ROMs.

Note

Fedora also includes the dvdrecord, dvd+rw-format, and growisofs commands, which can be used with DVD-R and DVD-RW drives.


Initializing FireWire CD Drives

This section provides some basic information you can use if you attach a FireWire CD drive to your system. These drives use a high-speed serial interface, otherwise known as IEEE 1394, which supports data transfers more than 30 times faster than the first version of USB (at speeds up to 400Mbps), although USB 2.0 devices are a bit faster.

Linux has supported FireWire since the advent of the 2.4-series kernel, and now works with many different devices, such as video cameras, VCRs, hard drives, scanners, PCMCIA cards, and CD, DVD, or CD-RW drives. The Fedora installer should recognize most FireWire interface hardware; if so, you will be able to use the device with Linux. One Linux FireWire component, the video1394 kernel module, currently supports more than 120 different digital video cameras. General support exists for many different hard drives and DVD or CD-RW drives.

If you install a FireWire interface after Fedora has been installed, you can initialize support for your device, such as a CD-RW drive, by loading the ieee1394 and ohci1394 kernel modules like this:

# insmod ieee1394 # insmod ohci1394


Next, look for relevant device information from the Linux kernel using the dmesg command:

ohci1394: $Revision: 1.80 $ Ben Collins <bcollins@debian.org> PCI: Found IRQ 10 for device 00:0b.0 PCI: Sharing IRQ 10 with 00:07.5 ohci1394_0: OHCI-1394 1.0 (PCI): IRQ=[10] MMIO=[ee000000-ee000800] \  Max Packet=[2048] ieee1394: Device added: node 2:1023, GUID 00d0010500007d8e ieee1394: sbp2: Driver forced to serialize I/O (serialize_io = 1) ieee1394: sbp2: Node 2:1023: Max speed [S400] - Max payload [2048] scsi1 : IEEE-1394 SBP-2 protocol driver  Vendor: TEAC   Model: CD-W28E      Rev: 1.1A  Type:  CD-ROM               ANSI SCSI revision: 02


In this example, the FireWire drivers have recognized a CD-RW drive (which will be assigned to /dev/scd1 because another CD-RW is also present on the system). You might also find that the sbp2 kernel module has loaded:

Module         Size Used by  Not tainted sbp2          14400  0 ohci1394        15872  0 (unused) ieee1394        25768  0 [sbp2 ohci1394]


Note

Fedora's installer should recognize any FireWire hardware in your PC during installation. Depending on your computer's hardware, you might find an entry in /etc/modprobe.conf such as alias ieee1394-controller ohci1394.


Again, use the cdrecord command and its -scanbus option to obtain information needed to use the drive under SCSI emulation:

# cdrecord -scanbus Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jörg Schilling Linux sg driver version: 3.1.22 Using libscg version 'schily-0.5' scsibus0:     0,0,0   0) 'HL-DT-ST' 'RW/DVD GCC-4120B' '2.01' Removable CD-ROM     0,1,0   1) *     0,2,0   2) *     0,3,0   3) *     0,4,0   4) *     0,5,0    5) *     0,6,0    6) *     0,7,0    7) * scsibus1:     1,0,0   100) 'TEAC  ' 'CD-W28E     ' '1.1A' Removable CD-ROM     1,1,0   101) *     1,2,0   102) *     1,3,0   103) *     1,4,0   104) *     1,5,0   105) *     1,6,0   106) *     1,7,0   107) *


The pertinent information for the FireWire drive1,0,0 in the example (a drive attached to SCSI bus 1, assigned device 0 and a lun of 0)can then be used during a read operation like this:

# export CDDA_DEVICE=1,0,0 # cdda2wav -B Type: ROM, Vendor 'TEAC  ' Model 'CD-W28E     ' Revision '1.1A' MMC+CDDA 724992 bytes buffer memory requested, 4 buffers, 75 sectors #Cdda2wav version 1.10_linux_2.4.17-0.13smp_i686_i686 real time sched. \ soundcard support AUDIOtrack pre-emphasis copy-permitted tracktype channels    1- 8      no       no   audio  2 Table of Contents: total tracks:8, (total time 52:12.72)  1.( 5:25.67), 2.( 9:06.65), 3.( 5:50.68), 4.( 5:35.57), 5.( 7:28.35)  6.( 6:34.60), 7.( 6:07.15), 8.( 6:01.05), Table of Contents: starting sectors  1.(    0), 2.(  24442), 3.(  65457), 4.(  91775), 5.( 116957)  6.( 150592), 7.( 180202), 8.( 207742), lead-out( 234822) CDINDEX discid: SBRXDC1u_.D2S6U1MWq7ksIYOUE- CDDB discid: 0x5e0c3a08 CD-Text: not detected CD-Extra: not detected samplefile size will be 552301388 bytes. recording 3130.09600 seconds stereo with 16 bits @ 44100.0 Hz ->'audio'... percent_done: 100% track 1 successfully recorded 100% track 2 successfully recorded ...


In this example, an environment variable named CDDA_DEVICE with the drive's SCSI information is created, and the cdda2wav command is used to extract the entire contents of an audio CD into .wav file format, with each track saved in a separate file. Other utilities might only need to know the name of the device, such as /dev/scd1, like this:

# cdparanoia -d /dev/scd1 -B cdparanoia III release 9.8 (March 23, 2001) (C) 2001 Monty <monty@xiph.org> and Xiphophorus Report bugs to paranoia@xiph.org http://www.xiph.org/paranoia/     Couldn't disable kernel command translation layer Ripping from sector    0 (track 1 [0:00.00])      to sector 234821 (track 8 [6:01.04]) outputting to track01.cdda.wav ...


Note

Fedora also includes the cdrdao command, which can create Disk-At-Once (DAO) audio and data CD-ROMs. Other types of CD recording supported by Linux drivers and various CD drives include Track-At-Once and Session-At-Once, which turn the drive's laser on and off during various stages of the recording process.


In this example, the CD-RW device name is used, and again, all tracks from an audio CD will be extracted and saved as .wav audio files. Other graphical clients, such as xine, grip, and xcdroast, are included with Fedora and can be used to create or copy audio and data CDs. See Chapter 10 for more details on burning CDs.



Red Hat Fedora 5 Unleashed
Red Hat Fedora 5 Unleashed
ISBN: 067232847X
EAN: 2147483647
Year: 2004
Pages: 362

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net