# CD/DVD recording issues

## SDark

Hi. 1st of all I'm sorry about the long detailed data, but this way could be easier to identify the problem.

I have a problem with my CD/DVD drive on the laptop. I've tried to solve it and got some info, but everything pointed to problems with DMA. I did a few tests and DMA seems fine. So ATM I have no idea how to address this problem. I believe the laptop uses PATA for hardrives so I assume that same goes for the CD-DVD drive. The model is Acer Aspire 1694 LMi.

This problem was 1st noticed with cdrtools. Since cdrkit was getting a better name, I tried to use it just in case my problems were related to the software. The data below is all relative to cdrkit. I also excluded the possibility of hardware problems since under Windows XP everything works fine.

The symptoms are high CPU loads, system failing to respond when recording (with DVDs) and when erasing (CD-RW). I also get kernel error messages.

I'm using gentoo-sources-2.6.20-r8.

A couple of details:

lspci output:

```
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)

00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)

00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 04)

00:1c.1 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 (rev 04)

00:1c.2 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 3 (rev 04)

00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 04)

00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 04)

00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 04)

00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 04)

00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 04)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d4)

00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 04)

00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 04)

00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 04)

00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 04)

00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 04)

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X700 (PCIE)

05:01.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller

05:01.2 FireWire (IEEE 1394): Texas Instruments OHCI Compliant IEEE 1394 Host Controller

05:01.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller

05:03.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05)

05:08.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5788 Gigabit Ethernet (rev 03)
```

hdparm -I /dev/dvd output:

```
/dev/dvd:

ATAPI CD-ROM, with removable media

   Model Number:       Slimtype DVDRW SLW-831S                 

   Serial Number:      

   Firmware Revision:  WRS1    

Standards:

   Supported: CD-ROM ATAPI-2 

Configuration:

   DRQ response: 50us.

   Packet size: 12 bytes

Capabilities:

   LBA, IORDY(cannot be disabled)

   DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 

        Cycle time: min=120ns recommended=120ns

   PIO: pio0 pio1 pio2 pio3 pio4 

        Cycle time: no flow control=240ns  IORDY flow control=120ns

Commands/features:

   Enabled   Supported:

      *   PACKET command feature set

      *   DEVICE_RESET command

      *   Mandatory FLUSH_CACHE
```

kernel config:

 *Quote:*   

> Edit: config removed to reduce post size. Read here 
> 
> 

 

Here's what the problem looks like:

When I record a CD like burning a ISO, the process works out fine with loads around 2.10. I get a couple of warnings from wodim in the logs but nothing big I think. This is one of the logs (used a CD-RW for this one):

