# Big problems with dvd writing (Tried everything)

## Snoozz

Hi there,

I have a MATSHITA DVD-RAM UJ-831S 24x writer  Rev: 1.50 (Acer travelmate 8104) and I have problems with burning.

I've set writing speed /mode on auto, but still when I try to burn a cd, he says:

Probably a buffer underrun occurred

Please choose a lower burning speed

I mean, wtf, I'm going nuts with the fact I can't get my DVD drive working properly :s.

Kernel config:

```

  Device Drivers -->

     ATA/ATAPI/MFM/RLL support disabled

  Device Drivers -->

     SCSI device support -->

       * SCSI disk support

       * SCSI CDROM support

           * Enable vendor specific extensions

       * Probe all LUNs on each SCSI device 

      SCSI low-level drivers -->

        * Serial ATA support

           * INTEL PIXX/ICH sata support

```

lspci

```

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

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

00:1b.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 04)

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:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 04)

00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA 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)

06:03.0 Network controller: Intel Corporation PRO/Wireless 2915ABG Network Connection (rev 05)

06:06.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5788 Gigabit Ethernet (rev 03)

06:07.0 FireWire (IEEE 1394): Texas Instruments TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)

06:09.0 CardBus bridge: O2 Micro, Inc. OZ711M3/MC3 4-in-1 MemoryCardBus Controller

06:09.1 CardBus bridge: O2 Micro, Inc. OZ711M3/MC3 4-in-1 MemoryCardBus Controller

06:09.2 System peripheral: O2 Micro, Inc. OZ711Mx 4-in-1 MemoryCardBus Accelerator

06:09.3 CardBus bridge: O2 Micro, Inc. OZ711M3/MC3 4-in-1 MemoryCardBus Controller

```

dmesg output

```

scsi0 : ata_piix

ata1.00: ATA-6, max UDMA/100, 234441648 sectors: LBA48

ata1.00: ata1: dev 0 multi count 16

ata1.00: applying bridge limits

ata1.00: configured for UDMA/100

  Vendor: ATA       Model: ST9120821A        Rev: 3.04

  Type:   Direct-Access                      ANSI SCSI revision: 05

ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x18A8 irq 15

scsi1 : ata_piix

Synaptics Touchpad, model: 1, fw: 5.9, id: 0x126eb1, caps: 0xa04713/0x4000

ata2.00: ATAPI, max UDMA/33

input: SynPS/2 Synaptics TouchPad as /class/input/input1

ata2.00: configured for UDMA/33

  Vendor: MATSHITA  Model: DVD-RAM UJ-831S   Rev: 1.50

  Type:   CD-ROM                             ANSI SCSI revision: 05

SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

 sda: sda1 sda2 sda3 sda4 < sda5 sda6 >

sd 0:0:0:0: Attached scsi disk sda

sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray

Uniform CD-ROM driver Revision: 3.20

sr 1:0:0:0: Attached scsi CD-ROM sr0

```

Please help me because I'm going crazy  :Sad: .

Ps: Dvd's run smoothly and I can copy files from a cd to hard disk at speed of 2mb/s (but only with data cd's, when I try to copy files from a music cd, It goes at a sluggish 400 kb/s :s)

----------

## playahater

maybe a bug in software or something like that .. try burinig and erasing from command line .. 

update all cd/dvd tools and try .. 

try from the command line as root .. and see what happens ..

Cheers

----------

## Snoozz

Nope, doesn't change a thing  :Sad: 

*EDIT*

Ok, running cdrecord from shell seems to be working:

```

cdrecord dev=/dev/sr0 /home/yannick/Shared/*

cdrecord: No write mode specified.

cdrecord: Asuming -tao mode.

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

Cdrecord-ProDVD-Clone 2.01.01a11 (i686-pc-linux-gnu) Copyright (C) 1995-2006 JÃ¶rg Schilling

scsidev: '/dev/sr0'

devname: '/dev/sr0'

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

Warning: Open by 'devname' is unintentional and not supported.

Linux sg driver version: 3.5.27

Using libscg version 'schily-0.8'.

Device type    : Removable CD-ROM

Version        : 5

Response Format: 2

Capabilities   :

Vendor_info    : 'MATSHITA'

Identifikation : 'DVD-RAM UJ-831S '

Revision       : '1.50'

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

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

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

WARNING: padding up to secsize.

Track 01: Total bytes read/written: 2609703/2611200 (1275 sectors).

WARNING: padding up to secsize.

Track 02: Total bytes read/written: 4890816/4892672 (2389 sectors).

```

But it's still pretty slow...

----------

## playahater

 *Snoozz wrote:*   

> Nope, doesn't change a thing 

 

have you compiled a writing support in kernel .. ??

device drivers > block devices > packet writing on cd/dvd media, free buffers and write caching

----------

## wynn

For some time, SCSI emulation hasn't been needed to write to ATAPI DVD/CDs, you can just use the IDE device name like /dev/hdc.

