[pvrusb2] PARTIAL SUCCESS Re: terratec grabster av400.. short report..

Andrea Venturi a.venturi at cineca.it
Mon Jan 7 06:01:36 CST 2008


Mike Isely wrote:

[...]

> 
> The cx25840 has a number of possible inputs.  Some are composite and
> some are paired in such a way to form an s-video input.  The wiring
> and pairing depends on the surrounding circuits.  Obviously this is
> different in your case.  The pvrusb2 driver assumes the wiring present
> in the Hauppauge hardware of course and that assumption is probably
> wrong here.  Very likely what's happening is that we need to change
> this for your hardware.  Unfortunately there's going to be some
> guesswork here and it's hard to explain concisely in an e-mail.
> 
> 

hi.

after the reworking of the driver with the new simplified routing scheme 
from Mike Isely (big kudos to him again for the overall care), i get 
back working on the Terratec Grabster av400

http://www.terratec.it/prodotti/video_editing/grabster_av400/board.JPG

and indeed now it's really easy to get it supported in the new environment!

in attach there's the first iteration of the patch.

it's not ready and polished but at least it's a start.

i have to tell you i run a 2.6.23.9 kernel with v4l BUT without pvrusb2 
in-kernel driver and using this latest isely.net driver:

   http://www.isely.net/downloads/pvrusb2-mci-20071202.tar.bz2

you can simply patch this driver with the attached file and install the 
module on your kernel.

BEWARE this patch CAN crash everything!! don't do it on a production 
machine!!


this way, when you attach the device, the Terratec Grabster should be 
recognized and start [*]. no firmware needed..

then you should switch to the composite input with this command (it 
starts on input tv as default, but we don't have a tuner, i put it on 
the right composite input anyway!):

   echo composite > /sys/class/pvrusb2/unit-a/ctl_input/cur_val

maybe we could provide a different default input on module loading (on a 
case by case based on the card type?)


andrea at nb-venturi:/sys/class/pvrusb2/unit-a$ cat debuginfo
Driver state info:
driver: <ok> <init> <connected>
pipeline: <idle> <configok>
worker: <decode:quiescent> <encode:stop> <encode:wait> <usb:stop>
state: ready
Attached I2C modules:
cx25840 @ 0x44 (handler: pvrusb2-cx2584x-v4l) [v4l2_standard 
v4l2_audiomode v4l2_bcsh v4l2_volume v4l2_freq v4l2_size v4l2_log]


in dmesg you'll see:

...
[ 2643.352046] pvrusb2: =================  START STATUS CARD #0 
=================
[ 2643.354794] cx25840 0-0044: Video signal:              present
[ 2643.354974] cx25840 0-0044: Detected format:           PAL-BDGHI
[ 2643.355139] cx25840 0-0044: Specified standard:        PAL-BDGHI
[ 2643.355290] cx25840 0-0044: Specified video input:     Composite 1
[ 2643.355516] cx25840 0-0044: Specified audioclock freq: 48000 Hz
[ 2643.355667] pvrusb2: cx2341x config:
[ 2643.355809] pvrusb2: Stream: MPEG-2 Program Stream
[ 2643.355962] pvrusb2: VBI Format: No VBI
[ 2643.356104] pvrusb2: Video:  720x480, 30 fps
[ 2643.356247] pvrusb2: Video:  MPEG-2, 4x3, Variable Bitrate, 6000000, 
Peak 8000000
[ 2643.356413] pvrusb2: Video:  GOP Size 12, 2 B-Frames, GOP Closure
[ 2643.356562] pvrusb2: Audio:  48 kHz, Layer II, 224 kbps, Stereo, No 
Emphasis, No CRC
[ 2643.356723] pvrusb2: Spatial Filter:  Manual, Luma 1D Horizontal, 
Chroma 1D Horizontal, 0
[ 2643.356874] pvrusb2: Temporal Filter: Manual, 8
[ 2643.357019] pvrusb2: Median Filter:   Off, Luma [0, 255], Chroma [0, 255]
[ 2643.357168] pvrusb2_a driver: <ok> <init> <connected>
[ 2643.357313] pvrusb2_a pipeline: <idle> <configok>
[ 2643.357456] pvrusb2_a worker: <decode:quiescent> <encode:stop> 
<encode:wait> <usb:stop>
[ 2643.357606] pvrusb2_a state: ready
[ 2643.357789] pvrusb2: ==================  END STATUS CARD #0 
==================