```
System

-----------------------

K3b Version: 0.12.17

KDE Version: 3.5.5

QT Version:  3.3.8

Kernel:      2.6.20-gentoo-r8

Devices

-----------------------

Slimtype DVDRW SLW-831S WRS1 (/dev/hdb, ) at /mnt/dvd [CD-R; CD-RW; CD-ROM; DVD-ROM; DVD-R; DVD-RW; DVD+R; DVD+RW; DVD+R DL] [DVD-ROM; DVD-R Sequential; DVD-RW Restricted Overwrite; DVD-RW Sequential; DVD+RW; DVD+R; DVD+R Double Layer; CD-ROM; CD-R; CD-RW] [SAO; TAO; RAW; SAO/R96P; SAO/R96R; RAW/R16; RAW/R96P; RAW/R96R; Restricted Overwrite]

Used versions

-----------------------

cdrecord: 2.1.1a03

cdrecord

-----------------------

wodim: Operation not permitted. Warning: Cannot raise RLIMIT_MEMLOCK limits.

scsidev: '/dev/hdb'

devname: '/dev/hdb'

scsibus: -2 target: -2 lun: -2

Linux sg driver version: 3.5.27

Wodim version: 1.1.2

SCSI buffer size: 64512

wodim: Warning: controller returns wrong page 3 for Ricoh Vendor Page page (30).

Beginning DMA speed test. Set CDR_NODMATEST environment variable if device

communication breaks or freezes immediately after that.

TOC Type: 1 = CD-ROM

Driveropts: 'burnfree'

atapi: 1

Device type    : Removable CD-ROM

Version        : 0

Response Format: 2

Capabilities   : 

Vendor_info    : 'Slimtype'

Identification : 'DVDRW SLW-831S  '

Revision       : 'WRS1'

Device seems to be: Generic mmc2 DVD-R/DVD-RW.

Current: 0x000A (CD-RW)

Profile: 0x002B (DVD+R/DL) 

Profile: 0x001B (DVD+R) 

Profile: 0x001A (DVD+RW) 

Profile: 0x0014 (DVD-RW sequential recording) 

Profile: 0x0013 (DVD-RW restricted overwrite) 

Profile: 0x0011 (DVD-R sequential recording) 

Profile: 0x0010 (DVD-ROM) 

Profile: 0x000A (CD-RW) (current)

Profile: 0x0009 (CD-R) 

Profile: 0x0008 (CD-ROM) 

Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).

Driver flags   : MMC-3 SWABAUDIO BURNFREE 

Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R

Drive buf size : 1422080 = 1388 KB

FIFO size      : 12582912 = 12288 KB

wodim: Warning: controller returns wrong page 3 for Ricoh Vendor Page page (30).

Speed set to 1764 KB/s

Track 01: data   700 MB        

Total size:      804 MB (79:40.65) = 358549 sectors

Lout start:      804 MB (79:42/49) = 358549 sectors

Current Secsize: 2048

ATIP info from disk:

  Indicated writing power: 3

  Reference speed: 6

  Is not unrestricted

  Is erasable

  Disk sub type: High speed Rewritable (CAV) media (1)

  ATIP start of lead in:  -11745 (97:25/30)

  ATIP start of lead out: 359848 (79:59/73)

  1T speed low:  4 1T speed high: 10

  2T speed low:  4 2T speed high:  0 (reserved val  6)

  power mult factor: 1 5

  recommended erase/write power: 5

  A1 values: 24 1A D8

  A2 values: 26 B2 4A

Disk type:    Phase change

Manuf. index: 40

Manufacturer: INFODISC Technology Co., Ltd.

Blocks total: 359848 Blocks current: 359848 Blocks remaining: 1299

Starting to write CD/DVD at speed  10.0 in real SAO mode for single session.

Last chance to quit, starting real write in 2 seconds.

   1 seconds.

   0 seconds. Operation starts.

wodim: Warning: controller returns wrong page 3 for Ricoh Vendor Page page (30).

Waiting for reader process to fill input buffer ... input buffer ready.

Performing OPC...

Sending CUE sheet...

Writing pregap for track 1 at -150

Starting new track at sector: 0

Track 01:    0 of  700 MB written.

Track 01:    1 of  700 MB written (fifo  98%) [buf  70%]   0.4x.

Track 01:    2 of  700 MB written (fifo 100%) [buf  95%]  10.6x.

Track 01:    3 of  700 MB written (fifo 100%) [buf  95%]  10.6x.

Track 01:    4 of  700 MB written (fifo 100%) [buf 100%]  10.3x.

(...)

Track 01:  696 of  700 MB written (fifo 100%) [buf 100%]  10.2x.

Track 01:  697 of  700 MB written (fifo 100%) [buf 100%]  10.5x.

Track 01:  698 of  700 MB written (fifo 100%) [buf 100%]  10.2x.

Track 01:  699 of  700 MB written (fifo 100%) [buf 100%]  10.5x.

Track 01:  700 of  700 MB written (fifo 100%) [buf 100%]  10.2x.

Track 01: Total bytes read/written: 734308352/734308352 (358549 sectors).

Writing  time:  516.857s

Average write speed   9.7x.

Min drive buffer fill was 50%

Fixating...

Fixating time:    9.907s

wodim: Warning: controller returns wrong page 3 for Ricoh Vendor Page page (30).

cdrecord command:

-----------------------

/usr/bin/cdrecord -v gracetime=2 dev=/dev/hdb speed=10 -dao driveropts=burnfree -data /home/sd/downloads/livecd-i686-installer-2007.0.iso 
```

