Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 203889 - gentoo-sources-2.6.23 bttv hauppage WinTV 0070:13eb /dev/video0 invalid argument
Summary: gentoo-sources-2.6.23 bttv hauppage WinTV 0070:13eb /dev/video0 invalid argument
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-31 14:46 UTC by Sven Müller
Modified: 2008-12-04 10:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Error message in mplayer (mplayer_tv.txt,722 bytes, text/plain)
2007-12-31 14:47 UTC, Sven Müller
Details
Issue of dmesg (dmesg_23r5,15.09 KB, text/plain)
2007-12-31 14:48 UTC, Sven Müller
Details
Kernel-Config (.config,43.54 KB, text/plain)
2007-12-31 14:53 UTC, Sven Müller
Details
Kernel-Config-2.6.21-r4 (.config,44.67 KB, text/plain)
2008-01-02 00:32 UTC, Sven Müller
Details
patch (bttv-debug.patch,966 bytes, patch)
2008-10-29 13:00 UTC, Daniel Drake (RETIRED)
Details | Diff
dmesg, bttv as module, module autoloaded while booting (01_dmesg.txt,15.12 KB, text/plain)
2008-10-30 15:39 UTC, Sven Müller
Details
dmesg, bttv built in, just booted (02_dmesg.txt,15.11 KB, text/plain)
2008-10-30 15:40 UTC, Sven Müller
Details
output of mplayer, bttv built in (04_mplayer.txt,736 bytes, text/plain)
2008-10-30 15:42 UTC, Sven Müller
Details
mplayer with strace (05_strace.log,546 bytes, text/plain)
2008-10-30 15:45 UTC, Sven Müller
Details
the real strace-output (06_strace.log,58.55 KB, text/plain)
2008-10-30 15:51 UTC, Sven Müller
Details
working modular kernel (stat_module.log,371 bytes, text/plain)
2008-11-07 14:50 UTC, Sven Müller
Details
broken compiled-in kernel (stat_compiled.log,370 bytes, text/plain)
2008-11-07 14:50 UTC, Sven Müller
Details
udevadm test with bttv driver compiled in - kernel-2.6.27-r1 (test2627r1_fix.log,4.65 KB, text/plain)
2008-12-02 20:28 UTC, Sven Müller
Details
udevadm test bttv compiled as module - kernel-2.6.27-r1 (test2627r1_module.log,4.65 KB, text/plain)
2008-12-02 20:29 UTC, Sven Müller
Details
udevadm test bttv compiled in - kernel-2.6.27-r4 (test2627r4_fix.log,2.87 KB, text/plain)
2008-12-02 20:30 UTC, Sven Müller
Details
udevadm test bttv compiled as module - kernel-2.6.27-r4 (test2627r4_module.log,2.87 KB, text/plain)
2008-12-02 20:30 UTC, Sven Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Müller 2007-12-31 14:46:10 UTC
Since 2.6.23 I don't get my tvcard working anymore. I didn't change any bttv relating kernel-config. And I have still gentoo-sources-2.6.21-r4 installed where the tvcard works perfectly. If I boot 2.6.23-r5 (or any other of the 2.6.23 series) I get /dev/video0 invalid argument when I try to start a tv application like tvtime. 



Reproducible: Always

Steps to Reproduce:
1. boot 2.6.23-r*
2. start tvtime

Actual Results:  
error message in tvtime: /dev/video0 invalid argument
And I don't get any signal from the tvcard, neither pic nor sound.

In mplayer I get:
ioctl get capabilites failed: Inappropriate ioctl for device



Expected Results:  
tv picture

Tested Applications:
tvtime, mplayer, Skype, aMSN,
Comment 1 Sven Müller 2007-12-31 14:47:34 UTC
Created attachment 139721 [details]
Error message in mplayer
Comment 2 Sven Müller 2007-12-31 14:48:58 UTC
Created attachment 139722 [details]
Issue of dmesg
Comment 3 Sven Müller 2007-12-31 14:52:45 UTC
Ah I forgot:
/dev/video0 is a symlink and points to /dev/v4l/video0