note the cx2341x config: it's still NTSC based in my opinion (720x480 
30fps..)

and you should get a color program stream with:

   cat /dev/video0 > /tmp/prova.mpg

BUT i still have three glitches:


1- BEWARE! sometime the kernel oops (don't know why! maybe it's still 
the missing tuner but still configured?), i'm going to provide more 
details when it occurs again



2- the audio stream is too quick, no idea!
here you can see a sample broken stream (with my face!)

   http://mhplab.cineca.tv/grabster-audio-broken.mpg

this what mplayer tells me about it:

==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
dec_audio: Allocating 4608 + 65536 = 70144 bytes for output buffer.
mp3lib: using SSE optimized decore!
MP3lib: init layer2&3 finished, tables done
MPEG 1.0, Layer II, 48000 Hz 224 kbit Stereo, BPF: 672
Channels: 2, copyright: No, original: No, CRC: No, emphasis: 0
AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================


maybe i need to change the cx2341x config; how can i do it using the 
/sys/class/pvrusb2/*/ctl_ controls?

i did find a way to change audio sampling rate (ctl_srate to 44.1KHz) 
but the audio then was completely missing on the stream..


what about change the video frame rate.. from 30 to 25fps? don't see a 
fps control..


3- the svideo input is still slightly broken! with Luma2 i see the black 
and white image BUT i tried evey ChromaX combination (4..8) and i got 
only B&W or flat green (!)

do you have a hint about this?


let me know if it works more or less for you grabster owner too..



bye

andrea



[*] starting dmesg on a succesful load a bit garbled!

================
[ 2598.183188] usb 2-2.2.4: new high speed USB device using ehci_hcd and 
address 6
[ 2598.214679] usb 2-2.2.4: configuration #1 chosen from 1 choice
[ 2598.414400] Linux video capture interface: v2.00
[ 2599.178051] usbcore: registered new interface driver pvrusb2
[ 2599.178357] 
/usr/local/src/andrea/pvrusb2-mci-20071202/driver/pvrusb2-main.c: 
Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tun
er : 20071202 (from www.isely.net)
[ 2599.178579] 
/usr/local/src/andrea/pvrusb2-mci-20071202/driver/pvrusb2-main.c: Debug 
mask is 31 (0x1f)
[ 2599.215230] usb 2-2.2.4: USB disconnect, address 6
[ 1039.318668] pvrusb2: Failed to submit write-control URB status=-19
[ 1039.318803] pvrusb2: Device being rendered inoperable
[ 1039.318867] pvrusb2: ***WARNING*** pvrusb2 device hardware appears to 
be jammed and I can't clear it.
[ 1039.318959] pvrusb2: You might need to power cycle the pvrusb2 device 
in order to recover.
[ 2599.696069] usb 2-2.2.4: new high speed USB device using ehci_hcd and 
address 7
[ 2599.713675] usb 2-2.2.4: configuration #1 chosen from 1 choice
[ 2599.790925] usb 2-2.2.4: reset high speed USB device using ehci_hcd 
and address 7
[ 1949.480221] cx25840 0-0044: cx25837-23 found @ 0x88 (pvrusb2_a)
[ 1949.500203] pvrusb2: Supported video standard(s) reported available 
in hardware: PAL-B/B1/D/D1/G/H/I/K/M/N/Nc/60;NTSC-M/
[ 1949.500369] pvrusb2: Mapping standards mask=0xffffff 
(PAL-B/B1/D/D1/G/H/I/K/M/N/Nc/60;NTSC-M/Mj/443/Mk;)
[ 1949.500505] pvrusb2: Setting up 28 unique standard(s)
[ 1949.500620] pvrusb2: Set up standard idx=0 name=PAL-B/G
[ 1949.500734] pvrusb2: Set up standard idx=1 name=PAL-D/K
[ 1949.500847] pvrusb2: Set up standard idx=2 name=SECAM-B/G
[ 1949.500960] pvrusb2: Set up standard idx=3 name=SECAM-D/K
[ 1949.501074] pvrusb2: Set up standard idx=4 name=NTSC-M
[ 1949.501186] pvrusb2: Set up standard idx=5 name=NTSC-Mj
[ 1949.501299] pvrusb2: Set up standard idx=6 name=NTSC-443
[ 1949.501411] pvrusb2: Set up standard idx=7 name=NTSC-Mk
[ 1949.501523] pvrusb2: Set up standard idx=8 name=PAL-B
[ 1949.501634] pvrusb2: Set up standard idx=9 name=PAL-B1
[ 1949.501746] pvrusb2: Set up standard idx=10 name=PAL-G
[ 1949.501859] pvrusb2: Set up standard idx=11 name=PAL-H
[ 1949.501971] pvrusb2: Set up standard idx=12 name=PAL-I
[ 1949.502083] pvrusb2: Set up standard idx=13 name=PAL-D
[ 1949.502221] pvrusb2: Set up standard idx=14 name=PAL-D1
[ 1949.502334] pvrusb2: Set up standard idx=15 name=PAL-K
[ 1949.502483] pvrusb2: Set up standard idx=16 name=PAL-M
[ 1949.502595] pvrusb2: Set up standard idx=17 name=PAL-N
[ 1949.502705] pvrusb2: Set up standard idx=18 name=PAL-Nc
[ 1949.502815] pvrusb2: Set up standard idx=19 name=PAL-60
[ 1949.502925] pvrusb2: Set up standard idx=20 name=SECAM-B
[ 1949.503034] pvrusb2: Set up standard idx=21 name=SECAM-D
[ 1949.503144] pvrusb2: Set up standard idx=22 name=SECAM-G
[ 1949.503254] pvrusb2: Set up standard idx=23 name=SECAM-H
[ 1949.503364] pvrusb2: Set up standard idx=24 name=SECAM-K
[ 1949.503473] pvrusb2: Set up standard idx=25 name=SECAM-K1
[ 1949.503583] pvrusb2: Set up standard idx=26 name=SECAM-L
[ 1949.503693] pvrusb2: Set up standard idx=27 name=SECAM-LC
[ 1949.503822] pvrusb2: Initial video standard auto-selected to PAL-B/G
[ 1949.503940] pvrusb2: Device initialization completed successfully.
[ 2600.075743] cx25840 0-0044: Video signal:              present
[ 2600.075940] cx25840 0-0044: Detected format:           PAL-BDGHI
[ 2600.076137] cx25840 0-0044: Specified standard:        PAL-BDGHI
[ 2600.076286] cx25840 0-0044: Specified video input:     Composite 1
[ 2600.076434] cx25840 0-0044: Specified audioclock freq: 48000 Hz
[ 2600.227676] pvrusb2: registered device video0 [mpeg]
[ 2600.228935] pvrusb2: registered device radio0 [mpeg]
===================
-------------- next part --------------
diff -u driver-orig/pvrusb2-cx2584x-v4l.c driver/pvrusb2-cx2584x-v4l.c
--- driver-orig/pvrusb2-cx2584x-v4l.c	2007-11-25 07:41:37.000000000 +0100
+++ driver/pvrusb2-cx2584x-v4l.c	2008-01-07 12:48:40.000000000 +0100
@@ -105,6 +105,26 @@
 	},
 };
 
+/* Specific to terratec grabster av400 device */
+static const struct routing_scheme_item routing_schemeav400[] = {
+	[PVR2_CVAL_INPUT_TV] = { /* Treat the same as composite */
+		.vid = CX25840_COMPOSITE1,
+		.aud = CX25840_AUDIO_SERIAL,
+	},
+	[PVR2_CVAL_INPUT_RADIO] = { /* Treat the same as composite */
+		.vid = CX25840_COMPOSITE1,
+		.aud = CX25840_AUDIO_SERIAL,
+	},
+	[PVR2_CVAL_INPUT_COMPOSITE] = {
+		.vid = CX25840_COMPOSITE1,
+		.aud = CX25840_AUDIO_SERIAL,
+	},
+	[PVR2_CVAL_INPUT_SVIDEO] = {
+		.vid = (CX25840_SVIDEO_LUMA2|CX25840_SVIDEO_CHROMA8),
+		.aud = CX25840_AUDIO_SERIAL,
+	},
+};
+
 static const struct routing_scheme routing_schemes[] = {
 	[PVR2_ROUTING_SCHEME_HAUPPAUGE] = {
 		.def = routing_scheme0,
@@ -114,6 +134,10 @@
 		.def = routing_schemegv,
 		.cnt = ARRAY_SIZE(routing_schemegv),
 	},
+	[PVR2_ROUTING_SCHEME_GRABSTER] = {
+		.def = routing_schemeav400,
+		.cnt = ARRAY_SIZE(routing_schemeav400),
+	},
 };
 
 static void set_input(struct pvr2_v4l_cx2584x *ctxt)