When I tried to fully erase the CD-RW, the CPU peaked at 100% and the loads went up till 20.00 . The laptop was unresponsive during the whole process but once again the CD-RW was erased. Ended the erasing process the laptop was back to normal.

I never tried to record DVDs in this laptop and so the other day I had the data to do it. Unfortunately two attempts without results. Wasted two DVD+R and the process aborted with the same error (and I think around the same sector) ... I also had kernel errors while this was running and the same CPU 100% problem. 

This is one of the logs from the DVD attempts:

```
System

-----------------------

K3b Version: 0.12.17

KDE Version: 3.5.5

QT Version:  3.3.8

Kernel:      2.6.20-gentoo-r8

Devices

-----------------------

Slimtype DVDRW SLW-831S WRS1 (/dev/hdb, ) at /mnt/dvd [CD-R; CD-RW; CD-ROM; DVD-ROM; DVD-R; DVD-RW; DVD+R; DVD+RW; DVD+R DL] [DVD-ROM; DVD-R Sequential; DVD-RW Restricted Overwrite; DVD-RW Sequential; DVD+RW; DVD+R; DVD+R Double Layer; CD-ROM; CD-R; CD-RW] [SAO; TAO; RAW; SAO/R96P; SAO/R96R; RAW/R16; RAW/R96P; RAW/R96R; Restricted Overwrite]

Used versions

-----------------------

growisofs: 7.0

growisofs

-----------------------

Executing 'builtin_dd if=/tmp/kde-sd/k3b_image.iso of=/dev/hdb obs=32k seek=0'

/dev/hdb: "Current Write Speed" is 8.2x1352KBps.

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

          0/4568309760 ( 0.0%) @0x, remaining ??:?? RBU 100.0% UBU   0.0%

      32768/4568309760 ( 0.0%) @0.0x, remaining 178913:01 RBU 100.0% UBU   0.9%

      65536/4568309760 ( 0.0%) @0.0x, remaining 95264:41 RBU 100.0% UBU 100.0%

      98304/4568309760 ( 0.0%) @0.0x, remaining 67381:51 RBU 100.0% UBU 100.0%

     131072/4568309760 ( 0.0%) @0.0x, remaining 54021:16 RBU 100.0% UBU 100.0%

     163840/4568309760 ( 0.0%) @0.0x, remaining 45540:11 RBU 100.0% UBU 100.0%

     196608/4568309760 ( 0.0%) @0.0x, remaining 39886:06 RBU 100.0% UBU 100.0%

     229376/4568309760 ( 0.0%) @0.0x, remaining 36179:22 RBU 100.0% UBU 100.0%

     262144/4568309760 ( 0.0%) @0.0x, remaining 33108:51 RBU 100.0% UBU 100.0%

     294912/4568309760 ( 0.0%) @0.0x, remaining 30720:40 RBU 100.0% UBU 100.0%

     327680/4568309760 ( 0.0%) @0.0x, remaining 28810:06 RBU 100.0% UBU 100.0%

     360448/4568309760 ( 0.0%) @0.0x, remaining 27458:07 RBU 100.0% UBU 100.0%

     393216/4568309760 ( 0.0%) @0.0x, remaining 26137:49 RBU 100.0% UBU 100.0%

     425984/4568309760 ( 0.0%) @0.0x, remaining 25020:38 RBU 100.0% UBU 100.0%

     458752/4568309760 ( 0.0%) @0.0x, remaining 24063:03 RBU 100.0% UBU 100.0%

     491520/4568309760 ( 0.0%) @0.0x, remaining 23388:00 RBU 100.0% UBU 100.0%

     524288/4568309760 ( 0.0%) @0.0x, remaining 22652:08 RBU 100.0% UBU 100.0%

     557056/4568309760 ( 0.0%) @0.0x, remaining 22002:49 RBU 100.0% UBU 100.0%

     589824/4568309760 ( 0.0%) @0.0x, remaining 21425:38 RBU 100.0% UBU 100.0%

     622592/4568309760 ( 0.0%) @0.0x, remaining 20909:12 RBU 100.0% UBU 100.0%

     655360/4568309760 ( 0.0%) @0.0x, remaining 20560:34 RBU 100.0% UBU 100.0%

     688128/4568309760 ( 0.0%) @0.0x, remaining 20134:30 RBU 100.0% UBU 100.0%

     720896/4568309760 ( 0.0%) @0.0x, remaining 19747:09 RBU 100.0% UBU 100.0%

:-[ WRITE@LBA=170h failed with SK=5h/ASC=21h/ACQ=02h]: Invalid argument

:-( write failed: Invalid argument

/dev/hdb: flushing cache

/dev/hdb: closing track

/dev/hdb: closing disc

growisofs command:

-----------------------

/usr/bin/growisofs -Z /dev/hdb=/tmp/kde-sd/k3b_image.iso -use-the-force-luke=notray -use-the-force-luke=tty -use-the-force-luke=dummy -dvd-compat -speed=8 -use-the-force-luke=bufsize:32m 

mkisofs

-----------------------

I: -input-charset not specified, using utf-8 (detected in locale settings)

  0.02% done, estimate finish Mon May 14 21:00:38 2007

  0.04% done, estimate finish Mon May 14 21:00:38 2007

  0.07% done, estimate finish Mon May 14 21:00:38 2007

  0.09% done, estimate finish Mon May 14 21:00:38 2007

  0.11% done, estimate finish Mon May 14 21:00:38 2007

  0.13% done, estimate finish Mon May 14 21:00:38 2007

  0.16% done, estimate finish Mon May 14 21:00:38 2007

(...)

 99.84% done, estimate finish Mon May 14 21:08:35 2007

 99.86% done, estimate finish Mon May 14 21:08:35 2007

 99.88% done, estimate finish Mon May 14 21:08:35 2007

 99.91% done, estimate finish Mon May 14 21:08:35 2007

 99.93% done, estimate finish Mon May 14 21:08:35 2007

 99.95% done, estimate finish Mon May 14 21:08:35 2007

 99.97% done, estimate finish Mon May 14 21:08:35 2007

Total translation table size: 0

Total rockridge attributes bytes: 75225

Total directory bytes: 186368

Path table size(bytes): 862

Max brk space used a4000

2230620 extents written (4356 MB)

mkisofs command:

-----------------------

/usr/bin/mkisofs -gui -graft-points -volid Elephants_Dreams_DVD2 -volset  -appid K3B -publisher  -preparer  -sysid LINUX -volset-size 1 -volset-seqno 1 -sort /tmp/kde-sd/k3bNbrOob.tmp -rational-rock -hide-list /tmp/kde-sd/k3bRQmgGb.tmp -joliet -hide-joliet-list /tmp/kde-sd/k3b9PQh6a.tmp -full-iso9660-filenames -iso-level 2 -path-list /tmp/kde-sd/k3bVB37uc.tmp
```

