# SATA DVD recodrer problem

## mpytasz

Hi,

Has anyone experienced similar problem ? I can't burn CDs at all, DVDs tend to burn, but get messed up.

The drive is Pioneer DVR212. On attempt to burn iso CD image I get:

cdrecord with no parameters but iso file:

```

cdrecord: No write mode specified.

cdrecord: Asuming -sao mode.

cdrecord: If your drive does not accept -sao, try -tao.

cdrecord: Future versions of cdrecord may have different drive dependent defaults.

Cdrecord-ProDVD-ProBD-Clone 2.01.01a38 (x86_64-unknown-linux-gnu) Copyright (C) 1995-2008 Jörg Schilling

Linux sg driver version: 3.5.34

Using libscg version 'schily-0.9'.

No target specified, trying to find one...

Using dev=1,0,0.

Device type    : Removable CD-ROM

Version        : 5

Response Format: 2

Capabilities   :

Vendor_info    : 'PIONEER '

Identifikation : 'DVD-RW  DVR-212 '

Revision       : '1.22'

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

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 LAYER_JUMP

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

Last chance to quit, starting real write    0 seconds. Operation starts.

Turning BURN-Free off

cdrecord: Input/output error. write_g1: scsi sendcmd: no error

CDB:  2A 00 FF FF FF FA 00 00 06 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 06 00 00 20 0E 24 08 11 40 A8 04 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0xA8 Qual 0x04 (vendor unique sense code 0xA8) [No matching qualifier] Fru 0x0

Sense flags: Blk 100663328 (not valid)

cmd finished after 0.010s timeout 200s

write track pad data: error after 294912 bytes

BFree: 862 K BSize: 1152 K

cdrecord: Input/output error. write_g1: scsi sendcmd: no error

CDB:  2A 00 00 00 00 00 00 00 10 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0

Sense flags: Blk 0 (not valid)

cmd finished after 0.005s timeout 200s

write track data: error after 0 bytes

cdrecord: The current problem looks like a buffer underrun.

cdrecord: Try to use 'driveropts=burnfree'.

cdrecord: Make sure that you are root, enable DMA and check your HW/OS set up.

cdrecord: Input/output error. flush cache: scsi sendcmd: no error

CDB:  35 00 00 00 00 00 00 00 00 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 04 00 00 00 00 0E 00 00 00 00 44 00 00 00

Sense Key: 0x4 Hardware Error, Segment 0

Sense Code: 0x44 Qual 0x00 (internal target failure) Fru 0x0

Sense flags: Blk 0 (not valid)

cmd finished after 15.567s timeout 200s

Trouble flushing the cache

```

ok, in this case explicitly selected tao:

```

Cdrecord-ProDVD-ProBD-Clone 2.01.01a38 (x86_64-unknown-linux-gnu) Copyright (C) 1995-2008 Jörg Schilling

Linux sg driver version: 3.5.34

Using libscg version 'schily-0.9'.

No target specified, trying to find one...

Using dev=1,0,0.

Device type    : Removable CD-ROM

Version        : 5

Response Format: 2

Capabilities   :

Vendor_info    : 'PIONEER '

Identifikation : 'DVD-RW  DVR-212 '

Revision       : '1.22'

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

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 LAYER_JUMP

Starting to write CD/DVD/BD at speed 40 in real TAO mode for single session.

Last chance to quit, starting real write    0 seconds. Operation starts.

cdrecord: Input/output error. write_g1: scsi sendcmd: no error

CDB:  2A 00 00 00 00 00 00 00 10 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 64 00 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x64 Qual 0x00 (illegal mode for this track) Fru 0x0

Sense flags: Blk 0 (not valid)

cmd finished after 0.001s timeout 40s

write track data: error after 0 bytes

cdrecord: A write error occured.

cdrecord: Please properly read the error message above.

cdrecord: Input/output error. close track/session: scsi sendcmd: no error

CDB:  5B 00 02 00 00 00 00 00 00 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 04 00 00 00 00 0E 00 00 00 00 44 D6 00 00

Sense Key: 0x4 Hardware Error, Segment 0

Sense Code: 0x44 Qual 0xD6 (internal target failure) [No matching qualifier] Fru 0x0

Sense flags: Blk 0 (not valid)

cmd finished after 41.668s timeout 480s

cmd finished after 41.668s timeout 480s

cdrecord: Cannot fixate disk.

```

The problem exists with cdrecord as well as wodim. I tried windows (nero which came with the drive) and the drive works there... 

I am running gentoo-sources 2.6.25-r3 at the moment, but the problem exists at least since 2.6.19 (when I was forced to change the drive).

Previously I had ATA Pioneer which did work fine. In terms of writing behaviour, it does not make a difference if in kernel ATA part is selected or not (just SATA/PATA part, and that is how it is right now for amd64). 

