# [HOWTO] CX88

## BoogleOogle

I had a lot of problems with my Leadtek TV2000XP Expert, until I patched the kernel, and loaded tda9887. Heres how I got it working  :Smile: 

The CX88 driver in kernel 2.6 (not present in 2.4iirc) is version 0.0.1 alpha. Not much use to anybody. So you need to patch the kernel to the latest version on offer. You could use a specific version (say 0.0.2), but its fairly messy.

First go to http://www.bytesex.org and click on the patches link. Navigate to the patch directory for your kernel (hopefully a 2.6 series). Download the 'patch-<kernel>-kraxel.gz' file, and put it in your /usr/src directory.

The patch might not be gzipped, in which case you may want to gzip it now:

gzip /usr/src/patch-<kernel>-kraxel.gz

mv /usr/src/patch-<kernel>-kraxel.gz.gz /usr/src/patch-<kernel>-kraxel.diff.gz

This is optional, but saves a bit of space. Afterall, it would only be wasted otherwise. Make sure that the file isn't gzipped before performing the above operation!

Next you need to apply the patch. Ensure that /usr/src/linux points to the correct kernel source (should be your most recent one). Then run either:

(if the file is gzipped)

zcat patch-<kernel>-kraxel.diff.gz | patch -p0

(if the file isn't gzipped)

cat patch-<kernel>-kraxel.diff.gz | patch -p0

The kernel is now patched. Now you need to configure (make menuconfig) the kernel to your liking, making sure to build in video4linux(2) and build the drivers for your TV card as modules (you can build them into the kernel later if neccesary). Also make sure you either build in, or build as modules I2C support, I2C device interface, and I2C bit-banging.

Compile and install the modules (make && make modules_install for 2.6 kernels).

Put the kernel into your boot directory, and make sure to ammend your boot loader (this is where Grub can be useful since its just a single config change and nothing else) to boot from this kernel. DO NOT overwrite your old kernel or remove its entries from the loader. If something goes wrong, you'll want your old kernel to boot into Linux and fix the problem.

When you boot back into Linux, the modules should hopefully already be loaded. If not, run 'modprobe cx8800' as root. Run dmesg and check to make sure everything was autodetected correctly. If not you'll need to pass some arguments, specifically the card number and tuner number.

To find the card number check out the file CARDLIST.bttv in the /usr/src/linux/Documentation/video4linux/CARDLIST.bttv. The tuner list is in the same location, but called CARDLIST.tuner. To pass the arguments with modprobe use:

modprobe cx8800 card=x tuner=x

You may want to put the following line into /etc/modules.d/cx88 and then run modules-update:

options cx8800 card=x tuner=x

options tuner=x

The tuner line may or may not work because the cx8800 module usually overrides any tuner settings.

Once you have the module up and running, you should be able to get TV!

Open up tvtime (or your favourite TV program), and set the basic settings such as region and television standard. Next (if possible) test Composite input. This will generally work even if something is set up wrong. If composite works, you can try with normal TV. Switch the mode back to Television and run a scan for channels. If nothing is found don't fret! Try loading the tda9887 module with modprobe. Some tuners need this module to work. Once loaded, you can load your favourite TV app again, and have another bash at tuning. With any luck, all stations (with a strong enough signal) will be found. If still nothing works (esp if you were playing around with card and tuner settings), try a reboot. If it doesn't work then, try the tda9887 modules. If it STILL doesn't work, and nothing is autodetected (ie. you have to specify the card and tuner), then you have probably set the wrong tuner. Have a little play around  :Smile: 

If you STILL can't get it to work, then I don't have a clue what might be wrong :p

Good luck  :Smile: 

Oh btw, I can't get a single drop of audio from my cx88 card, so if anyone gets audio working, please tell me how!

----------

## wrekno

Hi, i have some problems with my Leadtek Winfast TV200 XP Expert. I made the changes you wrote in the how-to, but still have some problems.

I'm using 2.6.7-rc3-mm1 sources.

Without the patch it could only recognise the card type, but wanted to use with tuner=4 (no tuner). So I patched my kernel-sources, and now it autodetects tuner=38. It can be good, i couldn't find out what kind of tuner does it have.

My problems are (with tvtime, haven't tried anything else):

1) No audio2) All channels are black & white3) tvtime says:

Failed to get 1024 Hz resolution from your RTC device. High resolution access is necessary for video to be smooth.

I would like to use this command:

```
sysctl -w dev.rtc.max-user-freq=1024
```

Which is the best way to make it automatic at boot time?

----------

## wrekno