Perhaps you can remove SCSI emulation from your kernel, that is "SCSI CDROM support" and, of course, "Enable vendor specific extensions" and "Probe all LUNs on each SCSI device".

Then, on boot, see what device is assigned to your burner and use that.

If it is slow then probably DMA isn't enabled for it, this might be a consequence of making it SCSI-like. Check by running hdparm.

----------

## Snoozz

Allright, I'll try that. I also activated cdrom support in the ATA/ATAPI/MFM/RLL section (and disabled generic ide support). Because If I don't enable this, My guess would be that he doesn't see my cdrom drive at all

Thnx for the help  :Smile: 

----------

## wynn

 *Quote:*   

> I also activated cdrom support in the ATA/ATAPI/MFM/RLL section 

 Yes, sorry, forgot that. So much for trying to be helpful   :Sad: 

```
<*>     generic/default IDE chipset support
```

is enabled here and doesn't seem to hurt.

----------

## Snoozz

Allright Allright, we're getting closer to it  :Very Happy: 

I used this in my kernel config and now I get a hdc device with everything on for speed EXCPET dma (can't get it working, maybe it's enable without it's showing up in hdparm)

```

/dev/hdc:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

I can now start burning at 24X, but the strange thing IS:

Let's say I want to burn 700mb of data:

The first 100mb he goes at 8x, then he goes at 12x, around 500mb he changes to 19x and so on.

I mean, who can explain this and is it fixable. Because I would like to use my DVD ram drive like it was ment to be used (at 24x)

I want to thank you guys for the help you already gave, because without it, I would still be messing around with a sr0 device  :Smile: 

grtz

----------

## chalex20

 *Snoozz wrote:*   

> Let's say I want to burn 700mb of data:
> 
> The first 100mb he goes at 8x, then he goes at 12x, around 500mb he changes to 19x and so on.
> 
> I mean, who can explain this and is it fixable. Because I would like to use my DVD ram drive like it was ment to be used (at 24x)
> ...

 

High-speed burners are always like this, i.e, "24x" means that it is able to reach 24x if given an opportunity to.

----------

## bollucks

You're not getting DMA access - this means you're using the generic IDE driver as you've already showed you have configured in support for. You need support for your IDE chipset or all transfers will always suck cpu and be slower. Compile in support for PIIX into your kernel and disable the generic driver.  This article is about audio but shows you how to compile in support for dma: http://ck.kolivas.org/faqs/audio_hints.txt

----------

## wynn

 *Quote:*   

> The first 100mb he goes at 8x, then he goes at 12x, around 500mb he changes to 19x and so on.

 This is a physical restriction of the process.

Spindle Motor, Constant Linear Velocity (CLV) and Constant Angular Velocity (CAV) *Quote:*   

> Virtually all of these drives up to about 12X or so still vary the motor speed to maintain constant linear velocity. As the speed of the drives has increased, many newer drives have come out that actually revert back to the CAV method used for hard disks. In this case, their transfer rate will vary depending on where on the disk they are working, again, just like it does for a hard disk. The "X" rating can be somewhat specious for these drives, since they achieve it only--at best--at the outer edge of the disk. No CAV drive claiming to be 24X actually transfers at that rate over the whole disk.

 It is unfair to quote any larger portion of this excellent guide, please go to the URL and read it there.

----------

## Snoozz

I'm running a kernel with generic ide support disabled right now, but it doesn't change anything. The problem is that my DVD drive is not a REAL ide device, but it's connected to the sata controler.(So probably, dma is enabled without hdparm can see it)

Because hdparm -I gives me this:

```

/dev/hdc:

ATAPI CD-ROM, with removable media

        Model Number:       MATSHITADVD-RAM UJ-831S

        Serial Number:

        Firmware Revision:  1.50

Standards:

        Likely used CD-ROM ATAPI-1

Configuration:

        DRQ response: 50us.

        Packet size: 12 bytes

Capabilities:

        LBA, IORDY(can be disabled)

        DMA: sdma0 sdma1 sdma2 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

HW reset results:

        CBLID- below Vih

        Device num = 1

```

As you can see on the lspci

```

00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 04)

```

When I run hdparm a couple of time I get these results, are they normal?

```

Welles yannick # hdparm -tT /dev/hdc

/dev/hdc:

 Timing cached reads:   3564 MB in  1.99 seconds = 1788.88 MB/sec

BLKFLSBUF failed: Function not implemented

 Timing buffered disk reads:    6 MB in  4.13 seconds =   1.45 MB/sec

BLKFLSBUF failed: Function not implemented

Welles yannick # hdparm -tT /dev/hdc

/dev/hdc:

 Timing cached reads:   3440 MB in  1.99 seconds = 1724.63 MB/sec

BLKFLSBUF failed: Function not implemented

 Timing buffered disk reads:   10 MB in  3.94 seconds =   2.54 MB/sec

