# Cdrom speed

## Herodot

Hi.

I have a hp8100 cdrw. I have "hdc=ide-scsi" in grub. I have compiled the kernel with scsi-support. It works fine as scsi, cdrecord scanbus gives OK results.

The problem is this: When I transfer a large file (~600MB) from cd to hd, the transfer slows to a halt after ~200MB. It's quite impossible to use. And throughout the transfer the system is very slow and unresponsive.

I would think this is because the cd isn't using dma. But when using the scsi emulation, is that an issue at all? All hard disks use dma, and work fine.

I can't use hdparm to check or set dma. No matter which /dev/? or /mnt/? I try for the cd, I get "not supported by hdparm"

There is also the question of whether ide is used at all. I have IDE CD support in the kernel, but no /dev/hdc. That is taken by the "hdc=ide-scsi" I believe. should I remove IDE CD support from the kernel?

Thanks,

Herodot

----------

## Herodot

OK, I've done some Googling.

hdparm can't access scsi-devices. we can't have both ide-cd and scsi-cd in the kernel (although I'm sure redhat does this...). To burn cds, scsi-cd is needed.

The problem is: how do we set dma for the cd without hdparm?

Someone has suggested compiling ide-cd as a module. load it, set dma and unload before scsi is loaded. this seems very clumsy to me, and i'm not even sure it would work.

Setting parameters in /proc/ide/hd?/settings has no effect.

There is a kernel patch that gives hdparm access to scsi-cd - but it's too difficult for me to patch.

doesn't anybody alse have these problems?

 - Herodot

----------

## Herodot

It seems I all alone in this thread...

I've managed to enable dma on the (ide-scsi) cd:

```

cat /proc/ide/hdc/settings

name         value      min      max      mode

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

bios_cyl                0               0               1023            rw

bios_head               0               0               255             rw

bios_sect               0               0               63              rw

current_speed           34              0               70              rw

ide_scsi                0               0               1               rw

init_speed              12              0               70              rw

io_32bit                1               0               3               rw

keepsettings            0               0               1               rw

log                     0               0               1               rw

nice1                   1               0               1               rw

number                  2               0               3               rw

pio_mode                write-only      0               255             w

slow                    0               0               1               rw

transform               1               0               3               rw

unmaskirq               1               0               1               rw

using_dma               1               0               1               rw

```

This didn't help. In no way.

Speed from the cd is still unusably low after ~100MB. The entire system slows down.

Help!

 - H

----------

## sa

In my kernel I have all these turned on.  

ATA/IDE/MFM/RLL support  --->

<*>   SCSI emulation support

 SCSI support  --->

<*> SCSI support

<*>   SCSI CD-ROM support

<*>   SCSI generic support

so what Im saying is we can have both ide-cd and scsi-cd in the kernel.

also theres a program that can burn cds in ide mode. I think its called koncd, theres mabey others too. but I use xcdroast with scsi emulation.

hth,

sa

PS where can I get this hdparm scsi-ide patch, I want to try it!

----------

## fidler

 *Herodot wrote:*   

> OK, I've done some Googling.
> 
> hdparm can't access scsi-devices. we can't have both ide-cd and scsi-cd in the kernel (although I'm sure redhat does this...). To burn cds, scsi-cd is needed.
> 
> The problem is: how do we set dma for the cd without hdparm?
> ...

 

I tried loading ide-cd and then hdparam it and then unloading it afterwards.  It didn't work for me.  It said that /dev/cdroms/cdrom0 is not a vaild device or some such nonsense....

I think it works if you don't have a devfs system.  Somone on a debian system with the same computer as I have said it worked for them.

To patch you may need to go to a pristene kernel instead of a gentoo kernel....  Where is this patch located?

----------

## smtanner

If your kernel is configure correctly, you should not have to use hdparm to enable dma (it will be on by default).  To do this, you need to two things. 

1) Make sure that you have support for your chipset compiled into the kernel.  This is found under ATA/IDE/MFM/RLL->IDE, ATA and ATAPI Block devices.  The bottom half of this menu will have a bunch of chipsets to choose.  I have a via chipset and so chose VIA82CXXX chipset support.

2)Choose the "Use PCI DMA by defualt when available" and DO NOT choose "Enable DMA only for disks".

After you have done this, if your chipset supports DMA, it will be on by default for any CDROMS, disks that support it.

You can have ide-cd and ide-scsi support compiled into the kernel at the same time.  It is perfectly okay to have one cdrom drive as ide and another cdrom using scsi emulation.  I personally prefer to have both my dvd and cdrom using scsi emulation as this allows a larger number of programs to be used (xcdroast for instance).

By the way, not having a /dev/hd* for a device using scsi emulation is a consequence of using devfsd.  Linux distributions which do not use devfsd would have both the /dev/hd* and /dev/sr? for a device using scsi emulation and the drive could be accessed both ways.  It is only for distributions using devfsd that this becomes a problem.

There is another way to force DMA without using hdparm.  You can try the following command (as root):

echo using_dma:1 /proc/ide/hd*/settings

You can type:

cat /proc/ide/hd*/settings 

to see what all the settings are for a particular drive.

I don't really recommend doing this or using hdparm though.  Configuring the kernel correctly is the best method.  I can't say for sure  with your hardware, but forcing settings that are not supported can cause bad things to happen.

----------

## Herodot

Hi,

Thank you for you detailed response smtanner. Having studied this subject quite intensely, I already knew all those things. But thanks anyway!

Yes, a correctly configured kernel will enable dma where possible. Are you sure echoing to /proc will actually change settings?

Looking at /proc, my cd has dma (and other stuff) enabled. The performance is still very low, though. It's probably not related to how the ide devices are placed. It seems impropable that it should be a problem with this specific drive (hp 8100). Or does it?

The patch I mentioned: I found it after hours on Google. I can't easily find it again. I'm not 100% certain of what it did. It may have been for 2.4.18.

 - Herodot

----------

## smtanner

Perhaps the easiest thing to do is to disable devfs and see what happens.  At least this way you can use hdparm to mess around.  Just pass "devfs=nomount" in the same place you put hd*=ide-scsi.

----------

## smtanner

I pretty sure that echoing changes the settings.  Back when I was struggling with this problem, that was the solution I used for a while and it seemed to improve dvd playback dramatically although I guess that's not exactly definate.  This devfs thing can really be a pain in the --- sometimes.  It also caused big problems with my zip drive but that's another story.

----------

## Guest

I'll try replacing the cd drive with another and see what happens. It feels quite stupid to have a XP1800+ Gentoo machine, and a PII-233-W2k for reading cds...

 - Herodot

----------

## smtanner

"Having studied this subject quite intensely, I already knew all those things. But thanks anyway!"

Yeah, I didn't read the entire thread carefully.  Now I see I was being redundant.

I would really try disabling devfs to trouble shoot the problem.  This will allow you to use hdparm at least.

----------

## Herodot

I put in another cd drive, and everything worked perfectly. I guess it's time to get rid of my trusty hp8100.

Thank you all for your advice.

 - Herodot

----------

