bttv driver latency issues with AMD C1E enabled

Bug #509219 reported by jonie
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

Binary package hint: linux-source

My TV card (Leadtek Winfast TV2000/XP) seems to work only with acpi=off passed to kernel. When ACPI is enabled, the picture is just a slideshow, trying acpi=noirq makes the slideshow just a little faster. This can be reproduced with any kernel from 2.6.29 to 2.6.32 from mainline ppa, I tried both Hardy LTS and Karmic, didn't try older kernels as they fail to boot. This is no X problem, the behavior can be reproduced even without X and with nvidia module unloaded just by capturing a bit of video. I tried also to recompile bttv driver with IRQF_SHARED or IRQF_DISABLED explicitly declared, it didn't change a thing. The rest of PCI hardware seems to work fine.

When the picture is stuttering dmesg reports:

[ 78.044297] bttv0: timeout: drop=301 irq=1092/1092, risc=595e2b3c, bits: HSYNC OFLOW
[ 78.604537] bttv0: timeout: drop=312 irq=1132/1132, risc=56822b5c, bits: HSYNC OFLOW
[ 1081.948327] bttv0: timeout: drop=323 irq=1192/1192, risc=69dad6bc, bits: HSYNC OFLOW

Edit: The card works normally after disabling C1E in BIOS. It seems to be a duplicate of this bug:

http://bugzilla.kernel.org/show_bug.cgi?id=13911

If BIOS does not allow to disable C1E the idle=mwait kernel parameter may be used to prevent CPU from entering C1E.

---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 1.23-0ubuntu3
Architecture: i386
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: ubuntu 3389 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'CA0106'/'Audigy SE [SB0570] at 0xdc00 irq 19'
   Mixer name : 'CA0106'
   Components : ''
   Controls : 35
   Simple ctrls : 18
CasperVersion: 1.287
DistroRelease: Ubuntu 11.10
IwConfig:
 lo no wireless extensions.

 eth0 no wireless extensions.
LiveMediaBuild: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
MachineType: System manufacturer System Product Name
Package: linux (not installed)
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: file=/cdrom/preseed/hostname.seed boot=casper initrd=/casper/initrd.lz quiet splash --
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
RelatedPackageVersions:
 linux-restricted-modules-3.0.0-12-generic N/A
 linux-backports-modules-3.0.0-12-generic N/A
 linux-firmware 1.60
RfKill:

Tags: oneiric running-unity
Uname: Linux 3.0.0-12-generic i686
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
dmi.bios.date: 09/10/2010
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 0901
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: M3N78-EM
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev X.0x
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr0901:bd09/10/2010:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnM3N78-EM:rvrRevX.0x:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

jonie (jonie)
description: updated
Revision history for this message
Andy Whitcroft (apw) wrote :

[This is an automated message. Apologies if it has reached you inappropriately.]

This bug was reported against the linux-meta package when it likely should have been reported against the linux package instead. We are automatically transitioning this to the linux kernel package so that the appropriate teams are notified and made aware of this issue.

If this bug really is a bug in the linux-meta package you can move it back to linux-meta and tag it kj-linux-meta, or contact us on the #ubuntu-kernel channel on the FreeNode IRC server. Thanks.

affects: linux-meta (Ubuntu) → linux (Ubuntu)
jonie (jonie)
description: updated
description: updated
description: updated
jonie (jonie)
summary: - bttv driver working only with acpi=off on ASUS M3N78-EM
+ bttv driver latency issues with AMD C1E enabled
Revision history for this message
jonie (jonie) wrote :

If someone has this hardware and wants to test I applied patch 35743 from bugzilla.kernel.org and added pm_qos_requirement to bttv driver (Lucid kernel). What it does is effectively that c1e is disabled for the time of capturing. The 35743 patch might be useful for some other drivers that require low latency like wireless drivers that use pm_qos and c1e breaks them.

Brad Figg (brad-figg)
tags: added: kj-triage
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 509219

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
jonie (jonie) wrote : AcpiTables.txt

apport information

tags: added: apport-collected oneiric running-unity
description: updated
Revision history for this message
jonie (jonie) wrote : AlsaDevices.txt

apport information

Revision history for this message
jonie (jonie) wrote : AplayDevices.txt

apport information

Revision history for this message
jonie (jonie) wrote : ArecordDevices.txt

apport information

Revision history for this message
jonie (jonie) wrote : BootDmesg.txt

apport information

Revision history for this message
jonie (jonie) wrote : Card0.Amixer.values.txt

apport information

Revision history for this message
jonie (jonie) wrote : CurrentDmesg.txt

apport information

Revision history for this message
jonie (jonie) wrote : Lspci.txt

apport information

Revision history for this message
jonie (jonie) wrote : Lsusb.txt

apport information

Revision history for this message
jonie (jonie) wrote : PciMultimedia.txt

apport information

Revision history for this message
jonie (jonie) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
jonie (jonie) wrote : ProcInterrupts.txt

apport information

Revision history for this message
jonie (jonie) wrote : ProcModules.txt

apport information

Revision history for this message
jonie (jonie) wrote : PulseSinks.txt

apport information

Revision history for this message
jonie (jonie) wrote : PulseSources.txt

apport information

Revision history for this message
jonie (jonie) wrote : UdevDb.txt

apport information

Revision history for this message
jonie (jonie) wrote : UdevLog.txt

apport information

Revision history for this message
jonie (jonie) wrote : WifiSyslog.txt

apport information

Revision history for this message
jonie (jonie) wrote :

The problem could be reproduced with any kernel (tested 3.0.0 so far). Due to lack of AMD C1E idle accounting in kernel latency requirements cannot be enforced if needed (via pm_qos for instance) and apparently there are drivers that don't function correctly with the latencies added by AMD C1E, bttv is an example. There are also some wireless and sound drivers that might need c1e be disabled for their proper operation.
Of course a straightforward solution is to disable C1E in the BIOS or use idle=mwait kernel parameter. But why should the CPU use more power (and reduce battery life in case of a laptop) when C1E could just be disabled for the short moments if really needed.
The patch works for me, but someone with more knowledge about ACPI could point out where to read from the real latency value of C1E (for the time being it's on/off solution).

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
penalvch (penalvch)
tags: added: needs-upstream-testing
Revision history for this message
penalvch (penalvch) wrote :

jonie, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p linux <replace-with-bug-number>

Also, could you please test the latest upstream kernel available following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Please do not test the kernel in the daily folder, but the one all the way at the bottom. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested and remove the tag:
needs-upstream-testing

This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the text:
needs-upstream-testing

If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested.

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested.

If you are unable to test the mainline kernel, please comment as to why specifically you were unable to test it and add the following tags:
kernel-unable-to-test-upstream
kernel-unable-to-test-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested.

Please let us know your results. Thank you for your understanding.

Helpful Bug Reporting Links:
https://help.ubuntu.com/community/ReportingBugs#Bug_Reporting_Etiquette
https://help.ubuntu.com/community/ReportingBugs#A3._Make_sure_the_bug_hasn.27t_already_been_reported
https://help.ubuntu.com/community/ReportingBugs#Adding_Apport_Debug_Information_to_an_Existing_Launchpad_Bug
https://help.ubuntu.com/community/ReportingBugs#Adding_Additional_Attachments_to_an_Existing_Launchpad_Bug

tags: added: likely-dup needs-kernel-logs
tags: removed: likely-dup
tags: added: likely-dup
Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
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.