2005-12-02 20:15:04

by Lukas Hejtmanek

[permalink] [raw]
Subject: CX8800 driver and 2.6.15-RC2

Hello,

I tried cx8800 driver with Leadtek Winfast 2000XP Expert card.
This is from dmesg:
cx2388x v4l2 driver version 0.0.5 loaded
ACPI: PCI Interrupt 0000:01:05.0[A] -> GSI 18 (level, low) -> IRQ 19
CORE cx88[0]: subsystem: 107d:6611, board: Leadtek Winfast 2000XP Expert
[card=5,autodetected]
TV tuner 44 at 0x1fe, Radio tuner -1 at 0x1fe
cx88[0]: Leadtek Winfast 2000XP Expert config: tuner=38, eeprom[0]=0x01
input: cx88 IR (Leadtek Winfast 2000XP as /class/input/input2
cx88[0]/0: found at 0000:01:05.0, rev: 5, irq: 19, latency: 64, mmio: 0xfd000000
tuner 0-0060: All bytes are equal. It is not a TEA5767
tuner 0-0060: chip found @ 0xc0 (cx88[0])
tuner 0-0060: type set to 38 (Philips PAL/SECAM multi (FM1216ME MK3))
tda9887 0-0043: chip found @ 0x86 (cx88[0])
cx88[0]/0: registered device video0 [v4l2]
cx88[0]/0: registered device vbi0
cx88[0]/0: registered device radio0

seems to be ok.

However, using xawtv I got:
This is xawtv-3.94, running on Linux/i686 (2.6.15-rc2-git1)
/dev/video0 [v4l2]: ioctl VIDIOC_G_FBUF: Invalid argument
v4l-conf had some trouble, trying to continue anyway
ioctl: VIDIOC_G_FBUF(capability=0x0 [];flags=0x0
[];base=(nil);fmt.width=0;fmt.height=0;fmt.pixelformat=0x00000000
[....];fmt.field=ANY;fmt.bytesperline=0;fmt.sizeimage=0;fmt.colorspace=unknown;fmt.priv=0):
Invalid argument
ioctl:
VIDIOC_TRY_FMT(type=VIDEO_OVERLAY;fmt.win.w.left=852;fmt.win.w.top=45;fmt.win.w.width=384;fmt.win.w.height=288;fmt.win.field=ANY;fmt.win.chromakey=0;fmt.win.clips=(nil);fmt.win.clipcount=0;fmt.win.bitmap=(nil)):
Invalid argument
ioctl:
VIDIOC_S_FMT(type=VIDEO_OVERLAY;fmt.win.w.left=852;fmt.win.w.top=45;fmt.win.w.width=384;fmt.win.w.height=288;fmt.win.field=ANY;fmt.win.chromakey=0;fmt.win.clips=(nil);fmt.win.clipcount=0;fmt.win.bitmap=(nil)):
Invalid argument
ioctl: VIDIOC_OVERLAY(int=0): Invalid argument
ioctl: VIDIOC_QBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP):
Bad address
ioctl: VIDIOC_QBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP):
Bad address
ioctl: VIDIOC_DQBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=unknown):
Invalid argument
ioctl: VIDIOC_QBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP):
Bad address
ioctl: VIDIOC_QBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP):
Bad address

I inserted video_buf module with debug option and I got:
kernel: vbuf: reqbufs: bufs=2, size=0x36000 [108 pages total]
kernel: vbuf: mmap setup: 2 buffers, 221184 bytes each
kernel: vbuf: mmap ca74c420: q=ca8fe848 ae94c000-ae982000 pgoff 00000000 bufs
0-0
kernel: vbuf: mmap ca74c3e0: q=ca8fe848 ae916000-ae94c000 pgoff 00000036 bufs
1-1
kernel: vbuf: init user [0xae94c000+0x36000 => 54 pages]
kernel: vbuf: get_user_pages: err=-14 [0]
kernel: vbuf: init user [0xae94c000+0x36000 => 54 pages]
kernel: vbuf: get_user_pages: err=-14 [0]
kernel: vbuf: munmap ca74c420 q=ca8fe848
kernel: vbuf: munmap ca74c3e0 q=ca8fe848
kernel: vbuf: init user [0x8476fc8+0x6c000 => 109 pages]
kernel: vbuf: reqbufs: bufs=2, size=0xe1000 [450 pages total]
kernel: vbuf: mmap setup: 2 buffers, 921600 bytes each
kernel: vbuf: mmap cfdd4f80: q=cec35848 b7304000-b73e5000 pgoff 00000000 bufs
0-0
kernel: vbuf: init user [0xb7304000+0xe1000 => 225 pages]
kernel: vbuf: get_user_pages: err=-14 [0]
kernel: vbuf: munmap cfdd4f80 q=cec35848