/dev/v4l:
total 0 
drwxr-xr-x  2 root root       100 Dec 18 17:53 . 
drwxr-xr-x 12 root root     14840 Dec 18 17:55 .. 
crw-rw----  1 root video  81,  64 Dec 18 17:53 radio0 
crw-rw----  1 root video  81, 224 Dec 18 17:53 vbi0 
crw-rw----  1 root video 171,  16 Dec 18 17:53 video0

lspci:
01:08.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11) 
01:08.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

And my user is member of the group video.
Comment 4 Sven Müller 2007-12-31 14:53:58 UTC
Created attachment 139724 [details]
Kernel-Config
Comment 5 Mike Pagano gentoo-dev 2008-01-01 22:02:34 UTC
In the non-working kernel and working kernel can you post the outputs of:

lsmod

also attach both .config files.
Comment 6 Sven Müller 2008-01-02 00:32:15 UTC
Created attachment 139837 [details]
Kernel-Config-2.6.21-r4

The first .config is of 2.6.23-r5

lsmod doesn't seem to be very helpful, because I used to compile the bttv module into the kernel. 

lsmod:
Module                  Size  Used by
libafs                476080  3 
lirc_i2c                7748  2 
lirc_dev               12296  1 lirc_i2c
nvidia               6208880  34 
ne2k_pci                9412  0 
8390                    8448  1 ne2k_pci
Comment 7 Mike Pagano gentoo-dev 2008-01-18 23:40:11 UTC
Can you test with vanilla-sources.2.6.24_rc8 and post the result here?
Comment 8 Sven Müller 2008-02-07 15:51:24 UTC
I tried it now with 2.6.24. Same behaviour. Still invalid argument.
Comment 9 Sven Müller 2008-02-24 16:59:13 UTC
I got it working again. 

I used to compile the bttv driver directly into the kernel. Appearantly that doesn't seem to work since 2.6.23. You have to compile the bttv driver now as a module. 

Is there a known reason why?

Close the bug or leave it open?
Comment 10 Mike Pagano gentoo-dev 2008-03-14 17:39:46 UTC
Would you be able to test 2.6.25_rc4. I'd like to see if the problem using the driver when built into the kernel has been addressed.
Comment 11 Mike Pagano gentoo-dev 2008-04-19 00:55:12 UTC
Please reopen if you want to investigate building it in the kernel in later versions.
Comment 12 Sven Müller 2008-04-19 21:29:39 UTC
Sorry, I have to wait until the Reiser4-Patch. My root partition is on Reiser4. 
Comment 13 Sven Müller 2008-09-24 16:25:03 UTC
Sorry for reopen a temporarely solved problem. 

In 2.6.23 and 2.6.24 I had to compile bttv as module. 

In 2.6.25 it worked also with the compiled-in driver. 

But now I upgraded to 2.6.26 and again I get the same error like in 2.6.23 and 2.6.24. It works as module but not compiled in. However it works as a module so there's no importance to put a lot of work onto it. 
Comment 14 Mike Pagano gentoo-dev 2008-10-13 19:23:00 UTC
Sven,

can you please test with gentoo-sources-2.6.27
Comment 15 Sven Müller 2008-10-14 22:33:29 UTC
> can you please test with gentoo-sources-2.6.27

bttv compiled as module works perfect. Fix built in into kernel gives me also in 2.6.27 the error of the invalid argument. 

Comment 16 Daniel Drake (RETIRED) gentoo-dev 2008-10-29 10:57:12 UTC
OK, lets dig into this.

First of all, please attach dmesg output from after loading the bttv modules (in the situation where the card works fine). I want to compare the initialization messages to the failing case in comment #2.

Next, please apply the patch I am attaching to this ticket below to 2.6.27, and compile with bttv as built-in so that it fails as described in this bug.

Boot into the new kernel, run mplayer to check the failure. Then capture dmesg output to a file and attach it here (there may be some messages added).