2) I've changed the value of 'Pictrure settings / Hue' to 0, and now most of the channels are coloured.3) /etc/sysctl.conf

----------

## reaz82

about the sysctl.conf .. is this file automatically sourced/parsed during boot time?

----------

## bdemore

Has anyone gotten the audio figured out?

----------

## wrekno

not yet, but one of my friends connect the audio-out to the cd-in and it works for him, but it didn't work for the first time. He doesn't know how he made it. I have no time to try it out. Good luck

----------

## hhouwaard

Hi all,

This discussion has been very helpfull sofar, but on my system (Mdk10AMD64) I have only been able to watch static black screens. I might have a problem with the detected tuner type or something, but I'm unsure how to get to the correct options with this card. In TVTime I get the message "No signal".  Some webpage with help on this mentions to disable signal detections. My problem is that none of the channels I can select for the west-europe setting results in anything different then static. 

Anyone here that can help me get a step further in this process?

Output of dmesg is as follows:

cx2388x v4l2 driver version 0.0.4 loaded

cx8800[0]: found at 0000:02:06.0, rev: 5, irq: 5, latency: 32, mmio: 0xea000000

cx8800[0]: subsystem: 0070:3401, board: Hauppauge WinTV 34xxx models [card=1,autodetected]

tuner: chip found at addr 0xc2 i2c-bus cx8800[0]

cx8800[0]: i2c attach [client=(tuner unset)]

cx8800[0]: i2c register ok

cx8800[0]: hauppauge eeprom: model=34704, tuner=LG TPI8PSB11D (29), radio=no

tuner: type set to 29 (LG PAL_BG (TPI8PSB11D)) by cx8800[0]

cx8800[0]: registered device video0 [v4l2]

cx8800[0]: registered device vbi0

cx8800[0]: set_audio_standard_BTSC (status: known-good)

cx8800[0]: cx88: tvaudio thread started

cx8800[0]: AUD_STATUS: 0x432 [mono/no pilot] ctl=BTSC_AUTO_STEREO

Hans

----------

## dextur

Say could you post exactly what you do with the Leadtek card?

Card= tuner= and so on. 

Is there any difference for PAL and NTSC btw.

Does the remote work?

I am looking to buy one.

Regards

Per

----------

## Goya13

This card was good for video in. 

I got true color, nicely rendered input from my XBOX.

Sound recquired me to send a hardware wire from it to my sound cards line in (inside the case). Its a cheap hack, but it worked....

Now, the remote. THE REMOTE WILL NEVER EVER EVER WORK. If you want this card, be prepared to NEVER EVER use the remote.

I'm getting a replacement too, so what did you find? Haupauge WinTv?

----------

## cwng

 *Quote:*   

> Has anyone gotten the audio figured out?

 

The Leadtek TV2000XP should have given you a sound cable to connect from the TV2000XP PCI card's Audio Out to your sound card (or motherboard, in case of integrated Audio).  Most sound card will have two internal inputs: CD-In and Aux.  CD-In is usually used by the CD-Drive, so for me, I connect it to the AUX.

Now AUX is normally turned off by alsa, so you have to set it back on.

To see the list of alsa controls, run:

```
beethoven root # amixer contents
```

This gives a whole list of controls, there should be 'Aux' settings: 

```
<... snip ...>

numid=59,iface=MIXER,name='Aux Playback Switch'

  ; type=BOOLEAN,access=rw---,values=1

  : values=off

numid=60,iface=MIXER,name='Aux Playback Volume'

  ; type=INTEGER,access=rw---,values=2,min=0,max=31,step=0

  : values=0,0

<... snip ...>
```

So, now turn the switch on, and set the desired volume:

```
beethoven root # amixer cset numid=59 on

numid=59,iface=MIXER,name='Aux Playback Switch'

  ; type=BOOLEAN,access=rw---,values=1

  : values=on

beethoven root # amixer cset numid=60 29,29

numid=60,iface=MIXER,name='Aux Playback Volume'

  ; type=INTEGER,access=rw---,values=2,min=0,max=31,step=0

  : values=29,29

```

Hope this helps.

PS: My TV are also B/W, but I have not tried the hue=0 method.  I will try it once I got back home tonight, and report any success (cross my fingers).   :Smile: 

----------

## cwng

 *hhouwaard wrote:*   

> Anyone here that can help me get a step further in this process?
> 
> Output of dmesg is as follows:
> 
> cx2388x v4l2 driver version 0.0.4 loaded
> ...

 

Looking at the dmesg, your card should be autodetected fine: card=1,  tuner=29.