Binary files driver-orig/pvrusb2-cx2584x-v4l.o and driver/pvrusb2-cx2584x-v4l.o differ
diff -u driver-orig/pvrusb2-devattr.c driver/pvrusb2-devattr.c
--- driver-orig/pvrusb2-devattr.c	2007-12-03 03:31:38.000000000 +0100
+++ driver/pvrusb2-devattr.c	2008-01-05 22:45:35.000000000 +0100
@@ -38,11 +38,13 @@
 #define PVR2_HDW_TYPE_29XXX 0
 #define PVR2_HDW_TYPE_24XXX 1
 #define PVR2_HDW_TYPE_GOTVIEW_2 2
+#define PVR2_HDW_TYPE_GRABSTER_AV400 3
 
 struct usb_device_id pvr2_device_table[] = {
 	[PVR2_HDW_TYPE_29XXX] = { USB_DEVICE(0x2040, 0x2900) },
 	[PVR2_HDW_TYPE_24XXX] = { USB_DEVICE(0x2040, 0x2400) },
 	[PVR2_HDW_TYPE_GOTVIEW_2] = { USB_DEVICE(0x1164, 0x0622) },
+	[PVR2_HDW_TYPE_GRABSTER_AV400] = { USB_DEVICE(0x0ccd, 0x0039) },
 	{ }
 };
 
