# Slowdowns with CD-Rom

## EhobaX

Hi,

It seems that everytime my system uses my CD-Rom there is a noticeable slowdown in performance.  i.e.  Mouse movement becomes choppy, typing in a xterm becomes sluggish.  It's a 40x CD-Rom and works fab in other distros of Linux (Mandrake 8.2, Redhat 7.2).  I was wondering if there was some way I could tweak the performance so that it would start acting normal again!  I'd really hate to ditch this distro just because of hardware. :p

Thanks!

----------

## mb

sounds like no dma support...

check

```
hdparm -d1 /dev/hd? 
```

where "?" is your cdrom device... you also should do the same with your ide harddisks...

you *may* enable dma support in kernel... but hdparm will tell you..

#mb

----------

## EhobaX

On bootup I think the CD-Rom uses PIO.  I'm not 100% sure since I'm at work right now.  :Sad: 

Can I put hdparm for my CD-Rom in /etc/rc.local to have it use DMA?  I've done it with my HD already and have seen a marginal increase.  If that's not an option, where the bloody hells is it in the menuconfig?  :Smile: 

----------

## mb

yep...  there must be a file called local.start somewhere in /etc

if you have done this for your HD, dma support seems to be in the kernel... otherwise

ATA/IDE/MFM/RLL support -> IDE, ATA and ATAPI Block devices  -> Generic PCI bus-master DMA support [*]

#mb

----------

## EhobaX

Thanks mb,

I'll get cracking on that when I get some time.  Work is going to kill me this week. :p

----------

## EhobaX

Ok.  I recompiled the kernel just to see if everything was installed correctly.  I've got that option that mb suggested, but my CD-Rom is still sucking wind in Gentoo.

I did hdparm -c 1 -d 1 /dev/cdrom/cdrom0 and everything seemed peachy.

When I do hdparm -tT /dev/cdrom/cdrom0 my output is:

```
Time buffer cache reads:  128 MB in 0.90 seconds = 141.18 MB/s

Time buffered disk reads:  64 MB in 19.90 seconds = 3.22 MB/s
```

I don't know about the rest of you but that sucks for the seconds one!  I've tried using hdparm -X to change the modes, but I can only set it up to mdma2.  It doesn't like udma and spits out this error message:

```
setting xfermode to 65 (UltraDMA mode 1)

HDIO_DRIVE_CMD(setxfermode) failed:  input/output error
```

Does anyone know how to resolve this?  Like I said before, it works like a champ in other distros.  I just can't seem to understand it. :pLast edited by EhobaX on Thu May 30, 2002 12:06 pm; edited 1 time in total

----------

## rommel

yeah i feel your pain...i ahve the same issue adn have posted about it but necver did find anything to do...my drive is seen as udma4 and i get pretty piss poor performance...ripping a cd is kinda funny...i bought a tdk 40x cdrw the other day and on the box it says rip and audio track in 5 seconds...lol...i dont think so

/dev/hda:

 Model=Pioneer DVD-ROM ATAPIModel DVD-106S 010, FwRev=E1.09, SerialNo=

 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }

 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0

 BuffType=13395, BuffSize=64kB, MaxMultSect=0

 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes: pio0 pio1 pio2 pio3 pio4

 DMA modes: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 *udma4

 AdvancedPM=no

 Drive Supports : Reserved : ATA-1 ATA-2 ATA-3 ATA-4 ATA-5

then i set dma and 32bit mode

/dev/hda:

 setting 32-bit I/O support flag to 1

 setting using_dma to 1 (on)

 I/O support  =  1 (32-bit)

 using_dma    =  1 (on)

and ended up with this

/dev/hda:

 Timing buffer-cache reads:   128 MB in  0.56 seconds =228.57 MB/sec

 Timing buffered disk reads:  64 MB in 21.42 seconds =  2.99 MB/sec

----------

## EhobaX

Bah!  I should just go back into the menuconfig and check everything that includes IDE and DMA support.  Either that, I'm going back to Mandrake.  It was pretty user friendly, and I can trim down the bloat by not installing the packages and recompiling the kernel.

----------

## rommel

do you remember what hdparm was giving you when you ran mandrake?....for the cdrom or dvd you were using on it then...i am getting the same performance  from a similar dvd player under freebsd...but that and gentoo are all i ahve installed right now

edit: looking over menuconfig again like you suggested i came across the Ignore word93 Validation bits option under the IDE/ATA/MFM/RLL support section....i dont know if this would help or not but i might recompile and see if it does...although it might create issues...lol

----------

## lx

 *rommel wrote:*   

> ...ripping a cd is kinda funny...i bought a tdk 40x cdrw the other day and on the box it says rip and audio track in 5 seconds...lol...i dont think so

 

Ripping of audio is different frow 40x reading a cdrom, look for example at

http://www.feurio.com/English/cd_roms/frame_list_ide_speed.html

Some are beter than others, also in audio error recovery plextor is one of the best out there, you might want to get one with c2error correction, then you can also check if the read audio in burst mode is actually correct. (readcd in linux supports this but mixes the audio with this data after every sector).

 :Sad:  Well if I miss anything about Window$ it is feurio, luckely I have wine.

----------

## rommel

lol...you could have saved yourself the post,i am not a genius but i think thazt much i understand...but the quote on the box is still the same brainiac...lol...now do you know how to solve the problem that originally started this post?

----------

## EhobaX

LOL.   I installed Mandrake and got the same performance using hdparm.  However, I checked the options when i used make menuconfig for it and it had just about EVERY option checked in the IDE/DMA options.  BUT, I don't get the ghetto slowdown of my CD-Rom when running proggies from the CD.

I don't know if I'm going to have time to install Gentoo anymore since I'm going to be losing my broadband this weekend due to a move.  DAMN THE PHONE COMPANIES!  Oh well.  I might be able to whore one of my friends fat pipe later down the road.  If you get fast performance after your recompile rommel, I'd like to know.  :Smile: 

----------

## gboyce

If your IDE devices keep going into PIO mode, check your kernel configuration options.

Under IDE settings, there's an option called "Enable DMA only for disks".  The wording of this is a little tricky.  It sounds as if you should enable this option if you always want your harddrive to be in DMA mode, but it actually means that DMA should only be enabled on disks, not other IDE devices.

If you have this option enabled, you'll experiance problems like you're reporting.

----------

## rommel

lol...that sucks about you loosing your connection...god i fukin hate dialup...and i dont think i would give up gentoo...i am running freebsd too....thats really similar but gentoo is more cutting edge and IT HAS NVIDIA DRIVERS..well all linux does but you know.

gboyce its not that...i never select that option...but thanks for the suggestion...newaz...well nothing in my system suffers from this other then riping is a bit slow....but like dvd play back and even burning isnt too bad...suppose it will never be like windows but i can always hope...lol

ciao

----------