I have seen some similar problems found by google, however all mentioned ubuntu, and no gentoo cases. (just one of many posts can be found here http://ubuntuforums.org/showthread.php?t=684481 however if there is any solution suggested, they say that kernel should be, depending on post, above or at least 2.6.22 which in my case - just is... ). I have to add that there are no problems reading any disks with the drive in linux (data or audio - with digital extraction). Also the write attempt was done as root (however drive permissions are correct). I get no useful information in system logs. The only thing that appears is just information about inserted new, empty disc (hal and dbus running):

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

Problem does not depend on arch (amd64/i686), here is output from wodim, same PC just 32b system (and ATA part of kernel with IDE DMA):

```

Device was not specified. Trying to find an appropriate drive...

Looking for a CD-R drive to store 696.46 MiB...

Detected CD-R drive: /dev/cdrw

Using /dev/cdrom of unknown capabilities

Device type    : Removable CD-ROM

Version        : 5

Response Format: 2

Capabilities   :

Vendor_info    : 'PIONEER '

Identification : 'DVD-RW  DVR-212 '

Revision       : '1.22'

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

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

Speed set to 7056 KB/s

Starting to write CD/DVD at speed  40.0 in real TAO mode for single session.

Last chance to quit, starting real write i   0 seconds. Operation starts.

Errno: 5 (Input/output error), write_g1 scsi sendcmd: no error

CDB:  2A 00 00 00 00 00 00 00 1F 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 07 00 00 20 0E 24 01 11 40 A8 01 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0xA8 Qual 0x01 (vendor unique sense code 0xA8) [No matching qualifier] Fru 0x0

Sense flags: Blk 117440544 (not valid)

cmd finished after 2.083s timeout 40s

write track data: error after 0 bytes

wodim: A write error occured.

wodim: Please properly read the error message above.

Errno: 5 (Input/output error), close track/session scsi sendcmd: no error

CDB:  5B 00 02 00 00 00 00 00 00 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 64 00 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x64 Qual 0x00 (illegal mode for this track) Fru 0x0

Sense flags: Blk 0 (not valid)

cmd finished after 0.013s timeout 480s

cmd finished after 0.013s timeout 480s

wodim: Cannot fixate disk.

```

Any suggestions ? I am not sure what additional information could be helpful in solving/debugging ? kernel config, emerge --info ?

To be honest I just did not care about it much since I did not need to burn disks with this computer for a while, but well... it appeared I do now. 

Michal

----------

## Keruskerfuerst

SATA cable and power connectors?

----------

## mpytasz

Thanks for the reply, but... well... 

I have tested 2 data cables. Moreover, if the problem was in data - the drive would have problems reading (would be at least slow), if there were such errors with writing probably burnproof could solve it - but it does not.  

Do you think there could be a power problem ? There are no writing problems in windows therefore it does not look to me like it, but... well it does not hurt to check it. Power supply is rather fine (it is not a cheap no-name, although it is around 3 years old 360W Chieftec...).

Is there a way to add (much) more verbosity/debug to the recording ? There is a timeout information - but  in multiple attempts it occures exactly in the same moment - as if the command sent was wrong/misinterpreted/ignored by the drive.

Michał

----------

## Keruskerfuerst

You can check out the man pages of cdrecord / wodim for more information during the recording session.

----------

## olger901

Try to fully disabling IDE and enabling the SATA drivers in your kernel, and then accessing your CD-Rom through /dev/sr0

----------

## mpytasz

Keruskerfuerst: thanks for the hint, however the debug (for me) is next to useless - I have no idea about protocol for recording disks. The debug output (imho too long to paste here) is here: http://pastebin.com/m147206b8

I also tried cdrdao - whether it is wodim/cdrecord problem or rather something closer to... kernel. cdrdao does not work either, the debug output looks like this: 

```

Starting write at speed 10...

Pausing 10 seconds - hit CTRL-C to abort.

Process can be aborted with QUIT signal (usually CTRL-\).

Lead-in start: 97:34:23 length: 10927

Lead-out length: 6750

Using pthread POSIX real time scheduling.

Memory locked

Using pthread POSIX real time scheduling.

Waiting for reader process

Swap: 1

Buffer filled

Awaken, will start writing

Turning BURN-Proof on

Multi session mode: 0

Data block type: 0

Session format: 0

Toc type: 0x0

Drive accepted write parameter mode page variant 0.

Executing power calibration...

Power calibration successful.

Track is Blank, Next Writable Address is valid

NWA: -150

Cue Sheet (variant 0):

CTL/  TNO  INDEX  DATA  SCMS  MIN  SEC  FRAME

ADR               FORM

01    00    00     01    00   00   00   00

01    01    00     00    00   00   00   00

01    01    01     00    00   00   02   00

01    02    00     00    00   15   51   31

01    02    01     00    00   15   54   35

01    03    00     00    00   26   21   43

01    03    01     00    00   26   24   00

01    04    00     00    00   41   14   16

01    04    01     00    00   41   17   32

01    05    01     00    00   47   58   20

01    aa    01     01    00   66   14   10

Drive accepted cue sheet variant 0.

?: Input/output error.  : scsi sendcmd: no error

CDB:  2A 00 FF FF FF 9E 00 00 1A 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 06 00 00 20 0E 24 08 11 40 A8 04 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0xA8 Qual 0x04 (vendor unique sense code 0xA8) [No matching qualifier] Fru 0x0

Sense flags: Blk 100663328 (not valid)

cmd finished after 0.012s timeout 180s

ERROR: Write data failed.

ERROR: Writing failed.

```

I am not even close to knowing about addresing sectors during write, but 

 *Quote:*   

> 
> 
> Executing power calibration...
> 
> Power calibration successful.
> ...

 

Looks quite suspicious to me.

Olger901:

Thanks for the reply - this is exactly how it is now. Only SATA/PATA part is enabled, ATA part is fully disabled in kernel. This is my kernel config:

http://pastebin.com/m7bebe383

I have 1 IDE disk, therefore driver for PATA is enabled. This is my lspci:

```

00:00.0 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.1 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.2 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.3 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.4 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.7 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI bridge [K8T800/K8T890 South]

00:06.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

00:07.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder (rev 03)

00:07.1 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port] (rev 03)

00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

00:0f.0 IDE interface: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80)

00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)

00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South]

00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

01:00.0 VGA compatible controller: ATI Technologies Inc RV350 AS [Radeon 9550]

01:00.1 Display controller: ATI Technologies Inc RV350 AS [Radeon 9550] (Secondary)

```

On SATA there is 1 Seagate Barracuda.ES, 1 Pioneer DVR-212

On PATA: 1 Maxtor 6Y120L0

Michał

----------

## olger901

Would you mind running dmesg and posting the output either here or in a pastebin? Cause I'd like to see how your system registers and accesses the DVD-/+RW, you can check yourself either way though:

See if your CD-Rom drive is registered as a /dev/hdx device (if this is the case, then thats likely to be your problem) or a /dev/srx device (if this is the case, then this is likely not the problem)

EDIT:

I threw the error in Google and the hardware error seems to indicate that there is a problem with the DVD-/+RW burner, this can have various reasons:

- Wrong kernel drivers (See above)

- Firmware issue (I'd like to suggest to update the firmware to the latest version)

- Faulty hardware (If this is the case, I'd like to suggest to turn in the optical drive for a replacement)

Another thing I'd like to suggest is trying to disable the PATA driver in the kernel and physically disconnecting it as well and see what that does.

----------

## mpytasz

Thanks for reply,

 *Quote:*   

> 
> 
> Would you mind running dmesg and posting the output either here or in a pastebin? Cause I'd like to see how your system registers and accesses the DVD-/+RW, you can check yourself either way though:
> 
> 

 

Only lines that do appear:

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

warning: `wodim' uses 32-bit capabilities (legacy support in use)

32b part on amd64 does look suspicious, but since in i686 system it does not work either... well I gues it's ok.

Full dmesg (everything from startup) here:

http://pastebin.com/m3abccd8d

emerge --info:

http://pastebin.com/m915520f

 *Quote:*   

> 
> 
> See if your CD-Rom drive is registered as a /dev/hdx device (if this is the case, then thats likely to be your problem) or a /dev/srx device (if this is the case, then this is likely not the problem)
> 
> 

 

It is /dev/sr0

 *Quote:*   

> 
> 
> I threw the error in Google and the hardware error seems to indicate that there is a problem with the DVD-/+RW burner, this can have various reasons:
> 
> - Wrong kernel drivers (See above)
> ...

 

Well, maybe, but I ran out of ideas, as I wrote - I tested various possibilities (enabling or disabling IDE/ATA/ATAPI, now it is completly disabled, just SATA/PATA, I do need PATA for one hd). I would test the drive with a different PC (different SATA controller + driver) if I had a chance, because VIA controller is something I do not trust that much (once I had Via Unichrome graphics in laptop - I had more than enough of VIA).

 *Quote:*   

> 
> 
> - Firmware issue (I'd like to suggest to update the firmware to the latest version)
> 
> 

 

Just upgraded to the latest available 1.24

 *Quote:*   

> 
> 
> - Faulty hardware (If this is the case, I'd like to suggest to turn in the optical drive for a replacement)
> 
> 

 

Well, it works in windows - with bundled Nero, so faulty hardware does not seem to be the case, I suspect kernel error, or one between a chair and my keyboard  :Wink: 

 *Quote:*   

> 
> 
> Another thing I'd like to suggest is trying to disable the PATA driver in the kernel and physically disconnecting it as well and see what that does.
> 
> 

 

Well... ok, I did that, disabled everything but VIA SATA (ATA, PATA disabled) - no change (beside not seing ATA hd).

Michał

----------

