LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-20-2007, 09:05 PM   #1
pimy
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Rep: Reputation: 1
Unable to enable DMA permanently on DVD burner


Slack 11
Huge26.s 2.6.17.13

Watching DVDs using Xine is choppy, so I did some research and xine-check, along with many posts suggest enabling DMA.
I enabled DMA, and restarted the machine. I then tested the DVD and the result was the same, choppy. I checked hdparm, and DMA
was disabled again.
I added
Code:
/usr/sbin/hdparm -d1 /dev/hdc
to rc.local and restarted the machine. Same result, DMA was disabled. I was beginning to wonder if rc.local was being executed, I confirmed that it was because other things in the file were being executed. (Btw, if I put an echo statement in rc.local, why doesn't it show up in /var/log/messages?)

I then ran the following sequence of commands:

Code:
 
~# hdparm /dev/hdc

/dev/hdc:
 IO_support   =  1 (32-bit)
 unmaskirq    =  1 (on)
 using_dma    =  0 (off)
 keepsettings =  0 (off)
 readonly     =  0 (off)
 readahead    = 256 (on)
 HDIO_GETGEO failed: Inappropriate ioctl for device

~# hdparm -i /dev/hdc

/dev/hdc:

 Model=DVD RW DRU-820A, FwRev=1.0b, SerialNo=
 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=0kB, 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
 UDMA modes: udma0 udma1 udma2 udma3 *udma4
 AdvancedPM=no
 Drive conforms to: Unspecified:  ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5

 * signifies the current active mode

~# hdparm -I /dev/hdc

/dev/hdc:

ATAPI CD-ROM, with removable media
        Model Number:       DVD RW DRU-820A
        Serial Number:
        Firmware Revision:  1.0b
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 udma3 *udma4
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4
             Cycle time: no flow control=120ns  IORDY flow control=120ns
HW reset results:
        CBLID- above Vih
        Device num = 0

~# hdparm -tT /dev/hdc

/dev/hdc:
 Timing cached reads:   2892 MB in  2.00 seconds = 1446.19 MB/sec
BLKFLSBUF failed: Function not implemented
 Timing buffered disk reads:   10 MB in  3.29 seconds =   3.04 MB/sec
BLKFLSBUF failed: Function not implemented

~# hdparm -d1 /dev/hdc

/dev/hdc:
 setting using_dma to 1 (on)
 using_dma    =  1 (on)

~# hdparm -tT /dev/hdc

/dev/hdc:
 Timing cached reads:   2772 MB in  2.00 seconds = 1386.75 MB/sec
BLKFLSBUF failed: Function not implemented
 Timing buffered disk reads:   10 MB in  3.48 seconds =   2.87 MB/sec
BLKFLSBUF failed: Function not implemented


~# hdparm  /dev/hdc

/dev/hdc:
 IO_support   =  1 (32-bit)
 unmaskirq    =  1 (on)
 using_dma    =  0 (off)
 keepsettings =  0 (off)
 readonly     =  0 (off)
 readahead    = 256 (on)
 HDIO_GETGEO failed: Inappropriate ioctl for device
If I enable DMA, then do
Code:
tail -f /var/adm/messages
I see that DMA is disabled just before or as the cache reads test completes:

Apr 20 19:52:54 blah kernel: hdc: DMA disabled

I searched google for "BLKFLSBUF failed: Function not implemented", got mostly foreign language posts, nothing explaining what it is.

I also searched this forum and found the following post, which went unanswered.

http://www.linuxquestions.org/questi...ot+implemented

I then searched for the same string on all the Open Forums on this site, and it returned a few more results:

http://www.linuxquestions.org/questi...ot+implemented

Resolved the his/her DMA issue, didn't say how.

http://www.linuxquestions.org/questi...ot+implemented

This one seems to suggest that its a video playback issue. I suppose it's possible, because I remember installing an nVidia package (NVIDIA-Linux-x86-1.0-9746-pkg1.run) and using a config utility they provided (nvidia-xconfig-1.0.tar.gz), but not knowing how to configure the options very well.

http://www.linuxquestions.org/questi...ot+implemented

This doesn't provide any useful info.

Any idea why DMA won't stay enabled?

Thanks,
pimy
 
Old 04-20-2007, 11:46 PM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Generally a regular echo statement will output stuff to the screen. If you want the results of something to wind up in a file, do like this:
Code:
hdparm -d 1 /dev/hdc >> /var/log/messages
..the >> will append any output to the file. Using a single > will overwrite a file.
As for BLKFLSBUF, it appears in English to mean "Block Device Flush Buffer" which is an operation which either may return that error due to a kernel bug or with an older version of HDPARM (Google-based results) or when the operation is requested on a mounted ext2 filesystem, or your drive simply does not support it.
As to the DMA, of course it generally won't stay in effect over reboots (mine doesn't either), but you may be able to get it to stay by setting the flag HDPARM -K /dev/hdc which "Keeps settings over reset" so the drive will retain its configuration when reset.. I use DMA and a few other settings in my rc.local file, plus the -K flag to keep settings intact if the drive gets reset. It should work fine in rc.local.
Use 'hdparm' with no options to see the possible arguments you can use.
As for the Xine issue, in a console, type "glxinfo | grep direct" and see if it says something like "Direct Rendering: YES". If it does not, then the issue is in part due to your nvidia driver being misconfigured and Direct Rendering/Hardware acceleration is not working.
Personally, I haven't found the tool 'nvidia-xconfig' to be useful except for VERY basic settings (I have nvidia too), so if you are having issues related to the nvidia driver, you will need to do some editing of the /etc/X11/xorg.conf file.
Hope this helps you out some
 