@@ -75,6 +77,15 @@
 #endif
 };
 
+// Names of other client modules to request for Gotview 2 model hardware
+static const char *pvr2_client_grabster_av400[] = {
+	"cx25840",
+	"tuner",
+#ifdef PVR2_ENABLE_TDA9887
+	"tda9887",
+#endif
+};
+
 /* Firmware file name(s) for 29xxx devices */
 static const char *pvr2_fw1_names_29xxx[] = {
 		"v4l-pvrusb2-29xxx-01.fw",
@@ -120,6 +131,14 @@
 		.default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
 		.signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
 	},
+	[PVR2_HDW_TYPE_GRABSTER_AV400] = {
+		.description = "Terratec Grabster AV400",
+		.shortname = "av400",
+		.client_modules.lst = pvr2_client_grabster_av400,
+		.client_modules.cnt = ARRAY_SIZE(pvr2_client_grabster_av400),
+		/* .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3, */
+		.signal_routing_scheme = PVR2_ROUTING_SCHEME_GRABSTER,
+	},
 };
 
 const unsigned int pvr2_device_count = ARRAY_SIZE(pvr2_device_descriptions);
diff -u driver-orig/pvrusb2-devattr.h driver/pvrusb2-devattr.h
--- driver-orig/pvrusb2-devattr.h	2007-12-03 05:16:59.000000000 +0100
+++ driver/pvrusb2-devattr.h	2008-01-05 22:46:47.000000000 +0100
@@ -38,6 +38,7 @@
 
 #define PVR2_ROUTING_SCHEME_HAUPPAUGE 0
 #define PVR2_ROUTING_SCHEME_GOTVIEW 1
+#define PVR2_ROUTING_SCHEME_GRABSTER 2
 
 /* This describes a particular hardware type (except for the USB device ID
    which must live in a separate structure due to environmental
Binary files driver-orig/pvrusb2-devattr.o and driver/pvrusb2-devattr.o differ
Binary files driver-orig/pvrusb2.ko and driver/pvrusb2.ko differ
diff -u driver-orig/pvrusb2.mod.c driver/pvrusb2.mod.c
--- driver-orig/pvrusb2.mod.c	2008-01-07 11:36:07.000000000 +0100
+++ driver/pvrusb2.mod.c	2008-01-05 22:47:12.000000000 +0100
@@ -120,3 +120,4 @@
 MODULE_ALIAS("usb:v2040p2900d*dc*dsc*dp*ic*isc*ip*");
 MODULE_ALIAS("usb:v2040p2400d*dc*dsc*dp*ic*isc*ip*");
 MODULE_ALIAS("usb:v1164p0622d*dc*dsc*dp*ic*isc*ip*");
+MODULE_ALIAS("usb:v0CCDp0039d*dc*dsc*dp*ic*isc*ip*");
Binary files driver-orig/pvrusb2.mod.o and driver/pvrusb2.mod.o differ
Binary files driver-orig/pvrusb2.o and driver/pvrusb2.o differ
Common subdirectories: driver-orig/.tmp_versions and driver/.tmp_versions


More information about the pvrusb2 mailing list