and the dmesg output of the same attempt as the previous log:

```
hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 10 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 64

Buffer I/O error on device hdb, logical block 16

Buffer I/O error on device hdb, logical block 17

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 10 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 64

Buffer I/O error on device hdb, logical block 16

Buffer I/O error on device hdb, logical block 17

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 12 00 00 2e 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 72

Buffer I/O error on device hdb, logical block 18

Buffer I/O error on device hdb, logical block 19

Buffer I/O error on device hdb, logical block 20

Buffer I/O error on device hdb, logical block 21

Buffer I/O error on device hdb, logical block 22

Buffer I/O error on device hdb, logical block 23

Buffer I/O error on device hdb, logical block 24

Buffer I/O error on device hdb, logical block 25

Buffer I/O error on device hdb, logical block 26

Buffer I/O error on device hdb, logical block 27

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 10 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 64

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 1f ff c0 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 8388352

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 1f ff c0 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 8388352

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 10 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 64

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 1f ff c0 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 8388352

hdb: irq timeout: status=0xd0 { Busy }

ide: failed opcode was: unknown

/dev/vmmon[11047]: host clock rate change request 83 -> 0

vmmon: Had to deallocate locked 121342 pages from vm driver e6e6c000

vmmon: Had to deallocate AWE 5118 pages from vm driver e6e6c000

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 0

printk: 46 messages suppressed.

Buffer I/O error on device hdb, logical block 0

Buffer I/O error on device hdb, logical block 1

Buffer I/O error on device hdb, logical block 2

Buffer I/O error on device hdb, logical block 3

Buffer I/O error on device hdb, logical block 4

Buffer I/O error on device hdb, logical block 5

Buffer I/O error on device hdb, logical block 6

Buffer I/O error on device hdb, logical block 7

Buffer I/O error on device hdb, logical block 8

Buffer I/O error on device hdb, logical block 9

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 0

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 1f ff c0 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 8388352

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 1f ff c0 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 8388352

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 0

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 1f ff c0 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 8388352

printk: 62 messages suppressed.

Buffer I/O error on device hdb, logical block 2097088

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 0

hdb: command error: status=0x51 { DriveReady SeekComplete Error }

hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }

ide: failed opcode was: unknown

ATAPI device hdb:

  Error: Illegal request -- (Sense key=0x05)

  Logical block address out of range -- (asc=0x21, ascq=0x00)

  The failed "Read 10" packet command was: 

  "28 00 00 1f ff c0 00 00 02 00 00 00 00 00 00 00 "

end_request: I/O error, dev hdb, sector 8388352

printk: 3 messages suppressed.

Buffer I/O error on device hdb, logical block 2097088

hdb: irq timeout: status=0xd0 { Busy }

ide: failed opcode was: unknown

hdb: DMA timeout retry

hdb: timeout waiting for DMA

hdb: status timeout: status=0xd0 { Busy }

ide: failed opcode was: unknown

hdb: drive not ready for command

hdb: status timeout: status=0xd0 { Busy }

ide: failed opcode was: unknown

hdb: drive not ready for command

hdb: status timeout: status=0xd0 { Busy }

ide: failed opcode was: unknown

hdb: drive not ready for command

hdb: status timeout: status=0xd0 { Busy }

ide: failed opcode was: unknown

hdb: drive not ready for command

hdb: status timeout: status=0xd0 { Busy }

ide: failed opcode was: unknown

hdb: drive not ready for command

hdb: status timeout: status=0xd0 { Busy }

ide: failed opcode was: unknown

hdb: drive not ready for command

(...)
```