Old 04-21-2007, 11:32 AM   #3
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
For the xine issue ... try mplayer
 
Old 04-21-2007, 02:14 PM   #4
pimy
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Original Poster
Rep: Reputation: 1
>As to the DMA, of course it generally won't stay in effect over reboots (mine doesn't either), but you may be able to get it to stay by setting the flag HDPARM -K /dev/hdc which "Keeps settings over reset"

Did you mean -k (lowercase k)? I think -K applies to some other options, but not -d? I was going to try -k, but was hesitant due to the warning in the man about drive reset loops.

> As for the Xine issue, in a console, type "glxinfo | grep direct" and see if it says something like "Direct Rendering: YES". If it does not, then the issue is in part due to your nvidia driver being misconfigured and Direct Rendering/Hardware acceleration is not working.

Code:
~$ glxinfo | grep direct
Error: unable to open display (null)
I ran into some trouble with slackpkg last night. Had to spend a few hours today getting kernel modules, and other modules installed again. X wasn't working, so I ran through xorgsetup and then ran through the nvidia driver install. X starts, and it seems to be working ok, the only problem I notice is that I can't remote desktop into the machine anymore. It says authentication failed, but I know its the right password. I even re-entered the password on the server, still fails.

Thanks for your help,
pimy
 
Old 04-21-2007, 03:00 PM   #5
pimy
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Original Poster
Rep: Reputation: 1
I removed -k1 from rc.local because the following errors began showing up at startup:

hdc: tray open
end_request: I/O error, dev hdc, sector 0
Buffer I/O error on device hdc, logical block 0
hdc: tray open
end_request: I/O error, dev hdc, sector 4
Buffer I/O error on device hdc, logical block 1
hdc: tray open
end_request: I/O error, dev hdc, sector 8
Buffer I/O error on device hdc, logical block 2
hdc: tray open
end_request: I/O error, dev hdc, sector 12
Buffer I/O error on device hdc, logical block 3
...
...

Now when I attempt hdparm -tT /dev/hdc I receive the following message:

Code:
hdparm -tT /dev/hdc

/dev/hdc:
read() failed: Input/output error
 Timing buffered disk reads:  read() failed: Input/output error
BLKFLSBUF failed: Function not implemented
 
Old 04-21-2007, 03:37 PM   #6
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by bash$ HDPARM
-k get/set keep_settings_over_reset flag (0/1)
-K set drive keep_features_over_reset flag (0/1)
Here's the two keep-settings flags. I am using the uppercase K on my system. I am not sure precisely what the difference is between K and k, but neither have a warning beside them. Perhaps trying both would determine any difference?
The 'glxinfo' command, you typed that as user, or as root? Should be as user.
Slackpkg is indeed giving trouble lately, I understand there's maybe a bug in it somewhere. I can't currently get it to work right either.
Finally, I am not sure what to make of your error messages from the drive(s).
*Maybe* check that you have a new verion of HDPARM, and check that your drives are installed in the right spots on the IDE cables and have the Master/Slave switches set correctly (Yes, sounds silly, but it happens to the best of us)..
Also, how old is the device? Any chance there might be a firmware upgrade for it?
 
Old 04-21-2007, 03:58 PM   #7
pimy
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Original Poster
Rep: Reputation: 1
> The 'glxinfo' command, you typed that as user, or as root? Should be as user.

I tried it with both accounts, same result.

