DVD playback jerky with pata_amd

Bug #307829 reported by Jason Feldstein
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Intrepid by Jason Feldstein
Nominated for Jaunty by Jason Feldstein
Nominated for Karmic by Rafael Bermúdez

Bug Description

I've had some trouble with DVD playback on Intrepid; I had the same problems with custom-compiled 2.6.25, 2.6.26 and 2.6.27 kernels on Hardy as well, so something apparently changed in 2.6.25 that affected my DVD drive. I've narrowed it down somewhat - apparently the pata_amd module is setting my DVD drive to PIO0 mode, which makes my DVD playback jerky and slows down my entire system when doing anything DVD-related. Partial output from "dmesg | grep ata" is how I discovered this:

[ 3.477302] libata version 3.00 loaded.
[ 4.000348] pata_amd 0000:00:0d.0: version 0.3.10
[ 4.000410] pata_amd 0000:00:0d.0: setting latency timer to 64
[ 4.000567] scsi0 : pata_amd
[ 4.000714] scsi1 : pata_amd
[ 4.001674] ata1: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0x3080 irq 14
[ 4.001678] ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0x3088 irq 15
[ 4.328473] ata2.00: ATAPI: MATSHITAUJ-840D, 1.02, max MWDMA2
[ 4.328490] ata2: nv_mode_filter: 0x39f&0x7001->0x1, BIOS=0x0 (0x0) ACPI=0x7001 (60:600:0x11)
[ 4.345511] ata2.00: configured for PIO0

I tried blacklisting pata_amd, but it didn't seem to work. This is apparently because there is no amd74xx module to replace it - which, given my google research, would easily fix the problem. Since libata's pata support in the kernel is very clearly listed as beta, why you would set it as the default in a final release is beyond me. Other people have reported similar bugs with other libata pata modules.

Please release a future kernel with amd74xx enabled and pata_amd disabled, or help me find some way of installing amd74xx module myself.

description: updated
Revision history for this message
alexserver (alexserverone) wrote :

As a matter of fact, I have the same trouble as you, so i figure it out I have the same nvidia chipset...
well, there seems we need to compile kernel with amd74xxx but that is a thing I don't know how to do. Could you feedback wheter you found any solution about this anoying issue ? I am really mad with kernel guys so this bring us a lot of troubles.

Revision history for this message
Jason Feldstein (fieldstone) wrote :

I succeeded in compiling a custom kernel with amd74xx included, and my problem is now solved. It took me a few tries, though.

I can send you the kernel image and headers, but be aware that (1) you'll have to remove your restricted modules and nvidia driver, and install the nvidia driver manually from the nvidia web site, which isn't too hard, and (2) I compiled a kernel specifically for my processor, which means if you don't have a 64-bit AMD processor (Athlon 64, Turion 64, or Opteron) it won't work properly on your system. If you have a Broadcom wireless card like I do, you'll also have to manually compile and install the STA driver (the best walkthrough I could find for that was actually for Fedora, but worked perfectly - http://www.cenolan.com/2008/10/installing-the-broadcom-sta-driver-fedora-9/ ).

Now that I think of it, you probably wouldn't be using the amd kernel module if you didn't also have an amd processor, so here's a link to the file: http://rapidshare.com/files/174771308/v3000-kernel.tar.gz.html

Revision history for this message
alexserver (alexserverone) wrote :

