“UbuntuHelp:DMA”的版本间的差异
来自Ubuntu中文
小 |
小 |
||
第4行: | 第4行: | ||
If you experience jumpy DVD playback, slow CD ripping, or a general slow down when accessing optical drive(s) it may be because DMA is not enabled. DMA, or Direct Memory Access, lets hard drives and CD/DVD drives access the system memory. | If you experience jumpy DVD playback, slow CD ripping, or a general slow down when accessing optical drive(s) it may be because DMA is not enabled. DMA, or Direct Memory Access, lets hard drives and CD/DVD drives access the system memory. | ||
Ubuntu 6.06 (Dapper Drake) has DMA '''automatically''' enabled for drives that support it. | Ubuntu 6.06 (Dapper Drake) has DMA '''automatically''' enabled for drives that support it. | ||
− | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png '''Warning:''' Enabling DMA can be dangerous in some cases. Usually issues are directly related to faulty hardware, poorly written drivers, or using settings that are unsupported by your system. | + | {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png%7D%7D '''Warning:''' Enabling DMA can be dangerous in some cases. Usually issues are directly related to faulty hardware, poorly written drivers, or using settings that are unsupported by your system. |
'''USING HDPARM INCORRECTLY CAN CAUSE MAJOR DATA CORRUPTION AND/OR LOSS. Most systems newer than 4 years support DMA.''' | '''USING HDPARM INCORRECTLY CAN CAUSE MAJOR DATA CORRUPTION AND/OR LOSS. Most systems newer than 4 years support DMA.''' | ||
=== Enabling DMA === | === Enabling DMA === | ||
第29行: | 第29行: | ||
</nowiki></pre> | </nowiki></pre> | ||
(another way of avoiding editing of the hdparm.conf file is to simply run <code><nowiki>sudo hdparm -d1 -k1 /dev/hdc</nowiki></code> to keep the DMA flag). | (another way of avoiding editing of the hdparm.conf file is to simply run <code><nowiki>sudo hdparm -d1 -k1 /dev/hdc</nowiki></code> to keep the DMA flag). | ||
+ | === ATAPI DVD drives === | ||
+ | If you have an ATAPI DVD drive on a later (>=8.4) version of Ubuntu it is likely to be treated as a virtual SCSI device. DMA is generally turned on by default, but sometimes the generic ATA module doesn't work. If this is the case you see the following symptom when typing: | ||
+ | <pre><nowiki> | ||
+ | dmesg | grep ata | ||
+ | </nowiki></pre> | ||
+ | One of the lines will be: | ||
+ | <pre><nowiki> | ||
+ | ata2.00: simplex DMA is claimed by other device, disabling DMA | ||
+ | </nowiki></pre> | ||
+ | If this is the case type the following: | ||
+ | <pre><nowiki> | ||
+ | sudo gedit /etc/modprobe.d/aliases | ||
+ | </nowiki></pre> | ||
+ | And add the following lines to the bottom of the file: | ||
+ | <pre><nowiki> | ||
+ | alias ata_generic off | ||
+ | alias pata_atiixp on | ||
+ | </nowiki></pre> | ||
+ | Reboot and DMA should work. You can verify this by typing: | ||
+ | <pre><nowiki> | ||
+ | dmesg | grep ata | ||
+ | </nowiki></pre> | ||
+ | Two of the lines will resemble this: | ||
+ | <pre><nowiki> | ||
+ | [ 23.937141] ata2.00: ATAPI: MATSHITAUJ-845D, D100, max UDMA/33 | ||
+ | [ 24.108846] ata2.00: configured for UDMA/33 | ||
+ | </nowiki></pre> | ||
=== Troubleshooting === | === Troubleshooting === | ||
If your drives are configured in [Cable Select] mode and while running `hdparm` commands you receive errors related to timeouts or drive not ready, try changing the drive to be a master or slave device depending on your system configuration. This does require opening the case and as far as I know most drives are set to Cable Select from the manufacturer. | If your drives are configured in [Cable Select] mode and while running `hdparm` commands you receive errors related to timeouts or drive not ready, try changing the drive to be a master or slave device depending on your system configuration. This does require opening the case and as far as I know most drives are set to Cable Select from the manufacturer. | ||
第48行: | 第75行: | ||
<code><nowiki>ide-cd</nowiki></code> | <code><nowiki>ide-cd</nowiki></code> | ||
Then reboot and try steps 3-4 again.... | Then reboot and try steps 3-4 again.... | ||
+ | If the problem still persists, and you're using a SATA hard drive, then the SATA module has to be loaded first before the ide-cd. Add <code><nowiki>sata_sil </nowiki></code> to the beginning of your /etc/modules file then reboot. | ||
=== Further reading === | === Further reading === | ||
The hdparm has further options that may be more risky. They can be seen using the <code><nowiki>man hdparm</nowiki></code> command in the terminal. | The hdparm has further options that may be more risky. They can be seen using the <code><nowiki>man hdparm</nowiki></code> command in the terminal. |
2008年10月19日 (日) 04:51的版本
Introduction
If you experience jumpy DVD playback, slow CD ripping, or a general slow down when accessing optical drive(s) it may be because DMA is not enabled. DMA, or Direct Memory Access, lets hard drives and CD/DVD drives access the system memory. Ubuntu 6.06 (Dapper Drake) has DMA automatically enabled for drives that support it. {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDialog-Warning1.png%7D%7D Warning: Enabling DMA can be dangerous in some cases. Usually issues are directly related to faulty hardware, poorly written drivers, or using settings that are unsupported by your system. USING HDPARM INCORRECTLY CAN CAUSE MAJOR DATA CORRUPTION AND/OR LOSS. Most systems newer than 4 years support DMA.
Enabling DMA
To enable DMA, you need to use the hdparm
command and the configuration file hdparm.conf
.
These instructions assume that you are trying to enable DMA on `hdc`, usually the CD-rom drive.
- See the what the settings are on `/dev/hdc`
sudo hdparm /dev/hdc
- If you get a line like
using_dma = 1 (on)
, DMA is already enabled. Skip to step 4 to see if it has been enabled at boot time. - Enable DMA on `/dev/hdc`
sudo hdparm -d1 /dev/hdc
- You have now enabled DMA for the drive. However, in order for the settings to be automatically applied at boot there you need to edit the
/etc/hdparm.conf
script. To do this use this command:gksudo gedit /etc/hdparm.conf
Add the following to the end of your hdparm.conf
/dev/hdc { dma = on }
(another way of avoiding editing of the hdparm.conf file is to simply run sudo hdparm -d1 -k1 /dev/hdc
to keep the DMA flag).
ATAPI DVD drives
If you have an ATAPI DVD drive on a later (>=8.4) version of Ubuntu it is likely to be treated as a virtual SCSI device. DMA is generally turned on by default, but sometimes the generic ATA module doesn't work. If this is the case you see the following symptom when typing:
dmesg | grep ata
One of the lines will be:
ata2.00: simplex DMA is claimed by other device, disabling DMA
If this is the case type the following:
sudo gedit /etc/modprobe.d/aliases
And add the following lines to the bottom of the file:
alias ata_generic off alias pata_atiixp on
Reboot and DMA should work. You can verify this by typing:
dmesg | grep ata
Two of the lines will resemble this:
[ 23.937141] ata2.00: ATAPI: MATSHITAUJ-845D, D100, max UDMA/33 [ 24.108846] ata2.00: configured for UDMA/33
Troubleshooting
If your drives are configured in [Cable Select] mode and while running `hdparm` commands you receive errors related to timeouts or drive not ready, try changing the drive to be a master or slave device depending on your system configuration. This does require opening the case and as far as I know most drives are set to Cable Select from the manufacturer. Sometimes step 3 above can fail with an "Operation Not Permitted" message. You can fix this by editing the file /etc/modules: For an Intel CPU put the lines
piix ide-core
above the line
ide-cd
For an AMD CPU put the line
amd74xx
above
ide-cd
For a VIA Chipset put
via82cxxx
above
ide-cd
Then reboot and try steps 3-4 again....
If the problem still persists, and you're using a SATA hard drive, then the SATA module has to be loaded first before the ide-cd. Add sata_sil
to the beginning of your /etc/modules file then reboot.
Further reading
The hdparm has further options that may be more risky. They can be seen using the man hdparm
command in the terminal.
For a detailed description of DMA visit the IEEE
http://standards.ieee.org/reading/ieee/std_public/description/busarch/1212.1-1993_desc.html
IDE, EIDE and UDMA http://www.spcug.org/reviews/bl0108.htm