I also have Windows XP installed on the laptop. To exclude the possibility of hardware problem I tried to record the same DVD data in windows using Nero 7. Everything went fine and the CPU usage was only 2%. The same goes for wiping the CD-RW completely.

With all of this I was hoping someone could shed some light into the problem and help me fix it.

Thanks in advance, for your time, and specially the patience to read all the above  :Smile: 

EDIT: Merge the 2 posts and change the way the kernel config was displayed... (way too many lines there)

----------

## mdr13

Hi SDark,

have a look at that link:

http://fy.chalmers.se/~appro/linux/DVD+RW/tools/

I had some huge performance problems when burning DVD+R, and couldn't get past 4x (with an AthlonXP 2800+, 1Gb RAM and NEC 3500A, should burn at speeds up to 16x). Apparently, the default "memorylocked resource limit" is set to 32 kb (!), and this prevents to use the software buffer (which defaults to 32 Mb for DVD in K3b). Check this by typing:

```
ulimit -a
```

Apparently, your growisofs command tries to set the software buffer to 32 Mb as well, with the "bufsize:32m" instruction:

```
growisofs command:

-----------------------

/usr/bin/growisofs -Z /dev/hdb=/tmp/kde-sd/k3b_image.iso -use-the-force-luke=notray -use-the-force-luke=tty -use-the-force-luke=dummy -dvd-compat -speed=8 -use-the-force-luke=bufsize:32m

```