Jason,
well I don't have an Athlon 64 in my computer, instead I got an AMD Sempron 3200.
My laptop is a Compaq V3417LA so if I am right you should have the same hardware as I have, except for the 64-bit processor.
Here are my specifications:
     *-cpu
          product: Mobile AMD Sempron(tm)
          vendor: Advanced Micro Devices [AMD]
          physical id: 4
          bus info: cpu@0
          version: 15.12.2
          size: 1800MHz
          capacity: 1800MHz
          width: 64 bits
          capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx
     *-pci:0
          description: PCI bridge
          product: C51 PCI Express Bridge
          vendor: nVidia Corporation
          physical id: 2
          bus info: pci@0000:00:02.0
          version: a1
          width: 32 bits
          clock: 33MHz
          capabilities: pci bus_master cap_list
          configuration: driver=pcieport-driver
        *-network
             description: Wireless interface
             product: BCM4311 802.11b/g WLAN
             vendor: Broadcom Corporation
             physical id: 0
             bus info: pci@0000:01:00.0
             logical name: eth1
             version: 02
             serial: 00:1a:73:7c:92:81
             width: 64 bits
             clock: 33MHz
             capabilities: bus_master cap_list ethernet physical wireless
             configuration: broadcast=yes driver=wl ip=192.168.0.10 latency=0 module=wl multicast=yes wireless=IEEE 802.11
     *-ide:0
          description: IDE interface
          product: MCP51 IDE
          vendor: nVidia Corporation
          physical id: d
          bus info: pci@0000:00:0d.0
          version: f1
          width: 32 bits
          clock: 66MHz
          capabilities: ide bus_master cap_list
          configuration: driver=pata_amd latency=0 maxlatency=1 mingnt=3 module=pata_amd

well, as you can see, we have similar hardware so i think this could work for me.
I have to mention that I have ubuntu 8.10 x86 for 32 bit installed.
I'll appreciate if you can help me to compile my own kernel with amd74_xxx as I don't know how to do this.
I've also added my lspci so you could tell me i we are talking about the same machine.

Thanks for your help, I will research about kernel compilation on my own meanwhile you answer me.

Revision history for this message
Jason Feldstein (fieldstone) wrote :

Worry not... most later Semprons are also 64-bit, though it's generally unadvertised. The information you posted above makes it look like yours is too, and you have pretty much the same hardware I do besides that, so you should be able to use my custom kernel without a problem.

Here's a quick guide to how to proceed:

0. Plug in an ethernet cable for now. This will temporarily break your wireless.

1. download the kernel archive from rapidshare, unzip it, and install the two .deb files

2. go to www.nvidia.com and download the latest Linux driver... should be version 177.82. put it on your desktop. also go to the link I posted above for the Broadcom STA driver and download the file they mention on that page; put it on your desktop also.

3. in a terminal, run the following command: "sudo apt-get --purge remove linux-restricted-modules-* nvidia-*" (without the quotes). It will ask you for your password.

4. Once that's done, hit ctrl-alt-f1, which will take you to a console screen. log in, and then get to your desktop ("cd Desktop").

5. Stop your X server from running: "sudo /etc/init.d/gdm stop"

6. Install the build package ("sudo apt-get install build-essential"), so that the NVIDIA driver will compile.

7. Set the NVIDIA driver to be able to run ("sudo chmod 777 NVIDIA-whatever-the-driver-name-is.run") and then install it ("sudo ./NVIDIA-whatever-the-driver-name-is.run") and pretty much follow the prompts. It will compile and install.