Is it a bug in kernel modules?

--
Luk?? Hejtm?nek


2005-12-02 20:38:22

by Michael Krufky

[permalink] [raw]
Subject: Re: CX8800 driver and 2.6.15-RC2

Lukas Hejtmanek wrote:

>Hello,
>
>I tried cx8800 driver with Leadtek Winfast 2000XP Expert card.
>This is from dmesg:
>cx2388x v4l2 driver version 0.0.5 loaded
>ACPI: PCI Interrupt 0000:01:05.0[A] -> GSI 18 (level, low) -> IRQ 19
>CORE cx88[0]: subsystem: 107d:6611, board: Leadtek Winfast 2000XP Expert
>[card=5,autodetected]
>TV tuner 44 at 0x1fe, Radio tuner -1 at 0x1fe
>cx88[0]: Leadtek Winfast 2000XP Expert config: tuner=38, eeprom[0]=0x01
>input: cx88 IR (Leadtek Winfast 2000XP as /class/input/input2
>cx88[0]/0: found at 0000:01:05.0, rev: 5, irq: 19, latency: 64, mmio: 0xfd000000
>tuner 0-0060: All bytes are equal. It is not a TEA5767
>tuner 0-0060: chip found @ 0xc0 (cx88[0])
>tuner 0-0060: type set to 38 (Philips PAL/SECAM multi (FM1216ME MK3))
>tda9887 0-0043: chip found @ 0x86 (cx88[0])
>cx88[0]/0: registered device video0 [v4l2]
>cx88[0]/0: registered device vbi0
>cx88[0]/0: registered device radio0
>
>seems to be ok.
>
>However, using xawtv I got:
>This is xawtv-3.94, running on Linux/i686 (2.6.15-rc2-git1)
>/dev/video0 [v4l2]: ioctl VIDIOC_G_FBUF: Invalid argument
>v4l-conf had some trouble, trying to continue anyway
>ioctl: VIDIOC_G_FBUF(capability=0x0 [];flags=0x0
>[];base=(nil);fmt.width=0;fmt.height=0;fmt.pixelformat=0x00000000
>[....];fmt.field=ANY;fmt.bytesperline=0;fmt.sizeimage=0;fmt.colorspace=unknown;fmt.priv=0):
>Invalid argument
>ioctl:
>VIDIOC_TRY_FMT(type=VIDEO_OVERLAY;fmt.win.w.left=852;fmt.win.w.top=45;fmt.win.w.width=384;fmt.win.w.height=288;fmt.win.field=ANY;fmt.win.chromakey=0;fmt.win.clips=(nil);fmt.win.clipcount=0;fmt.win.bitmap=(nil)):
>Invalid argument
>ioctl:
>VIDIOC_S_FMT(type=VIDEO_OVERLAY;fmt.win.w.left=852;fmt.win.w.top=45;fmt.win.w.width=384;fmt.win.w.height=288;fmt.win.field=ANY;fmt.win.chromakey=0;fmt.win.clips=(nil);fmt.win.clipcount=0;fmt.win.bitmap=(nil)):
>Invalid argument
>ioctl: VIDIOC_OVERLAY(int=0): Invalid argument
>ioctl: VIDIOC_QBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
>[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP):
>Bad address
>ioctl: VIDIOC_QBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
>[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP):
>Bad address
>ioctl: VIDIOC_DQBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
>[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=unknown):
>Invalid argument
>ioctl: VIDIOC_QBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
>[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP):
>Bad address
>ioctl: VIDIOC_QBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0
>[];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP):
>Bad address
>
>I inserted video_buf module with debug option and I got:
>kernel: vbuf: reqbufs: bufs=2, size=0x36000 [108 pages total]
>kernel: vbuf: mmap setup: 2 buffers, 221184 bytes each
>kernel: vbuf: mmap ca74c420: q=ca8fe848 ae94c000-ae982000 pgoff 00000000 bufs
>0-0
>kernel: vbuf: mmap ca74c3e0: q=ca8fe848 ae916000-ae94c000 pgoff 00000036 bufs
>1-1
>kernel: vbuf: init user [0xae94c000+0x36000 => 54 pages]
>kernel: vbuf: get_user_pages: err=-14 [0]
>kernel: vbuf: init user [0xae94c000+0x36000 => 54 pages]
>kernel: vbuf: get_user_pages: err=-14 [0]
>kernel: vbuf: munmap ca74c420 q=ca8fe848
>kernel: vbuf: munmap ca74c3e0 q=ca8fe848
>kernel: vbuf: init user [0x8476fc8+0x6c000 => 109 pages]
>kernel: vbuf: reqbufs: bufs=2, size=0xe1000 [450 pages total]
>kernel: vbuf: mmap setup: 2 buffers, 921600 bytes each
>kernel: vbuf: mmap cfdd4f80: q=cec35848 b7304000-b73e5000 pgoff 00000000 bufs
>0-0
>kernel: vbuf: init user [0xb7304000+0xe1000 => 225 pages]
>kernel: vbuf: get_user_pages: err=-14 [0]
>kernel: vbuf: munmap cfdd4f80 q=cec35848
>
>
>Is it a bug in kernel modules?
>
Close, but no cigar ;-)