The workaround that worked for me was:

```
ulimit -l unlimited

```

But this can't be issued as user, so you will have to put it into some init script (I had to put it into /etc/init.d/xdm - if someone has better ideas, please let me know!). To check if it works, try from the tty console as root:

```
ulimit -l unlimited

/etc/init.d/xdm restart

```

After this, my max measured DVD+R burning speed went to 16x as it should be. Let me know if it works!

----------

## SDark

I have to get a couple of DVD+RW for tests, since I'm wasting media because the recording fails... (I've app-cdr/dvd+rw-tools-7.0 installed)

I tried your suggestion and then tried to erase a CD-RW (not the same thing but anyway... what I have is not only dvd related) and the same thing happened. While full erasing the CPU load went till 25 and the computer didn't answer my commands. The only thing that moved was the mouse and as soon as the erasing ended all the windows and commands I triggered during the process started to show up in a flash. They were simply delayed until the erasing process ended and then popped-up all at the same time.

I guess my problem goes to kernel level or at least, something is wrong with the kernel. I tried the gentoo-liveCD and I also get some (not so critical) error messages when hdparm or the CD drive is somewhat tested.

The other day I tried the kubuntu liveCD and I didn't noticed those errors that showed up in the gentoo-liveCD so I'm going to try the kubuntu default kernel config. I'm guessing something must be missing in the kernel for correct performance/behavior.

Will post again with the kubuntu config results. Till then any more info that helps nailing this problem will be welcome.

Thanks

----------

## redpenguin

I think that /etc/limits contains those limits in it. Perhaps fixing the setting there would help instead of adding another init script? I'm going to try it  :Wink: 

----------

## SDark

I tried the kubuntu config but with no results... There seems to be a problem with /dev/ nodes changing names or something and I can't get the system to boot.

At this point I made a list of the default modules and hardware lists presented by hal and other (ls) tools. I'm going to try this custom config with gentoo-sources and see if something changes. If not I guess I will have to go down to kernel devs and see if someone knows anything that could help solve the problem, specially the no-can-do-with-the-computer-while-recording-is-in-progress issue.

@redpenguin Your suggestion might solve some of the problems with dvd progress, but as I said above, my problem is a lot more messy... When I get the CPU hog solved I will try the dvd part too...

Thanks

----------

## mdr13

 *redpenguin wrote:*   

> I think that /etc/limits contains those limits in it. Perhaps fixing the setting there would help instead of adding another init script? I'm going to try it 

 

Good idea, it would be much more elegant. Well, I tried that, ...didn't work   :Confused:  . With /etc/security/limits.conf, I've obtained some results: it works well for decreasing the limits... but as soon as I try to set the "max locked-in-memory address space" over 32 Kb, it simply ignores the setting. Who knows where this limit is set (for root and for all users) in the first place? As I said, the only workaround solution I found was putting the ulimit command in /etc/init.d/xdm.

I also think that as soon as we find out an elegant way to solve this problem, it should be set in the wiki or somewhere visible, because for sure there are plenty of people out there that are limited to 4x DVD writing and don't know why...

SDark, maybe yours is a problem with the chipset support. Check your kernel sources configuration (make menuconfig) under "device drivers" -> "ATA/ATAPI... support", whether your chipset is selected, and recompile the kernel. Hope this helps...

----------

## salahx

You might have better luck with the "new" ide layer (libata).

However, if you do this, you hard disks will change to /dev/sda from /dev/hda, and your cdrom drive will change from /dev/hdb to /dev/sr0. You'll need to modify /etc/fstab and maybe lilo/grub appropriately.

----------

## redpenguin

I found where the limits should be set at. The right file should be /etc/security/limits.conf (this belongs to the pam package, I'm not an expert, but I think everyone uses it anyway).

I added the following lines there (you could put username instead of *, for example):

```

*                hard    memlock         65536

*                soft    memlock         65536

```

The thing is that you need to set the hard limit as well. Problem is - I can't set it to unlimited. So, I must use a fixed value. Btw, I'm using libata, and to no avail. I'm having the DVD burning issues (but probably unrelated to SDark's problems).

