Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 156818 - bttv driver resets card upon querying capabilities with VIDIOCGCAP ioctl
Summary: bttv driver resets card upon querying capabilities with VIDIOCGCAP ioctl
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Dave Jones
QA Contact: Brian Brock
Whiteboard: bzcl34nup
Depends On:
TreeView+ depends on / blocked
Reported: 2005-05-04 14:19 UTC by Harald Hoyer
Modified: 2015-01-04 22:19 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-05-07 00:09:53 UTC

Attachments (Terms of Use)

Description Harald Hoyer 2005-05-04 14:19:15 UTC
Description of problem:
radio tuner is reseted by gimp

Version-Release number of selected component (if applicable):
since FC1 or so

How reproducible:
every time

Steps to Reproduce:
1. listen to the radio
2. start gimp or update the gimp rpm
Actual results:
no more radio listening

Expected results:
leave my tuner alone!

Comment 1 Nils Philippsen 2005-05-04 15:34:58 UTC
I can't reproduce your problem -- my radio plays flawlessly if I start or update
the gimp. Please provide more info.

Comment 2 Harald Hoyer 2005-05-04 15:38:42 UTC
What info? I could show you the effect in personal!

Comment 3 Harald Hoyer 2005-05-04 15:39:52 UTC
FYI, this is a TV card with a radio tuner... not an external one disconnected
from the computer :)

Comment 4 Nils Philippsen 2005-05-06 16:43:01 UTC
[Tim: I'm Ccing you in case someone opens a similar bug against xsane/sane]

Ahh... interesting. I've tried this out on your machine and found this:

- Updating the gimp package didn't do anything to the running radio (which is to
be expected since it only installs some symlinks, updates the icon cache... in
the %post* scripts)
- Running the gimp _did_ reset the radio, it seemed to come from the xsane
plugin (which tries to determine what scanner-like hardware is present on the
system when starting the GIMP)
- I confirmed this with running the standalone xsane which tries to open
/dev/bttv, /dev/video[0-3] (as configured in your /etc/sane.d/v4l.conf)
- I tracked this to the v4l sane plugin sending the ioctl VIDIOCGCAP to
/dev/video0 (which is incidentally the same TV/radio card that gets reset) in
order to determine the card's capabilities.

To me it looks like the bug is in the bttv driver which resets the _radio_ part
of the card when querying its _video_ capabilities, therefore I reassign this to
kernel. NB: One could argue that the card shouldn't reset anything when querying
any capabilities, but let's not be greedy ;-).

Harald, as a workaround, commenting out the offending lines in
/etc/sane.d/v4l.conf should help.

Comment 5 Alexey Dobriyan 2006-08-16 12:42:48 UTC
VIDIOCGCAP is big hint.

bttv_do_ioctl() does the following check before checking ioctl command:

        if (btv->errors)

However, ->errors are REset to 0 by bttv_reinit_bt848().
Where they are SEt, you ask? Ha!

Harald, please, test this:

--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3085,7 +3085,7 @@ static int bttv_open(struct inode *inode
 	/* allocate per filehandle data */
-	fh = kmalloc(sizeof(*fh),GFP_KERNEL);
+	fh = kzalloc(sizeof(*fh),GFP_KERNEL);
 	if (NULL == fh)
 		return -ENOMEM;
 	file->private_data = fh;

(I have no idea how Fedora users test one-liners)

Comment 6 Harald Hoyer 2006-08-16 13:21:37 UTC
hmm, seek the kmalloc in vmlinuz and toggle some bytes :)

Comment 7 Dave Jones 2006-10-17 00:09:11 UTC
A new kernel update has been released (Version: 2.6.18-1.2200.fc5)
based upon a new upstream kernel release.

Please retest against this new kernel, as a large number of patches
go into each upstream release, possibly including changes that
may address this problem.

This bug has been placed in NEEDINFO state.
Due to the large volume of inactive bugs in bugzilla, if this bug is
still in this state in two weeks time, it will be closed.

Should this bug still be relevant after this period, the reporter
can reopen the bug at any time. Any other users on the Cc: list
of this bug can request that the bug be reopened by adding a
comment to the bug.

In the last few updates, some users upgrading from FC4->FC5
have reported that installing a kernel update has left their
systems unbootable. If you have been affected by this problem
please check you only have one version of device-mapper & lvm2
installed.  See bug 207474 for further details.

If this bug is a problem preventing you from installing the
release this version is filed against, please see bug 169613.

If this bug has been fixed, but you are now experiencing a different
problem, please file a separate bug for the new problem.

Thank you.

Comment 8 Dave Jones 2006-11-24 22:52:50 UTC
This bug has been mass-closed along with all other bugs that
have been in NEEDINFO state for several months.

Due to the large volume of inactive bugs in bugzilla, this
is the only method we have of cleaning out stale bug reports
where the reporter has disappeared.

If you can reproduce this bug after installing all the
current updates, please reopen this bug.

If you are not the reporter, you can add a comment requesting
it be reopened, and someone will get to it asap.

Thank you.

Comment 9 Nils Philippsen 2007-09-28 10:26:50 UTC
Thomas just saw the problem isn't fixed on Rawhide with

Comment 10 Bug Zapper 2008-04-03 16:08:33 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:

We will be following the process here: to ensure this
doesn't happen again.

Comment 11 Bug Zapper 2008-05-07 00:09:51 UTC
This bug has been in NEEDINFO for more than 30 days since feedback was
first requested. As a result we are closing it.

If you can reproduce this bug in the future against a maintained Fedora
version please feel free to reopen it against that version.

The process we're following is outlined here:

Note You need to log in before you can comment on or make changes to this bug.