Sorry, I am just guessing but I can't infer from your post whether you have configured tvtime correctly.  It might be your tvtime setting that is wrong.  Are you using 'PAL' in tvtime? Have you did a tvtime-scanner?

/rgds

/cwng

----------

## cwng

 *wrekno wrote:*   

>  now it autodetects tuner=38. It can be good, i couldn't find out what kind of tuner does it have.

 

I actaully got so worked up when I can only get b/w TV  (when in Windows the card is working prefectly), that I tore away the "Leadtek" sticker on the tuner hardware, and underneath it reveals "Philips" and the Part number, which confirms the autodetected tuner = 38 is correct according to /usr/src/linux/Documentation/video4linux/CARDLIST.tuner.

 :Smile: 

----------

## Goya13

I tried the new cvs snapshot http://dl.bytesex.org/cvs-snapshots/input-20040421-115547.tar.gz

and the video4linux cvs snapshot

Does anyone know how cx88 communicates with either i2c or gpio, what  modules to use or something like that?

How can I get the remote to work????

This is so frustrating.

----------

## Nate_S

according to /usr/src/linux/Documentation/video4linux/README.cx88, sound is only working for PAL-BG at the moment.

----------

## Cyberwizzard

As I posted in of the other forums I'm also struggling to get the remote to work with the WinFast TV 2000 XP... According to the guy who wrote the drivers it should be possible to register the remote as a normal keyboard...

Has anyone gotten the remote to work in some way?

----------

## Nate_S

Yea that remote I got working (not as a keyboard, though, as a lirc device.)  

You'll need lirc_gpio, and bttv, and I found that I had to load them manually even though they're already loaded (I think they may have been getting loaded in the wrong order?) and also create the device node manually on bootup.  I used the lircd from lirc.org.  This is what my /etc/conf.d/local.start looked like:

modprobe bttv

modprobe lirc_gpio

mknod /dev/lirc c 61 0

/usr/local/sbin/lircd

irxevent &

If you need any more info, just ask

-Nate

----------

## warthog

I've got a KWorld cx88 card, and for some reason it's not being autodetected.  When I try to pass the card=<n> to the module upon modprobe, it doesn't recognize the options.  Here's my output, does anyone have an idea what I'm doing wrong?

```
# modprobe cx8800 card=16

cx8800: Unknown parameter `card'

cx88[0]: Your board has no valid PCI Subsystem ID and thus can't

cx88[0]: be autodetected.  Please pass card=<n> insmod option to

cx88[0]: workaround that.  Redirect complaints to the vendor of

cx88[0]: the TV card.  Best regards,

cx88[0]:         -- tux

cx88[0]: Here is a list of valid choices for the card=<n> insmod option:

...

cx88[0]: subsystem: 0000:0000, board: UNKNOWN/GENERIC [card=0,autodetected]

tuner: chip found at addr 0xc0 i2c-bus cx88[0]

cx88[0]/0: found at 0000:01:06.0, rev: 5, irq: 12, latency: 32, mmio: 0xee000000

cx88[0]/0: registered device video0 [v4l2]

cx88[0]/0: registered device vbi0

cx88[0]/0: cx88: tvaudio thread started

cx88[0]/0: AUD_STATUS: 0x36 [mono/pilot c1] ctl=BTSC_FORCE_MONO

```

----------

## Cyberwizzard

 *Nate_S wrote:*   

> Yea that remote I got working (not as a keyboard, though, as a lirc device.)  
> 
> You'll need lirc_gpio, and bttv, and I found that I had to load them manually even though they're already loaded (I think they may have been getting loaded in the wrong order?) and also create the device node manually on bootup.  I used the lircd from lirc.org.  This is what my /etc/conf.d/local.start looked like:
> 
> modprobe bttv
> ...

 

Unfortunately that won't work for me, just like warthog my card needs the cx8800 drivers (its a conexant chip) and so far it doesn't have any IR support yet.  :Sad:  I'm giving up, I'm waiting for the author of the drivers to get this to work because I've ran out of options...

----------

## warthog

 *warthog wrote:*   

> I've got a KWorld cx88 card, and for some reason it's not being autodetected.  When I try to pass the card=<n> to the module upon modprobe, it doesn't recognize the options.  Here's my output, does anyone have an idea what I'm doing wrong?
> 
> ```
> # modprobe cx8800 card=16
> 
> ...

 

Well... after some searching I found the following thread (outside of gentoo forums).  It appears that the option has moved to cx88xx.  I'm going to give it a try tonight.

http://www.spinics.net/lists/vfl/msg12378.html