Lastly, capture the strace output of a failing mplayer:
 strace mplayer -tv driver=v4l2:height=240:width=320 tv://se12 > strace.log
and attach strace.log here

thanks!
Comment 17 Daniel Drake (RETIRED) gentoo-dev 2008-10-29 13:00:24 UTC
Created attachment 170217 [details, diff]
patch
Comment 18 Sven Müller 2008-10-30 15:39:23 UTC
Created attachment 170327 [details]
dmesg, bttv as module, module autoloaded while booting
Comment 19 Sven Müller 2008-10-30 15:40:20 UTC
Created attachment 170328 [details]
dmesg, bttv built in, just booted
Comment 20 Sven Müller 2008-10-30 15:42:25 UTC
Created attachment 170329 [details]
output of mplayer, bttv built in
Comment 21 Sven Müller 2008-10-30 15:45:55 UTC
Created attachment 170331 [details]
mplayer with strace 

The first file (01_dmesg.txt) is without patch. For the other logs I patched the kernel.
Comment 22 Sven Müller 2008-10-30 15:51:35 UTC
Created attachment 170332 [details]
the real strace-output

Sorry for the German output of mplayer in 04_mplayer.txt. For some reason I don't know, export LC_ALL=C mplayer ... didn't work to get the output it in English.
Comment 23 Daniel Drake (RETIRED) gentoo-dev 2008-10-30 16:22:51 UTC
(In reply to comment #19)
> Created an attachment (id=170328) [edit]
> dmesg, bttv built in, just booted
> 

Was this captured immediately after boot, or immediately after running mplayer?
My request is for you to capture dmesg after running mplayer (and seeing it fail).
Comment 24 Sven Müller 2008-10-30 22:03:59 UTC
I did it before and after starting mplayer. The output of dmesg was identical. With other words, running mplayer didn't add any message into dmesg.
Comment 25 Daniel Drake (RETIRED) gentoo-dev 2008-10-31 11:46:57 UTC
Can you post the output of "stat -L /dev/video0" from both a working modular kernel and a broken builtin kernel? Thanks.
Comment 26 Sven Müller 2008-11-07 14:50:24 UTC
Created attachment 170994 [details]
working modular kernel
Comment 27 Sven Müller 2008-11-07 14:50:52 UTC
Created attachment 170996 [details]
broken compiled-in kernel
Comment 28 Daniel Drake (RETIRED) gentoo-dev 2008-11-07 17:32:15 UTC
Would you mind double checking those results? I'm wondering if you got them the wrong way around.

Your "broken compiled-in kernel" attachment says:
 Device type: 51,0
but this is what I would expect to be the working configuration.

and your "working modular kernel" attachment says:
 Device type: ab,10
and this is just downright strange. Number "ab" is reserved for firewire. I'm really surprised that actions made on /dev/video0 get through to bttv in this case.

Can you please double check? I would expect that the broken configuration gives ab, and the working configuration gives 51, but the labelling of your attachments contradicts this.
Comment 29 Sven Müller 2008-11-07 23:45:49 UTC
(In reply to comment #28)
> I would expect that the broken configuration gives
> ab, and the working configuration gives 51, but the labelling of your
> attachments contradicts this.
> 

You were right. The working config is 51 and the broken one ab
Comment 30 Daniel Drake (RETIRED) gentoo-dev 2008-11-08 11:27:10 UTC
Thanks! That makes more sense, we are closer to the problem.

Next up, firstly for the working kernel:

Please post output of:
 udevinfo -q path -n /dev/video0

  note: if using a brand new udev, then replace udevinfo with "udevadm info" e.g.:
  udevadm info -q path -n /dev/video0
  (and same for all further instructions)

The output refers to a directory under /sys, which in turn will include a file named 'dev'. Please post it's contents. You can read it with this command:

 cat /sys/$(udevinfo -q path -n /dev/video0)/dev


Then repeat the above for the broken kernel.
Thanks!
Comment 31 Sven Müller 2008-11-09 16:51:03 UTC
Working modular kernel version: 
dev: 81
card: 10
index: 0
name: BT878 video (Hauppauge (bt878))
uevent: MAJOR=81, MINOR=0

Not working compiled-in kernel version:
udevadm: /devices/virtual/ieee1394_protocol/video1394-0
dev: 171:16
uevent: MAJOR=171, MINOR=16

It seems, the video-device was assigned to the firewire port. The firewire-connection is provided by my pci Soundblaster sound card and also compiled in into the kernel. 
Comment 32 Daniel Drake (RETIRED) gentoo-dev 2008-11-09 18:13:27 UTC
OK.. we've been looking at /dev/video0
I assume you also have a /dev/video1 ?

I think the issue is that /dev/video0 and /dev/video1 are swapping around in these two different configurations.
Comment 33 Sven Müller 2008-11-09 18:26:51 UTC
Broken version:
la /dev/vid*
lrwxrwxrwx 1 root root 10  9. Nov 17:41 /dev/video -> v4l/video0
lrwxrwxrwx 1 root root 10  9. Nov 17:41 /dev/video0 -> v4l/video0
lrwxrwxrwx 1 root root 10  9. Nov 17:41 /dev/video1394-0 -> v4l/video0

udevadm info -q path -n /dev/video1394-0 
/devices/virtual/ieee1394_protocol/video1394-0

There are 3 videosymlinks all showing to the firewire-device.
Comment 34 Daniel Drake (RETIRED) gentoo-dev 2008-11-17 23:27:52 UTC
Which version of udev is installed?
Comment 35 Sven Müller 2008-11-25 22:11:03 UTC
actual: 130-r1

But I had this problem since kernel-2.6.23. And since this kernel there have been some udev-updates.
Comment 36 Daniel Drake (RETIRED) gentoo-dev 2008-11-27 20:29:47 UTC
Please upgrade to udev-133 (130 was buggy) and post output of:

udevadm test /devices/virtual/ieee1394_protocol/video1394-0
Comment 37 Sven Müller 2008-12-02 20:28:56 UTC
Created attachment 174093 [details]
udevadm test with bttv driver compiled in - kernel-2.6.27-r1
Comment 38 Sven Müller 2008-12-02 20:29:42 UTC
Created attachment 174094 [details]
udevadm test bttv compiled as module - kernel-2.6.27-r1
Comment 39 Sven Müller 2008-12-02 20:30:23 UTC
Created attachment 174096 [details]
udevadm test bttv compiled in - kernel-2.6.27-r4
Comment 40 Sven Müller 2008-12-02 20:30:56 UTC
Created attachment 174098 [details]
udevadm test bttv compiled as module - kernel-2.6.27-r4
Comment 41 Sven Müller 2008-12-02 20:33:14 UTC
Strange. Indepedent of udev in kernel-2.6.27-r1 bttv didn't work as compiled in. But in 2.6.27-r4 it does. 

It seems the problem has been (temporarely) solved at least with kernel-2.6.27-r4. 
Comment 42 Daniel Drake (RETIRED) gentoo-dev 2008-12-02 21:04:11 UTC
I suspect that's just a coincidence and it will not hold. Or did you include a udev-135 upgrade? I see changes in the rules files which were causing this bug. Maybe udev-135 has fixed it?
Comment 43 Sven Müller 2008-12-04 08:58:00 UTC
Last udev version installed is 133. Upgrade to 135 I haven't included yet. I just booted the two kernel versions with the two different configurations. That was the only difference. The kernel configs of 27-r1 and 27-r4 are also the same. When upgrading I did just make oldconfig. 
Comment 44 Daniel Drake (RETIRED) gentoo-dev 2008-12-04 10:33:41 UTC
OK, probably just a coincidence as I don't think there have been relevant changes in the kernel between those 2 versions.
I found out that udev rules are what was creating a v4l-style node for the video1394 device, but fortunately those rules are gone in udev-135.

So, if this does reappear, please ensure you are running udev-135 or newer before reopening this bug.