It was a memory management bug.... Already fixed in -rc3 (where new bugs
were introduced) ...

-rc4 isn't bad, but a whole slew of v4l / dvb bugfixes went in JUST
after -rc4 release...

Can you try 2.6.15-rc4-git1 and let us know how things are?

Cheers,

Michael Krufky

2005-12-03 18:08:21

by Lukas Hejtmanek

[permalink] [raw]
Subject: Re: CX8800 driver and 2.6.15-RC2

On Fri, Dec 02, 2005 at 03:37:59PM -0500, Michael Krufky wrote:
> Close, but no cigar ;-)
>
> It was a memory management bug.... Already fixed in -rc3 (where new bugs
> were introduced) ...
>
> -rc4 isn't bad, but a whole slew of v4l / dvb bugfixes went in JUST
> after -rc4 release...
>
> Can you try 2.6.15-rc4-git1 and let us know how things are?

well, with 2.6.15-rc4-git video_buf related problems are gone, but it's still
far from usable. xawtv is unable to use tunner. Moreover, it seems that it
cannot get another capture format than 320x240 RGB.

--
Luk?? Hejtm?nek

2005-12-03 21:10:33

by Michael Krufky

[permalink] [raw]
Subject: Re: CX8800 driver and 2.6.15-RC2

Lukas Hejtmanek wrote:

>On Fri, Dec 02, 2005 at 03:37:59PM -0500, Michael Krufky wrote:
>
>
>>It was a memory management bug.... Already fixed in -rc3 (where new bugs
>>were introduced) ...
>>
>>-rc4 isn't bad, but a whole slew of v4l / dvb bugfixes went in JUST
>>after -rc4 release...
>>
>>Can you try 2.6.15-rc4-git1 and let us know how things are?
>>
>>
>well, with 2.6.15-rc4-git video_buf related problems are gone, but it's still
>far from usable. xawtv is unable to use tunner.
>
Which card do you have? What card # does it report in dmesg? What
tuner # is it using? What is the PCI Subsystem id?

The following MIGHT fix it.... If so, I'll need the answers to the four
questions above, in order to make this behavior occur by default:

modprobe tda9887

This fixes the problem for analog video with pcHDTV 3000 and DViCO
FusionHDTV3 Gold-T. We've already fixed it in cvs so that this will be
detected by default, if you have a different card, we might have to
apply a similar fix. If that doesn't help, then it's a different bug.

>Moreover, it seems that it cannot get another capture format than 320x240 RGB.
>
--
Michael Krufky


2005-12-04 10:06:28

by Lukas Hejtmanek

[permalink] [raw]
Subject: Re: CX8800 driver and 2.6.15-RC2

On Sat, Dec 03, 2005 at 04:10:30PM -0500, Michael Krufky wrote:
> Which card do you have? What card # does it report in dmesg? What
> tuner # is it using? What is the PCI Subsystem id?