8. Check your xorg.conf file ("sudo nano /etc/X11/xorg.conf") and make sure the "Device" section includes the line: "Driver" "nvidia"
(if it doesn't, add it anywhere before EndSection.)

9. Restart your X server (sudo /etc/init.d/gdm start). If you removed all the restricted modules and nvidia packages, it should work just like it did before.

10. Follow the instructions on the link above for installing the Broadcom STA driver.

11. Enjoy your newly-working-properly DVD drive.

Revision history for this message
Jason Feldstein (fieldstone) wrote :

Wait, wait, don't follow those directions exactly as they are.

After step 3, you need to edit your xorg.conf file (same way as in step 8) and change "nvidia" to "nv" in the Device section. Then reboot the computer, make sure you select the custom kernel (it ends with -v3000) and start with step 4. When you get to step 8, change the driver back to nvidia.

Revision history for this message
alexserver (alexserverone) wrote :

Thanks Jason, I've installed new kernel and it goes fine, but I have troubles on installing nvidia kernel.
Installer says there is no kernel header configured to my current kernel version, i can't understand why it is saying that. I've been read about this and I have no idea what's going wrong, here is my nvidia-installer.log

Revision history for this message
Jason Feldstein (fieldstone) wrote :

This means you probably didn't follow my directions exactly.

Open a terminal and type the following: "sudo apt-get --purge remove nvidia-* linux-restricted-modules-*" (no quotes, again). Hit enter and put in your password.

Once that completes, do this: "sudo apt-get install build-essential".

Then try installing the nvidia driver again.

Revision history for this message
alexserver (alexserverone) wrote :

I've followed your instructions exactly as you said.
Unfortunately, it seems there is a problem with kernel headers configuration.
I've tried execute nvidia installer with --kernel-source-path=/lib/modules/2.6.27.10-v3000/build, but installer cant see this folder as a linux header... I don't know what to do to fix this.
In nvidia forums people says you need to have kernel sources or at least kernel headers, which i have for this version since you sent it to me.
so, I really don't know why is this installer unable to compile kernel interface despite I've been telling to it where the location is.

Revision history for this message
Jason Feldstein (fieldstone) wrote :

I don't know either. It almost sounds like you're trying to compile it while running a different kernel... and that log you attached didn't have much useful info in it, no error message telling why it couldn't compile.

Revision history for this message
alexserver (alexserverone) wrote :

Well Jason, I loaded the latest ubuntu generic kernel 2.6.27.9-generic with hope I could compile nvidia driver and then use with the custom kernel... Nvidia driver compiles fine, but when I started with custom kernel, this one didn't recognize driver and raised some troubles, so it seems I will need to compile by myself the entire kernel as you did.
I suppose there is no enough to have linux headers, I suppose i need to have custom kernel source and configured by myself.
So i'll apreciate if you tell me how can i compile my own kernel and install on my own so this #$% damn driver can set it up correctly.
meanwhile, I was reading your initial post about to install 74xxx module against compile entire kernel.
well i found this post in the internet and I think you will understan better than me as I can see you know further about linux than I can do
http://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html

kind regards.

Revision history for this message
Jason Feldstein (fieldstone) wrote :

We've pretty much reached the limit of my expertise here, and zipping up my configured kernel source will take all day.

Try this instead: go to a terminal window, and type "sudo cp /lib/modules/2.6.27.10-v3000/kernel/drivers/ide/pci/amd74xx.ko /lib/modules/2.6.27-9-generic/kernel/drivers/ide/pci/" . I'm not sure whether that module will work with that kernel, but it might be worth a try.

Revision history for this message
alexserver (alexserverone) wrote :

Ok Jason, thanks but this didn't work..

I've been triying everything but one thing:

"I succeeded in compiling a custom kernel with amd74xx included, and my problem is now solved. It took me a few tries, though"

I need to compile my own kernel by myself, just tell me how to do it, i dont need your source code, i can download my own, it's just that I don't know how to compile the damn kernel and how to add the damn module.

Man, why is Linux so difficult in some circunstances ?

Revision history for this message
Jason Feldstein (fieldstone) wrote :

Here's what you need to do:

http://www.howtoforge.com/kernel_compilation_ubuntu

When you're at the configuration stage, disable all the PATA drivers under libata, and then go into the IDE drivers area and enable amd74xx and pretty much everything in there that applies to hard drives.

Revision history for this message
alexserver (alexserverone) wrote :

Jason:

Before I say anything, I hope you had nice hollidays.
Well I tried following step by step your procedures, compiling the kernel by myself, installing the nvidia driver (the trouble step) and finally, installing the broadcom, and everything went fine !!!

I'm actually working through my wireless because of your help.

well, the thing is that I agree with you, Ubuntu it's supposed to be the human kind distro so people like wouldn't be doing this steps to solve this problems, I hope Ubuntu people heard us and think twice before release a version with beta versions of new modules... I know they use the current kernel version and this could be kernel developers fault, but... this wouldn't happen to users with zero skills like I was !!!

Well, the good side of this, is that I've learned a lot of how kernel and modules work...

Kind Regards.

Revision history for this message
Jason Feldstein (fieldstone) wrote :

I'm glad it worked for you. I was worried you might have trouble, but that guide has been pretty good to me so far.

I also hope people who work on Ubuntu take notice of this issue. If you want to include beta drivers in the kernels, that's fine, but that beta kernel should really be marked as such, or at the very least the stable drivers should be in there too, so that they can be enabled in those cases where the beta drivers don't yet work properly.

I'm a fairly advanced non-programmer user who does tech support for a living, and this was a challenge for me to fix myself. An average end user would have dumped Linux and been back to Windows three times over by now, and that means this bug directly impacts Bug #1.

Revision history for this message
Isaach (isaac-chargoy) wrote :

Hi alexserver:

I have the exact problem with my dvd because I have the same laptop than you (Compaq Presario V3417LA). Maybe you speak spanish and I would like to know how did you fix it. If you can put here the exact steps (and if you speak spanish you could put it in spanish), I will thank you a lot.

Kind Regards,
Isac

Revision history for this message
Jason Feldstein (fieldstone) wrote :

Mi espanol es malo, lo siento.

The steps are all here, though, (en ingles) in my post that starts "Worry not", and the one right after it.

Revision history for this message
alexserver (alexserverone) wrote :

Hi Isaach, Actually I do speak spanish as my first language, but I don't know if there is cool to write here in spanish since there are many people from other cultures who will preffer speak english before spanish...
Anyway, I followed all Jason's steps as he wrote above in this post, except that I compiled my own kernel.
But don't worry, since my laptop it's same as you I can upload my compiled kernel so you can follow those steps and get your dvd plays succesfully.

At this moment i'm busy, but in the few next hours I will upload the file and if you want, I can translate for you Jason's steps.

Hola Isaac, de hecho yo hablo español como primera lengua, pero no se si sea bueno escribir en español aqui debido a que hay varias personas de otras cultura que prefieran hablar en ingles antes que español.
De cualquier manera, yo segui los pasos de jason descritos arriba en este post, salvo por el hecho de que yo compile mi propio kernel.
Pero no te preocupes, debido a que mi laptop es igual a la tuya, puedo subir el kernel para que tu puedas instalarlo y seguir los pasos y logres hacer que tu dvd reproduzca exitosamente.

En este momento ando algo ocupado, pero en unas cuantas horas mas subire el archivo del kernel y si deseas, te puedo traducir los pasos de Jason.

Saludos.

Revision history for this message
Isaach (isaac-chargoy) wrote :

Thanks very much. I'm not right now close to my laptop but I will appreciate much when you can upload.
Thanks in advance. Isaac.

Revision history for this message
Isaach (isaac-chargoy) wrote :

And don't worry Jason, I can follow in english but sometimes I prefer spanish to follow by the book all the steps and in that way don't make mistakes.
Saludos.

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

Hello, I have the same Compaq Presario v3417la with the same problem in Intrepid. Hardy was fine except the brightness keys. Has anyone tried the new Jaunty alpha 4?

Gracias.

Revision history for this message
Isaach (isaac-chargoy) wrote :

No. I haven't yet try it. I'm waiting if alexserver can upload the kernel that he could compile specially for this laptop.

Saludos,
Isaac

Revision history for this message
Michele Mangili (mangilimic) wrote :

Moving this report to linux.

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

Bad news, bug still not fixed in Jaunty Alpha 5.

Revision history for this message
Felipe Lucero (flu0) wrote :

Same problem on a Compaq Presario v3418la. Trying to compile new kernel now...

Revision history for this message
Jason Feldstein (fieldstone) wrote :

Why is no one paying attention to this bug? THIS IS A MAJOR USABILITY ISSUE, and it was reported in PLENTY of time to be fixed in Jaunty. All you have to do is start including amd74xx in the standard kernel releases, maybe instead of pata_amd. There, see? I'm actually telling you how to fix this, developers. All you have to do is actually listen.

I find this very disappointing. I'm used to developers at least checking in on bugs and saying *something*. *Anything*.

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

I'm not sure, Jason, but it seems difficult to include the amd74xx module. Look at the kernel changelog:

""linux (2.6.28-4.7) jaunty; urgency=low

  [ Tim Gardner ]

  * Build in most PATA/SATA drivers. This should allow most i386/amd64 systems to boot
    without an initramfs, though some support work is still required in initramfs-tools
    and grub.
    - LP: #311730
"
 -- Tim Gardner <email address hidden> Fri, 02 Jan 2009 07:33:09 -0700""

pata_amd is not compiled as a module anymore, but build in.

I do not know what happened to this module (pata_amd) since 2.6.27 (in Intrepid) because works very well in hardy with 2.6.24.

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

Hello, here is the kernel compiled with module amd74xx. It's the same Ubuntu kernel, just add old (and good) support for cdrom and amd74xx module, nothing else. It was not necessary to remove any pata modules. This fixes the problem, amd74xx module loads automatically at startup. I also rebuild the linux-restricted-modules to avoid a break with the Broadcom STA driver. So everything works perfectly.

Based on latest 2.6.27-11.27 kernel.
Just sudo dpkg -i packages

http://www.megaupload.com/?d=G0T2P7VO

(Problem is in Jaunty alpha 6 still, please, just add two modules)

Revision history for this message
Felipe Lucero (flu0) wrote :

Rafael, thanks for that kernel, but sadly it didn't work. I'm still getting "ata4.00: configured for PIO0" from dmesg :(. Am I missing something?

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

First, I'm sorry, the previously uploaded linux-restricted-modules erroneously depends on linux-image-generic. This fixes the error:

http://www.megaupload.com/?d=OYRP1ROQ

Just overwrite the wrong package.

In my laptop (v3417la) just works, see my dmesg output:

[ 4.148312] amd74xx 0000:00:0d.0: UDMA133 controller
[ 4.148317] amd74xx 0000:00:0d.0: IDE controller (0x10de:0x0265 rev 0xf1)
[ 4.148342] amd74xx 0000:00:0d.0: not 100% native mode: will probe irqs later
[ 5.452243] hdc: MATSHITADVD-RAM UJ-850S, ATAPI CD/DVD-ROM drive
[ 5.788078] hdc: host max PIO5 wanted PIO255(auto-tune) selected PIO4
[ 5.788356] hdc: MWDMA2 mode selected

You can try the following procedure:

1. Add to /etc/initramfs-tools/modules
blacklist ata_generic
blacklist pata_amd

2. sudo update-initramfs -u

3. Reboot

Please tell me if works.

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

And another thing, make sure you're using the new v3000 kernel.

;)

Revision history for this message
Felipe Lucero (flu0) wrote : Re: [Bug 307829] Re: DVD playback jerky with pata_amd

Thanks for the reply. At first adding those lines to
/etc/initramfs-tools/modules didn't work, adding amd74xx to the top fixed
all my problems:

[ 3.360209] hdc: Optiarc DVD RW AD-7530A, ATAPI CD/DVD-ROM drive
[ 4.032041] hdc: host max PIO5 wanted PIO255(auto-tune) selected PIO4
[ 4.032319] hdc: MWDMA2 mode selected
[ 9.781609] hdc: ATAPI 24X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache

Again, thank you very much, I was just about to go back to Hardy. Hope this
get fixed on Jaunty before final.
--
- Gash Ashtear, G. R.

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

The bug it's not fixed in Jaunty final. I will compile the kernel again.

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

Here is the new kernel for Jaunty: linux-image, linux-headers and linux-restricted-modules

 http://www.megaupload.com/?d=X7IOYGOF

You can change the /dev/scd0 line in /etc/fstab to /dev/hdc for some applications (wine).

Hasta la vista.

Revision history for this message
Felipe Lucero (flu0) wrote :

Still broken in the latest kernel (2.6.28-13) :(. Is it THAT hard to fix it?

BTW, Rafael, thanks again for the patched kernel. It just works :).

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

The eternal bug is in Karmic Koala alpha 6.

Revision history for this message
Eugene Romero (anakondarh) wrote :

It seriously cannot be that hard, including the proper module in the kernel. Rafa, thanks for all your help with the custom kernels. They really do the job Canonical can't / doesn't care to do. Yo te nomino para trabajar en Canonical :)

Revision history for this message
Rafael Bermúdez (rafaelbermudez) wrote :

Hi ubunters:

I have great news for you, I'm testing Karmic since alpha stage, now beta. I upgrade my testing partition today and I can read in the changelog (upstream kernel changes, no Ubuntu developers):

 * pata_amd: do not filter out valid modes in nv_mode_filter

This is the real fix to the bug, drop pata_amd and compilling amd74xx is not a fix, but only a workaround.
Please test the new kernel (2.6.31-12.39) and comment if work for you.

Thank you.

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.