@SDark

Did you turn on DMA for you writer?

@mdr13

Yeah, we really need to solve this, I want to burn my discs at 8x at least  :Very Happy: 

----------

## SDark

@ redpenguin

Yes, check the hdparm output in the 1st post: udma2*

@ salahx

Thanks, that is probably the way things where in the ubuntu live CD since the discs where sda instead of hda.

BTW, do you know if the choice of libata affects the performance, for better or worse? and also if this interferes with the use of usb pendrives? These usually go to sda and so on...

----------

## salahx

libata does not affect pendrives, as they do not go through the IDE layer; USB mass storage devices are considered SCSI.

libata performance should be at least as good as the old IDE layer.

----------

## devsk

There are tonnes of kernel problems with cdrom/dvd with both IDE and pata_* drivers from libata. Look at:

http://bugzilla.kernel.org/show_bug.cgi?id=7460

I have only mentioned read errors there but I get write errors too. I think some errors are throwing the kernel off completely. Once it gets into this mode of 'sector errors', almost always you have to reset the PC. If you have a root window on the machine, and drop caches enough number of times, it may allow you to proceed.

----------

## SDark

Hi devsk, thanks for you reply, knowing that this problem is not only affecting me it at least a bit comforting, since I tried almost everything I could find. I was going to try libata today,... Still you mentioned that you also get the same problems with the libata driver. If so, there is no point in trying it too since has the same buggy problems.

I noticed today that aside from the recording problems, I get those errors by simply inserting a blank CD-RW and trying to mount it. dmesg dumps stuff like:

 *Quote:*   

> May 27 19:23:33 darksun hdb: command error: status=0x51 { DriveReady SeekComplete Error }
> 
> May 27 19:23:33 darksun hdb: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
> 
> May 27 19:23:33 darksun ide: failed opcode was: unknown
> ...

 

After this I used that same CD-RW to record the minimal gentoo-liveCD and I was able to mount it without any kind of errors. However when I did the unmount, eject steps:

 *Quote:*   

> ---------Mount------
> 
> May 27 20:12:10 darksun ISO 9660 Extensions: Microsoft Joliet Level 3
> 
> May 27 20:12:10 darksun ISO 9660 Extensions: RRIP_1991A
> ...

 

Do you have any tips you can share? or tests I could do?

I noticed that in the kernel bug you linked above, they mentioned HAL. I never used it and I have the same problems.

----------

## devsk

I have no clue. Typically, I have noticed that if you drop caches, the errors go away for a while (and they eventually return). But this is not a solution which works in general. In livecd environment, its ok to drop caches and not suffer much but in a real install, its pretty bad.

I think its a kernel bug, and someone from kernel team needs to fix it. The only thing is that the kernel devs usually want to do newer hardcore stuff and are not inclined towards fixing bugs. I wish Linus would put stop to new features into kernel until bug count is reduced to 100 or something. That will motivate people to fix bugs before merging in new stuff, if they really want their new stuff in the kernel.

----------

## SDark

Ok I'm on libata now, and as far as I can tell I see no more errors in the logs, however I still have the lockups when erasing the CD-RW ... I just now hit a new load peak record - 72.14

Don't know why but changing to libata made my touchscreen stop working. I simply disabled the ATA/ATAPI interfaces and added the libata (sata) support.

Can I have both ATA/ATAPI and PATA/SATA (libata) enabled in the kernel without expecting compatibility problems?

With this driver there is also another problem, I can't get any info with hdparm but it seems that is normal:

 *Quote:*   

> HDIO_DRIVE_CMD(identify) failed: Input/output error

 

and with sdparm I don't understand the output.

I'm now also testing the hardrive speeds with hdparm, it seems that the speeds are a bit better with this driver.

----------

## zorth