This is from dmesg:
cx2388x v4l2 driver version 0.0.5 loaded
ACPI: PCI Interrupt 0000:01:05.0[A] -> GSI 18 (level, low) -> IRQ 19
CORE cx88[0]: subsystem: 107d:6611, board: Leadtek Winfast 2000XP Expert
[card=5,autodetected]
TV tuner 44 at 0x1fe, Radio tuner -1 at 0x1fe
cx88[0]: Leadtek Winfast 2000XP Expert config: tuner=38, eeprom[0]=0x01
input: cx88 IR (Leadtek Winfast 2000XP as /class/input/input2
cx88[0]/0: found at 0000:01:05.0, rev: 5, irq: 19, latency: 64, mmio: 0xfd000000
tuner 0-0060: All bytes are equal. It is not a TEA5767
tuner 0-0060: chip found @ 0xc0 (cx88[0])
tuner 0-0060: type set to 38 (Philips PAL/SECAM multi (FM1216ME MK3))
tda9887 0-0043: chip found @ 0x86 (cx88[0])
cx88[0]/0: registered device video0 [v4l2]
cx88[0]/0: registered device vbi0
cx88[0]/0: registered device radio0


I have Leadtek Winfast 2000XP Expert (it means, it's detected correctly)

However, I see it's a little bit confused about tunner - once it reports tunner
# 44 and # 38.

I noticed some messages from /var/log/messages:
kernel: cx88[0]: video y / packed - dma channel status dump
kernel: cx88[0]: cmds: initial risc: 0x07e15000
kernel: cx88[0]: cmds: cdt base : 0x00180440
kernel: cx88[0]: cmds: cdt size : 0x0000000c
kernel: cx88[0]: cmds: iq base : 0x00180400
kernel: cx88[0]: cmds: iq size : 0x00000010
kernel: cx88[0]: cmds: risc pc : 0x07e15034
kernel: cx88[0]: cmds: iq wr ptr : 0x00000109
kernel: cx88[0]: cmds: iq rd ptr : 0x0000010d
kernel: cx88[0]: cmds: cdt current : 0x00000488
kernel: cx88[0]: cmds: pci target : 0x06ecf000
kernel: cx88[0]: cmds: line / byte : 0x03200000
kernel: cx88[0]: risc0: 0x80008200 [ sync resync count=512 ]
kernel: cx88[0]: risc1: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: risc2: 0x0720f000 [ INVALID eol irq2 irq1 21 resync 14 13 12 count=0 ]
kernel: cx88[0]: risc3: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: iq 0: 0x0720f300 [ INVALID eol irq2 irq1 21 resync 14 13 12 count=768 ]
kernel: cx88[0]: iq 1: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: iq 2: 0x0720f600 [ arg #1 ]
kernel: cx88[0]: iq 3: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: iq 4: 0x0720f900 [ arg #1 ]
kernel: cx88[0]: iq 2: 0x0720f600 [ arg #1 ]
kernel: cx88[0]: iq 3: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: iq 4: 0x0720f900 [ arg #1 ]
kernel: cx88[0]: iq 5: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: iq 6: 0x0720fc00 [ arg #1 ]
kernel: cx88[0]: iq 7: 0x18000100 [ write sol count=256]
kernel: cx88[0]: iq 8: 0x0720ff00 [ arg #1 ]
kernel: cx88[0]: iq 9: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: iq a: 0x06eced00 [ arg #1 ]
kernel: cx88[0]: iq b: 0x71010000 [ jump irq1 cnt0 count=0 ]
kernel: cx88[0]: iq c: 0x80008200 [ arg #1 ]
kernel: cx88[0]: iq d: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: iq e: 0x0720f000 [ arg #1 ]
kernel: cx88[0]: iq f: 0x1c000300 [ write sol eol count=768 ]
kernel: cx88[0]: iq 10: 0x00180c00 [ arg #1 ]
kernel: cx88[0]: fifo: 0x00180c00 -> 0x183400
kernel: cx88[0]: ctrl: 0x00180400 -> 0x180460
kernel: cx88[0]: ptr1_reg: 0x00180c00
kernel: cx88[0]: ptr2_reg: 0x00180448
kernel: cx88[0]: cnt1_reg: 0x00000000
kernel: cx88[0]: cnt2_reg: 0x00000000
kernel: cx88[0]/0: [c1299580/0] timeout - dma=0x07e15000
kernel: cx88[0]/0: [c1299b80/1] timeout - dma=0x06ecd000


> The following MIGHT fix it.... If so, I'll need the answers to the four
> questions above, in order to make this behavior occur by default:
>
> modprobe tda9887

Ok, I try it on next weekend (unfortunately, I'm able to do test only on
weekends).

--
Luk?? Hejtm?nek

2005-12-12 14:29:30

by Lukas Hejtmanek

[permalink] [raw]
Subject: Re: CX8800 driver and 2.6.15-RC2

On Sat, Dec 03, 2005 at 04:10:30PM -0500, Michael Krufky wrote:
> modprobe tda9887
>
> This fixes the problem for analog video with pcHDTV 3000 and DViCO
> FusionHDTV3 Gold-T. We've already fixed it in cvs so that this will be
> detected by default, if you have a different card, we might have to
> apply a similar fix. If that doesn't help, then it's a different bug.

well, module tda9887 is loaded properly using autodetect.

However, using xawtv I was able to see video at good quality, but no sound :(
(even when I set PAL-BG norm). But after a while, it complained about QFBUF
ioctl and from that moment TV capture stopped working until reboot (rmmod cx8800
& rmmod cx88xx did not help).

I might be a video_buf bug, I did not removed video_buf module.

--
Luk?? Hejtm?nek