----------

## semck83

Thank you so much BoogleOogle! I had all but given up! I love you now.

As for the sound, I ran alsamixer and unmuted/turned up all the line/aux things. M unmutes, + (or is it up-arrow?) turns up. It works great.

All the best,

Stephen

----------

## jsosic

 *Nate_S wrote:*   

> Yea that remote I got working (not as a keyboard, though, as a lirc device.) 
> 
> If you need any more info, just ask

 

Are you talking about Expert card with cx88xx tuner?!?!? Or deluxe, with BT-one?

----------

## deadmhz

I have a WinTV Radio card with the cx2388xx chip. I've been searching all evening for a solution. Here's what I had to do.

I couldn't get the cx8800 module to pass the following "modprobe cx8800 card=1 tuner=43" just like all the other forum post, how-tos and mailing list archives were telling me to do. I saw in this post that the parameters for cx8800 were moved to cx88xx. So I tried it.

modprobe cx88xx card=1 tuner=43

Ran dmesg --- nothing. So dumb luck I went ahead and load the cx8800 module.

modprobe cx88000

dmesg show something, but instead of "tuner=?" it showed "tuner=? (43)"

So I fired up tvtime and bam --- B/W picture with no sound. Cool! It's late, I'm tired, but I'm happy.

My System:

Gentoo 2005.0

Kernel 2.6.11-r11

Athlon 64 3000+

nVidia FX5200

1024 MB RAM

WinTV Radio

160GB WD HD

MSI K8T800

----------

## kudude

alright you crazy cats with the conexant chips -- how do i get sound working without a hardware cable?  I'd love to plug mine into the soundcard, but unfortunately I have the hauppauge roslyn oem model which has no place to pull sound manually, so i need to do it over the pci bus.

Any thoughts?

----------

## stallionz

Here's my journey from beginning to end setting up my Winfast 2000 XP Expert TV Tuner card with Fedora Core 6 and tvtime.

1) I had to modify ati fglrx drivers configuration to enable extmod and overlay.

the resultant xorg.conf file had the following entries:

Section "Module"

        Load  "dri"

        Load  "extmod"

        Load  "glx"

EndSection

Section "Device"

        Identifier  "aticonfig-Device[0]"

        Driver      "fglrx"

        Option      "VideoOverlay" "on"

        Option      "OpenGLOverlay" "off"

EndSection

2) I had to configure the proper card and tuner driver.  For my card, The Winfast 2000 XP Expert it was card=5 and tuner=43

first remove active modules:

/sbin/rmmod bttv

/sibn/rmmod cx8800

/sbin/rmmod cx88xx

/sbin/rmmod tuner

then reload as follows

/sbin/modprobe cx88xx card=5 tuner=43                // These arguments must be passed to cx88xx, since cx8800 doesn't accept them.

/sbin/modprobe cx8800

3) Select the proper cable and ntsc/pal etc. settings. in tvtime. till you get a signal.  If it's black and white you might have to change the ntsc cable mode or you didn't select the right tuner.

4) Fix Picture Settings

The picture settings are all screwed up for this card, usually the contrast is too high, I turned it down to about 23 and turned up the brightness to about 54, the hue was good to begin with.

5) Audio

This seems to be the biggest problem but if you identified the card and tuner properly it should be working and all you need to do is turn on the proper channel in your sound mixer and turn it up.  Not only did I have to turn on the AUX that my audio cable was connected to, there was also another ANALOG MIX that I had to unmute and turn up.  (I'm using a Soundblaster Audigy Card)

My Recommendation, open up volume control, go under edit and preferences and turn everything on and then unmute and turn up everything one by one while the tv application is on.

FINALLY IT WORKS!!!  Only about 3 hours of arduous labor and research  :Smile: 

Hope it saves you a few hours.  Good Luck!

----------

## stallionz

6) One problem I had was trying to control the volume from within tvtime, it would not accept the configuration of Aux, instead would default to linein, so I had to switch the cable and configuration to cd and that worked fine.  I guess the aux channel must be called something else or maybe it doesn't take that as one of the options.

----------

## jsosic

What other apps are there for watching TV except tvtime, but which work with TV2000XP Expert? I didn't have any problems getting this card to work, but it works really bad  :Sad:  I mean, only programs I can use are tvtime and xawtv, and if I watch movies with mplayer with any VO other than sdl, then I loose picture on xawtv until I restart X server. It's really idiotic... I've tried other programs like kdetv, zapping, etc, but they all crash X or don't get picture....

I mean, this sucks  :Sad: 

----------