BLKFLSBUF failed: Function not implemented

Welles yannick # hdparm -tT /dev/hdc

/dev/hdc:

 Timing cached reads:   3564 MB in  1.99 seconds = 1787.48 MB/sec

BLKFLSBUF failed: Function not implemented

 Timing buffered disk reads:   14 MB in  3.91 seconds =   3.58 MB/sec

BLKFLSBUF failed: Function not implemented

Welles yannick # hdparm -tT /dev/hdc

/dev/hdc:

 Timing cached reads:   3596 MB in  1.99 seconds = 1804.04 MB/sec

BLKFLSBUF failed: Function not implemented

 Timing buffered disk reads:   18 MB in  3.82 seconds =   4.72 MB/sec

BLKFLSBUF failed: Function not implemented

```

I've read the article, and I'm wondering if my DVD drive (in a Travelmate 8104) isn't new enough to use the CAV method :s.

But I think you're right, I just tried to burn a cd in windows and it does the same thing. BUT, I think that I didn't have this problem a while ago. Is there something I changed that made it use the slower mehod ?

Because I just burned a music cd and if I want to copy the files to my harddisk it goes at 25kb/S :s (This is only with music cd's). Is my DVD drive giving it's last breath?

----------

## wynn

Your hdparm output says that dma is already enabled

```
        DMA: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 *udma2 
```

 *Quote:*   

> When I run hdparm a couple of time I get these results, are they normal?

 Your DVD burner says it is UDMA33 so, even connected to a SATA port, that's its limit.

On a SATA drive here (equivalent to UDMA150) gives

```
Timing buffered disk reads:  164 MB in  3.01 seconds =  54.45 MB/sec
```

pro rata with UDMA33 at top speed is 11 to 12 MB/sec so your drive is running slower than need be.

However, from your first post, you already have "Intel PIIX/ICH SATA support" in your kernel configuration.

 *Quote:*   

> So let me get this right, when you burn a cd in windows and it says 24x when it's burning. It's not really 24x

 It would confuse Granny (her grandchildren bought her a Windows machine for her birthday) if Windows/Nero said what the speed actually was and it was different to what was on the packet.

But for us Linuxers (++ Gentooers) â we understand, dont we?

[Edit (just seen it)] *Quote:*   

> and I'm wondering if my DVD drive (in a Travelmate 8104) isn't new enough to use the CAV method 

 Your DVD burner includes CD burning capability up to 24x: I can't see (except see under) that it could use CLV.

 *Quote:*   

> Because I just burned a music cd and if I want to copy the files to my harddisk it goes at 25kb/S :s (This is only with music cd's). Is my DVD drive giving it's last breath?

 I think audio CDs may have to be written at the standard audio CD speed of 150 kilobits/second which is about 18 kilobytes/second. As the article says, it may have to use CLV for this which (maybe) it can't do at greater speeds.

----------

## Snoozz

So, there is just no chance in hell that I'll get my dvd drive to go faster than it is going right now  :Sad: .

PS: Is this Hdparm result normal for a seagate 5400.2 MOMENTUM (notebook) hdd

```

/dev/sda:

 Timing cached reads:   3472 MB in  1.99 seconds = 1741.51 MB/sec

 Timing buffered disk reads:  118 MB in  3.00 seconds =  39.30 MB/sec

```

----------

## wynn

 *Quote:*   

> So, there is just no chance in hell that I'll get my dvd drive to go faster than it is going right now

 Perhaps not, there is a thread matshita dvd-ram uj-831s *Quote:*   

> hey i have this dvd burner in my laptop and for some reason it won't burn at 8x dvd+R speeds, only burns at 4x speeds. i have the fujitsu n3510 book and TDK 8x dvd+R media. the drive speeds are as follows: Dual Layer Multi-Format DVD Writer: (8x DVD-R/+R, 2.4x DVD+R DL, 4x DVD-RW/+RW, 3x DVD-RAM, 8x DVD-ROM, 24x CD-R, 10x CD-RW, 24x CD-ROM)

 which leads on to think it's a firmware problem. Can you get support from Acer? They talk about getting updated firmware for the drive.

SATA performance lacking has some numbers. they are higher than yours but that may be because they are desktop machines.

----------

## Snoozz

I mailed to acer to confirm if it's a firmware driver. I never liked Matshita and now I do even less. The writer in my desktop is a year older dan this one and that one DOES write at 24x.

Oh well, probably something I'll have to live with!

Thnx for the help!!!

grtz

----------

## exobuzz

ICH6 is now handled by the scsi sata-piix driver. However I still have some burning problems when writing with the scsi driver (dvd's seem to work but not cd's). However, I had everything fully working before by not using the scsi drivers at all, and by forcing the kernel to use the ide drivers.

Check this patch

http://lwn.net/Articles/142499/

If you apply this, it should use the piix ide drivers (rather than generic), which should give you the dma support you need.

----------