hi guys. i have a similar problem using vanilla-sources 2.6.21.1 with a LG sata dvd writer with k3b. i can read writed cds and dvds, but i can´t write dvds. when i tried to write a dvd, i see a error message from k3b saying: " error, recording failed ". my dmesg:

```

cdrom: This disc doesn't have any tracks I recognize!

ata7.00: exception Emask 0x2 SAct 0x0 SErr 0x800400 action 0x2

ata7.00: (irq_stat 0x08000000)

ata7.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x2a data 32768 out

         res 50/00:03:00:00:00/00:00:00:00:00/a0 Emask 0x2 (HSM violation)

ata7: soft resetting port

ata7: softreset failed (1st FIS failed)

ata7: softreset failed, retrying in 5 secs

ata7: hard resetting port

ata7: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata7.00: configured for UDMA/100

ata7: EH complete

cdrom: This disc doesn't have any tracks I recognize!

attempt to access beyond end of device

sr0: rw=0, want=68, limit=4

isofs_fill_super: bread failed, dev=sr0, iso_blknum=16, block=16

```

i have scsi && sata support [*] at kernel config. with gentoo-souces 2.6.20-x when i finish to write a dvd, the dvdrw dont eject it. i must to restart the computer to eject the dvd. i´m using verbatim x16 -R

i hope you can find a solution to this problem because i m desperated with this fu### history :S

sorry for my english, i only speak spanish. regards.

----------

## mdr13

 *redpenguin wrote:*   

> I found where the limits should be set at. The right file should be /etc/security/limits.conf 

 

Thanks, redpenguin. It worked for me too. I've done some research as well, and I found out that:

* /etc/limits is read only if PAM is not running

* /etc/security/limits.conf only if PAM is running

Anyway, using PAM, you can add the following lines to /etc/security/limits.conf to set the locked memory "as big as possible", which is equivalent to unlimited:

```
*  -  memlock  -1

```

where '-1' means 4 Gb in my computer (and I guess in everyone else's 32 bit computer), and '-' sets both hard and soft limit. Anyway, I would not recommend to put the locked memory to unlimited, since this may expose the computer to faulty or malicious software. After all, the limits are for your security...

Do you still get DVD burning problems even after changing the limits?

----------

## redpenguin

Well, with limit of 65536 I still had no luck :/ I'm not sure if I should increase it a bit more. (I might try 2.6.15 kernel as well)

----------

## Inte

 *zorth wrote:*   

> hi guys. i have a similar problem using vanilla-sources 2.6.21.1 with a LG sata dvd writer with k3b.

 

Interesting I have a similar problem while formatting CD-RWs in a LG sata dvd device (LG HL-DT-ST DVDRAM GSA-H62N). Newest gentoo-sources (2.6.23-gentoo-r3) and Xfburn are installed. Controller is a Promise Technology, Inc. PDC20579 SATAII 150 IDE Controller (rev 02).

```
Dec 14 17:13:25 stalker ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2

Dec 14 17:13:25 stalker ata2.00: port_status 0x20080000

Dec 14 17:13:25 stalker ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0xbe data 65536 in

Dec 14 17:13:25 stalker res 50/00:03:00:90:09/00:00:00:00:00/e0 Emask 0x2 (HSM violation)

Dec 14 17:13:26 stalker ata2: soft resetting port

Dec 14 17:13:26 stalker ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

Dec 14 17:13:26 stalker ata2.00: configured for UDMA/100

Dec 14 17:13:26 stalker ata2: EH complete

Dec 14 17:13:26 stalker ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2

Dec 14 17:13:26 stalker ata2.00: port_status 0x20080000

Dec 14 17:13:26 stalker ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0xbe data 65536 in

Dec 14 17:13:26 stalker res 50/00:03:00:90:09/00:00:00:00:00/e0 Emask 0x2 (HSM violation)

Dec 14 17:13:27 stalker ata2: soft resetting port

Dec 14 17:13:27 stalker ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

Dec 14 17:13:27 stalker ata2.00: configured for UDMA/100

Dec 14 17:13:27 stalker ata2: EH complete
```

----------