> Finally, I am not sure what to make of your error messages from the drive(s). *Maybe* check that you have a new verion of HDPARM, and check that your drives are installed in the right spots on the IDE cables and have the Master/Slave switches set correctly (Yes, sounds silly, but it happens to the best of us)..
Also, how old is the device? Any chance there might be a firmware upgrade for it?

Code:
~# hdparm -V
hdparm v6.6
The cables should be installed correctly. This machine has been up and running for many months. I've been able to use it before (watch DVDs...although choppy, read OS CDs) w/o issue. The DVD burner is only 1 year old. If memory serves it isn't sharing a cable with anything else. I'll check the cable later tonight.

Thanks again,
pimy
 
Old 04-21-2007, 04:52 PM   #8
Fluxx
Member
 
Registered: Aug 2005
Location: Bavaria, Germany
Distribution: Slackware (Current)
Posts: 225

Rep: Reputation: 30
I had the same problem with my dvd-drive and the standard Slackware kernel. The problem was, that the dvd-drive didn't have dma and it was not possible to enable dma.

Here my dvd-drive with hdparm -i:

Code:
/dev/dvd:

 Model=HL-DT-ST DVDRAM GMA-4082N, FwRev=HA01, SerialNo=K0467RJ3342
 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=0kB, 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:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 *udma2
 AdvancedPM=no
 Drive conforms to: ATA/ATAPI-5 T13 1321D revision 3:  ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5

 * signifies the current active mode
And here the result of:

Code:
hdparm -d 1 /dev/dvd

/dev/dvd:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Operation not permitted
 using_dma    =  0 (off)
Then I recompiled the kernel and disabled the kernel tree/option

Code:
Device Drivers
< > ATA/ATAPI/MFM/RLL support
and installed the new kernel.

/dev/dvd changed to /dev/sr0 afterwards.

It is NOT possible to enable DMA but I have about 8 MB/sec with "hdparm -t" and no problem with xine, mplayer, k3b or other programs.

xine now plays DVDs with 12 % CPU usage, with the old kernel it played with 100 % and was not usable (slow motion).

I have a SATA controller in my notebook --- may be that this was the problem with the optical drive ...

Fluxx.
 
Old 04-21-2007, 05:03 PM   #9
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
@ Fluxx -- Very helpful stuff, thanks for jumping in
Here's a final tip, for both of you and anyone else interested:
While OLDER drive devices did not work better than UDMA2 with the standard 40-wire IDE cable, modern devices, when capable, WILL work above UDMA2 if they are able, but they need a 80-wire cable to do so.
Many computers come with only one of the two IDE cables being the 80-wire model (on IDE-0), and the other is 40-wire (on IDE-1).
I just recently replaced both my IDE cables with brand new 80-wire cables, and now three of four of my IDE drives are operating at UDMA4 or UDMA5; the fourth unit is only UDMA2-enabled.
 
Old 04-21-2007, 05:15 PM   #10
Fluxx
Member
 
Registered: Aug 2005
Location: Bavaria, Germany
Distribution: Slackware (Current)
Posts: 225

Rep: Reputation: 30
I think this is not possible in a notebook ... no cables, only a plugged-in optical drive.

Fluxx.
 
Old 04-21-2007, 05:26 PM   #11
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Hmmm indeed, a good point I had not even thought about. I suspect you could be totally correct.
At a glance, I wonder if the OP has a laptop; I think it's a desktop machine..
 
Old 04-29-2007, 12:32 PM   #12
pimy
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Original Poster
Rep: Reputation: 1
Thumbs up

FIXED.

Thanks Grapefruitgirl, it was in fact the cable. I'm sorry for the late response, but end of semester has been overwhelming. The hdparm output showed that my dvd was configured for UDMA4. I noticed that the bios was listing it as UDMA2. Once I swapped the 40-pin cable for an 80-pin one, the bios listed it as UDMA4.

I am now able to play movies w/o any stuttering. One problem that still remains is the input/ouput error when running hdparm -tT. I'll have to do some more research on that one.

Thanks again,
pimy
 
  


Reply

Tags
dvd, ide, udma


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DMA problem on external DVD burner krisbitner Linux - General 3 01-18-2007 10:57 AM
dma gets disabled for my DVD burner jjesso Linux - Hardware 5 09-25-2006 08:14 AM
Enable DMA on DVD drives puppy Ubuntu 5 09-08-2005 07:09 PM
How do I enable DMA for my DVD jbasement Debian 2 10-14-2004 07:55 PM
can not enable dma on laptop cd/dvd megaspaz Linux - Laptop and Netbook 2 09-08-2003 09:01 PM


All times are GMT -5. The time now is 11:47 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration