Hauppauge USBLive2 and new HVR-850 support

If you happen to own one of the newer Hauppauge USBLive2 video grabbers, or the newest version of the Hauppauge HVR-850, you can find support for it here:

http://kernellabs.com/hg/~dheitmueller/polaris4/

It’s not completely cleaned up yet, but both devices are working.

Thanks go out to Conexant for making available a base Linux driver, and to Hauppauge for sample hardware and sponsoring device support and a bunch of the cleanup work required to get the changes into the mainline kernel.

Tester feedback welcome, as always.

132 thoughts on “Hauppauge USBLive2 and new HVR-850 support

  1. Hey,

    I actually just bought one of these usb sticks and wanted to get it working under Ubuntu Lucid. I’ve scourged the internet for any information and eventually got here. Can you give me some details how I could get hold of this driver to get it to work? There is a cx231xx driver in the lucid distribution, but that obviously doesn’t work if the changes are this new. Can I patch this somehow?

  2. Hi Devin,

    I’m working with a standard Ubuntu distribution (Lucid Lynx), 2.6.32-23-generic x86_64. The compile failed due to some unfound headers (dma.h) in firedtv. I removed this from the Makefile and then it continued to the end.

    I tried to install just the cx213xx.ko file, but then it obviously complained about disagreements in structures. So I took the plunge and went for a ‘make install’ and rebooted.

    A reboot with the usb plugged in failed. The system entirely froze shortly after the login provided (not before). With unplugged device I got into my desktop and everything works, but after plugging it in it froze after some moments with artifacts on the screen, disappearing title bars and other stuff. Since this seems destined for the newer kernels, I think it makes sense to use a different linux version.

    I’m going to use this on my netbook in the field to visualize video from rc planes. There’s a camera hooked up there which sends to a 5.8GHz receiver which usually only has a composite out. The idea is to use a very simple USB capture device with very little latency to just get the video onscreen somehow. I’ll take another attempt with the newest version of Ubuntu (Meerkat Alpha 2), which has a 2.6.35 kernel and see what that does.

    To compile this, I only need the linux-headers right, suitable for my kernel of course?

  3. I’ve tried a standard Meerkat distribution on netbook to get this working, but it’s starting to get too hairy now. The newer kernel 2.6.35 had some functions renamed (usb_buffer_free and usb_buffer_alloc). I could just modify the sources to use the alternates, but the next problem is that the version from mercurial you have here has an unresolved “dev_mc_list” struct in dev_net.c

    What is the kernel version you’re compiling against in this tree? Do you have any other ideas I could try? If not, it’s probably better to wait for the official release. Do you know when this driver comes out for Ubuntu?

    • Devin Heitmueller

      Hello Gt,

      I am doing the development against Ubuntu 10.04 (Lucid). The code will not currently compile against a 2.6.35 build because of issues with the upstream v4l-dvb tree (see the linux-media mailing list posts for more details).

      Can you provide a backtrace that shows the failures? Look in /var/log/messages and see if the errors show up, and if so please send me the logfile.

      Also, are you on 32-bit or 64-bit Ubuntu?

      Devin

      • Hi Devin,

        At home I was on ubuntu 64-bit and got the crash + corruption on that one. I’ve compiled this on my 32-bit netbook and it seems to work. I used make menuconfig to limit the number of modules compiled to a minimum acceptable (DVB and the driver mostly). The netbook runs a stock lucid distribution. I can confirm that I don’t get any crashes whatsoever now and the /dev/video1 device does get created.

        On Windows the usb-stick works fine (I always check hardware to be sure) and the blue light goes on when it is inserted. I’ve inserted the basic channels of composite and s-video and when tuning to the composite channel on windows, I get the actual output from my transmitter (I’m not using it for TV’s, we’re transmitting camera images from an rc plane over an analog link with a video receiver that has composite output).

        With xawtv I get blue on the screen and sometimes a wide green bar at the bottom, but no images or white noise.

        Which utilities and commands are you using for video display?

        • Devin Heitmueller

          Hello GT,

          One thing to bear in mind is that if you use make menuconfig to exclude modules, the original modules stay behind. For Ubuntu, generally I just run make, let it fail once, and then go into v4l/.config and change FIREDTV=m to FIREDTV=n. That way I end up with everything *except* the one driver that failed.

          It would be good if you could do a bit more testing and confirm whether this really is some sort of 34/64 bit difference.

          Regarding analog, I generally test with tvtime. Also note that you will get a blue screen if you are capturing on the wrong input, for example if Xawtv is defaulting to the composite input but you have the S-video cable plugged in.

          Devin

          • Hi Devin,

            Makes sense and I see why it is better to do a full compile. I did exactly as you said. On the netbook it is now fully working. I do get constant I/O errors as regular user, but as root this disappears. This is very likely some Ubuntu specific issue with udev rules. Would you have a ruleset for this?

            Remarkably, when the receiver is not getting any video signal, we’re getting a blue screen too. Most setups would generate white noise in that case. That is quite specific to this hardware but nothing to worry about. A real video signal comes out very well. Next to zero lag (very important for rc usage!) and a very decent image.

            Thanks for helping me out on this one. I’ll check out my set-up at home again. First verify the headers that I am using there, clean up the build area and compiling it as I did on the netbook. My guess with the setup at home is that it’s either because of 64-bit or the proprietary ATI driver that I’m using for ATI Stream applications, which may cause some of these problems (probably lagging behind real linux kernel). I’ll also try with generic video drivers to see if there’s any difference, see if there’s upgrades for ATI, etc…

            Any tips on how I can give you more useful information on this, should it crash again? You probably want dmesg logs? How can I generate those for you in such a way that it’s capturing as much info before it freezes?

          • The I/O errors are due to a root-owned .tvtime directory in the regular user directory. Doing a chown : on that makes it go away.

            I’ve verified the computer at home and I noticed that the latest kernel-headers and kernel-image were held back for some reason. It was using kernel-2.6.32-23 instead of the very latest 2.6.32-24. After the upgrade I cleaned out the polaris4 directory, recompiled and restarted. It now works on this computer as well, which is a 64-bit distribution i7 920, Ubuntu Lucid Lynx, ATI HD 5850.

            Enormous thanks for all the help and even more thanks for supporting this hardware on Ubuntu!!!

          • Devin Heitmueller

            Hello GT,

            Great. I’m glad to hear it was some sort of operator error and not a driver bug.

            Thanks for testing!

            Devin

  4. Alexis Bretteville

    HI, I dont know if it is the right place but I have a pctv ultimate stick 880e. I think you are the guy who were developing some drivers for this device (linuxTV website ) I wanted to know if it was still under development to make it run under linux.
    Thx for your answer

    • Hello Alexis,

      Yeah, I was doing the 880e work last year. However, we couldn’t get the rights to do the ATSC/ClearQAM driver, and it wasn’t worth the work to just implement analog. Also, the demodulator is *only* used in that device, so it’s not worth the effort to reverse engineer, since it won’t help any other products. With limited resources, the time is better spent reverse engineering chips that are in many devices, not just one.

      And then PCTV stopped shipping the product, making even less incentive to work on the board compared to other products which aren’t discontinued.

      Devin

  5. I noticed that the linux drivers output a blue screen when there is no or insufficient signal. I’ve used this stick on the field with a laptop, where the video is received from a 5.8 GHz moving transmitter. The windows version outputs white noise for no signal and just outputs what it receives. The issue is that when these vehicles are moving, it’s better to get any signal at all, even if it is heavily interfered, rather than looking at a plain blue screen.

    Is there any way to get similar behavior for these drivers? I attempted to recompile the drivers with different enums set ( RAW_CAPTURE etc.) , but this didn’t seem to have any effect.

    • Hi Gt,

      Most devices have a register to “enable blue screen on no signal”, although there is not a V4L API to control it.

      On the Polaris it’s register 0x0404 (OUT_CTRL1) bit 7. You can either set that bit low with v4l2-dbg, or you can modify the driver. The chip is defaulted to not do blue field (meaning the driver explicitly enables it), so you just need to figure out where it gets set and skip that operation (it’s either in cx231xx-avcore.c or in cx25840-core.c).

      If you still can’t figure it out after trying the above, ping me and I will see what I can do.

      Devin

      • Hi,
        I’ve just upgraded to the 2.6.37 kernel on arch. It’s great not to have to compile them myself any more, however when I built them from source I did the discussed mod to enable the output on ‘no signal’ which is essential for me (analogue amateur tv).
        As the drivers are already built-in I’m now trying to use v4l2-dbg but when I run:
        sudo v4l2-dbg –device=/dev/video1 –get-register=0x0404
        All I get is:
        ioctl: VIDIOC_DBG_G_REGISTER
        ioctl: VIDIOC_DBG_G_REGISTER failed for 0x404

        The card is definitely on /dev/video1 (webcam on video0). Using –list-registers produces the failure message for every register.
        Thanks,
        Phil

        • Hi Phil,

          The G_REGISTER ioctl() call is only available if your kernel is compiled with “v4l advanced debugging” enabled. It’s likely that your Linux distribution doesn’t have this enabled in their kernel by default.

          Devin

  6. Hi Devin,

    Excellent. It was in cx231xx-avcore.c and was called OUT_CTRL1. I set the following line:
    value |= (1 << 7);
    to read: 0 << 7

    and did the write anyway to ensure it was set to 0. It's now showing the output whatever comes in. Excellent help, thanks very much.

    Couldn't find the v4l2-dbg utility anywhere in the ubuntu distribution, except v4l2ucp, but that wasn't helpful at all. I reckon it's part of v4l2 and needs to be built separalely. May as well keep a copy of the v4l2 tree around to rebuild modules. Do you know when this module is targeted for the ubuntu distribution and what the easiest method for rebuilding it after each kernel-image update would be?

    • v4l2-dbg is part of the v4l-utis source tree (same as v4l2-ctl). It probably just isn’t bundled with Ubuntu, but you can build it from source here.

      http://git.linuxtv.org/v4l-utils.git

      When it goes upstream is largely dependent on cleanup work being done by myself and Conexant, which is required for upstream acceptance. It will probably make it into distributions like Ubuntu within the next six months (the kernel typically runs on a three month window and we just missed the 2.6.36 merge window).

      In terms of rebuilding it, just make sure you have the latest linux-headers package installed, and then run “make distclean” followed by “make && make install”.

      Devin

  7. Hi Devin,

    Thanks for your efforts to add support for the HVR-850 and other tuners.

    I’ve gotten my HVR-850 working under MythBuntu, but only with limited success. For a while after I boot everything seems fine, but within about an hour the card seems to disappear; live TV stops working, and MythBackend won’t record anything. Curiously the display shows a partial channel lock, so it’s not quite the same thing as the card not being there, but… very weird.

    If I simply unplug the tuner and re-plug it in it resumes working, but… that’s not a practical solution. 🙂

    I can wrote code and I’m by no means a Linux newbie, but I know nothing about writing drivers or really even anything about MythTV. If you want to direct me on how to debug this I can probably help solve my own problem, but I don’t even know where to begin on my own.

    Thanks
    -Tom

  8. Hi Devin,

    Given what I’ve seen since setting core_debug=1, I’m starting to think that my problems have nothing to do with the driver and everything to do with the rest of the system. If I find out later otherwise I’ll ping you again. 🙂

    Thanks
    -Tom

  9. Hello Devin,

    Thanks a lot for the USBLive2. Its what I needed.

    Is there a way to change to volume from the audio on the card. Alsamixer tells me the card has no controls.

    Thanks
    -Roger

    • Hi Roger,

      The hardware definitely supports the ability to change the volume, although I do not believe it is exposed in the current driver. Generally, volume is exposed either via ALSA mixer controls or the V4L volume control (configurable via “v4l2-ctl”). I know the ALSA mixer control approach isn’t implemented, but it’s possible that the volume is exposed via V4L2. Try running “v4l2-ctl –help” and find the volume control and see if that works.

      Devin

      • Great

        Found that.

        MythTV had already set it to +-60000. I changed it to max, and told myth to not change it.

        Slightly better. And the control does work, because the vol chages if I change it. It still seems very low. If I plug the same source into the sound card line in, the volume is double.

        Is there a way to boost that input, like you do with a mic?

        Am I missing something?

        • Must be something in the alsa output.

          The recorded programs are perfect when played on other frontends, just that machine is so soft. maby the card has been set to line out.

          Thanks

          Roger

  10. I installed your driver on Fedora 13 (2.6.34.6-54.fc13.x86_64), and I see a couple of new devices now:
    /dev/video0
    /dev/vbi0
    Shouldn’t there also be an audio device? Next, I tried to view the camera input (/dev/video0) using Zoneminder, but I just get a blank box. Is there a way to test the video input?

    • Hello Michelle,

      The ALSA device does get created – just run “arecord -l” to see it (audio devices do not get a /dev entry).

      I would suggest starting testing with an application like tvtime, which tends to be simpler to setup than zoneminder. Once you know the driver is working, you can then work on getting zoneminder working properly.

      Devin

  11. I actually get a segfault when I plugin the Live2 at runlevel 5 (and source of segfault is cx231xx_send_vendor_cmd)

    If I can send you segfault info/logs sepereately let me know! Happy to help debug….

  12. tvtime shows me a green screen. Since I’m using the composite input on the Live2, perhaps tvtime is showing the svideo input? Is there a way to switch inputs? (permanently)?

    Just FYI, the crash was due to a pulseaudio-cx2341x interaction. So I removed pulseaudio and now the system is stable.

    • If you hit the “tab” key, you can toggle the input configuration (tab->input configuration->change input source)

      Tvtime will remember the last source selected.

      Devin

  13. Tab has no effect. I always see just a green screen in tvtime. I notice that the blue & green LED’s on the Live2 are always OFF. Shouldn’t the blue one be on to show it is active?

    I’m now using a composite source (for simplicity), and v4lctl shows:
    norm: NTSC-M
    input: Composite1
    bright: 146
    contrast: 62
    color: 65
    hue: 0
    volume: 60928
    mute: on

    Still, tvttime is just a green screen. Any suggestions?

  14. I finally got it all working (including with zoneminder) – thanks ! Strangely, after 20+ hours of constant use the driver seems to fail with the info below. I’m not sure if this is a useful debug log…but maybe it can help? (What is status –110)

    cx231xx #0: setPowerMode::mode = 48, No Change req.
    cx231xx #0: cx231xx_dif_set_standard: setStandard to ffffffff
    cx231xx #0: video_mux : 0
    cx231xx #0: do_mode_ctrl_overrides : 0xb000
    cx231xx #0: do_mode_ctrl_overrides NTSC
    cx231xx #0: vidioc_s_std : 0xb000
    cx231xx #0: do_mode_ctrl_overrides : 0xb000
    cx231xx #0: do_mode_ctrl_overrides NTSC
    cx231xx #0: cx231xx_stop_stream():: ep_mask = 8
    cx231xx #0: cx231xx_initialize_stream_xfer: set video registers
    cx231xx #0: cx231xx_start_stream():: ep_mask = 8
    cx231xx #0: cx231xx_stop_stream():: ep_mask = 8
    cx231xx #0: setPowerMode::mode = 48, No Change req.
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx25840 0-0044: 720×480 is not a valid size!
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: cx231xx_set_decoder_video_input: adjust_ref_count :Failed to setAFE
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110
    cx231xx #0: UsbInterface::sendCommand, failed with status –110

  15. I’m trying to get a Hauppauge USB Live 2 working on an eee PC901 running Debian Lenny
    2.6.26-2-686 #1 SMP Wed May 12 21:56:10 UTC 2010 i686 GNU/Linux
    I’ve downloaded polaris4-8d1cbe46f97f and compiled it, apparently successfully.
    But I don’t get any action from the device. One dmesg line that looks interesting is

    [13736.361031] cx231xx #0: Identified as Hauppauge USB Live 2 (card=9)
    [13736.441146] cx231xx #0: cx231xx_dif_set_standard: setStandard to ffffffff
    [13736.556628] cx25840 1-0044: cx23102 A/V decoder found @ 0x88 (cx231xx #0)
    [13736.571265] cx25840 1-0044: Firmware download size changed to 16 bytes max length
    [13736.571265] firmware: requesting v4l-cx231xx-avcore-01.fw
    [13736.604007] cx25840 1-0044: unable to open firmware v4l-cx231xx-avcore-01.fw

    after which it continues for a while, and creates video0.
    Any suggestions about where to look?

  16. Just tried your code on Ubuntu maverickit will not compile the required module.

    2.6.35-22-generic #33-Ubuntu SMP

    CC [M] /usr/src/usblive2/polaris4/v4l/cx231xx-core.o
    /usr/src/usblive2/polaris4/v4l/cx231xx-core.c: In function ‘cx231xx_uninit_isoc’:
    /usr/src/usblive2/polaris4/v4l/cx231xx-core.c:940: error: implicit declaration of function ‘usb_buffer_free’
    /usr/src/usblive2/polaris4/v4l/cx231xx-core.c: In function ‘cx231xx_init_isoc’:
    /usr/src/usblive2/polaris4/v4l/cx231xx-core.c:1101: error: implicit declaration of function ‘usb_buffer_alloc’
    /usr/src/usblive2/polaris4/v4l/cx231xx-core.c:1102: warning: assignment makes pointer from integer without a cast
    /usr/src/usblive2/polaris4/v4l/cx231xx-core.c: In function ‘cx231xx_init_bulk’:
    /usr/src/usblive2/polaris4/v4l/cx231xx-core.c:1236: warning: assignment makes pointer from integer without a cast
    make[3]: *** [/usr/src/usblive2/polaris4/v4l/cx231xx-core.o] Error 1
    make[2]: *** [_module_/usr/src/usblive2/polaris4/v4l] Error 2
    make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-22-generic’
    make[1]: *** [default] Error 2
    make[1]: Leaving directory `/usr/src/usblive2/polaris4/v4l’
    make: *** [all] Error 2

    Anything I can change?

    Thanks

    • Hello Roger,

      Looks like an “#include” is missing, although I’m not sure which one. The kernel people seem to like moving things around just to break third party drivers. 😉

      Your best bet is to grep /usr/include/linux for the missing function and try sticking an #include at the top of the failing .c file.

      Devin

  17. I did the following:

    usb_buffer_alloc has been replaced with usb_alloc_coherent , and likewise
    usb_buffer_free has been replaced with usb_free_coherent. in kernels 2.6.34

    In the source .c for that module.

    Compiles now.

    There is prob a whole lot of your modules that will need to be patched.

    Thanks

    • Hello Wieshka,

      Are you capturing on the wrong input? What you are seeing will occur if you have the application configured to capture on the composite input (which is the default) but only have an s-video cable connected to the device.

      Devin

  18. Hi. I tried compile drivers on the:
    Debian Linux 2.6.35.7#1 SMP Fri Oct 15 10:57:02 EEST 2010 i686 GNU/Linux

    and i have the next error:

    CC [M] /root/polaris4-8d1cbe46f97f/v4l/dvb_net.o
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c:1190: warning: ‘struct dev_mc_list’ declared inside parameter list
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c:1190: warning: its scope is only this definition or declaration, which is probably not what you want
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c: In function ‘dvb_set_mc_filter’:
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c:1197: error: dereferencing pointer to incomplete type
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c: In function ‘wq_set_multicast_list’:
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c:1247: error: ‘struct net_device’ has no member named ‘mc_list’
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c:1249: error: dereferencing pointer to incomplete type
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c:1249: warning: left-hand operand of comma expression has no effect
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c:1249: warning: value computed is not used
    /root/polaris4-8d1cbe46f97f/v4l/dvb_net.c:1250: warning: passing argument 2 of ‘dvb_set_mc_filter’ from incompatible pointer type
    make[3]: *** [/root/polaris4-8d1cbe46f97f/v4l/dvb_net.o] Ошибка 1
    make[2]: *** [_module_/root/polaris4-8d1cbe46f97f/v4l] Error 2
    make[2]: Leaving directory `/usr/src/linux-2.6.35.7′
    make[1]: *** [default] Ошибка 2
    make[1]: Leaving directory `/root/polaris4-8d1cbe46f97f/v4l’
    make: *** [all] Ошибка 2

    Please help with this error

    • Hello Alexander,

      That tree does not work against 2.6.35 (due to changes the kernel.org people made to their APIs). Either use a distribution with an older kernel or wait for the LinuxTV people to backport the changes into the current linuxtv.org hg tree (http://linuxtv.org/hg/v4l-dvb). The changes have been submitted upstream so it’s entirely at their discretion as to when they finally get around to merging them into their hg tree.

      Cheers,

      Devin

  19. Hi,

    Running Ubuntu 10.10 and I’ve converted the calls:

    usb_buffer_free() — > usb_free_coherent()
    usb_buffer_alloc() –> usb_alloc_coherent()

    and get the ‘dev_mc_list’ errors. To fix:

    struct dev_mc_list * foo; –> struct netdev_hw_addr * foo;

    and:

    foo->dmi_addr –> foo->addr

    Haven’t tried it yet, but I THINK it fixes it… Let us know!

  20. Got it to compile last night.

    o change all ‘usb_buffer_free()’ calls to ‘usb_free_coherent()’
    o change all ‘usb_buffer_alloc()’ calls to ‘usb_alloc_coherent()’

    the files to change are:

    ./linux/drivers/media/video/hdpvr/hdpvr-video.c
    ./linux/drivers/media/video/au0828/au0828-video.c
    ./linux/drivers/media/video/tlg2300/pd-video.c
    ./linux/drivers/media/video/em28xx/em28xx-core.c
    ./linux/drivers/media/video/usbvision/usbvision-core.c
    ./linux/drivers/media/video/uvc/uvc_video.c
    ./linux/drivers/media/video/gspca/benq.c
    ./linux/drivers/media/video/gspca/gspca.c
    ./linux/drivers/media/video/cx231xx/cx231xx-core.c
    ./linux/drivers/media/dvb/dvb-usb/usb-urb.c
    ./linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c

    o Don’t build two drivers by modifying ‘v4l/.config’:

    CONFIG_VIDEO_TLG2300=n
    CONFIG_DVB_FIREDTV=n

    o Edit ./linux/drivers/media/dvb/dvb-core/dvb_net.c:

    change ‘dev_mc_list’ to ‘netdev_hw_addr’ – two places
    comment out 5 lines starting at line 1247:

    1247 for (mci = 0, mc=dev->mc_list;
    1248 mci next, mci++) {
    1250 dvb_set_mc_filter(dev, mc);
    1251 }

    and replace them with:

    1247 netdev_for_each_mc_addr(mc, dev)
    1248 dvb_set_mc_filter(dev, mc);

    and that will do it. It will compile put I still haven’t tried it yet for lack of time…

    • Craih, trying to duplicate your efforts on my new mythbuntu 10.10 setup but no dice… I’m not good with kernel sources… any chance I could get you to look at the error I am having below on ubuntu kernel 2.6.35-22-generic-pae?

      bryan@reflector:~/Downloads/saa7164-v4l$ sudo make
      make -C /home/bryan/Downloads/saa7164-v4l/v4l
      make[1]: Entering directory `/home/bryan/Downloads/saa7164-v4l/v4l’
      creating symbolic links…
      make -C firmware prep
      make[2]: Entering directory `/home/bryan/Downloads/saa7164-v4l/v4l/firmware’
      make[2]: Leaving directory `/home/bryan/Downloads/saa7164-v4l/v4l/firmware’
      make -C firmware
      make[2]: Entering directory `/home/bryan/Downloads/saa7164-v4l/v4l/firmware’
      make[2]: Nothing to be done for `default’.
      make[2]: Leaving directory `/home/bryan/Downloads/saa7164-v4l/v4l/firmware’
      Kernel build directory is /lib/modules/2.6.35-22-generic-pae/build
      make -C /lib/modules/2.6.35-22-generic-pae/build SUBDIRS=/home/bryan/Downloads/saa7164-v4l/v4l modules
      make[2]: Entering directory `/usr/src/linux-headers-2.6.35-22-generic-pae’
      CC [M] /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.o
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1190: warning: ‘struct dev_mc_list’ declared inside parameter list
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1190: warning: its scope is only this definition or declaration, which is probably not what you want
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c: In function ‘dvb_set_mc_filter’:
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1197: error: dereferencing pointer to incomplete type
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c: In function ‘wq_set_multicast_list’:
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: ‘mc’ undeclared (first use in this function)
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: (Each undeclared identifier is reported only once
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: for each function it appears in.)
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: expected expression before ‘=’ token
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: warning: type defaults to ‘int’ in declaration of ‘type name’
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: request for member ‘list’ in something not a structure or union
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: warning: type defaults to ‘int’ in declaration of ‘__mptr’
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: warning: initialization from incompatible pointer type
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: expected expression before ‘)’ token
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: warning: type defaults to ‘int’ in declaration of ‘type name’
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: expected expression before ‘->’ token
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: warning: left-hand operand of comma expression has no effect
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: expected expression before ‘=’ token
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: warning: type defaults to ‘int’ in declaration of ‘type name’
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: request for member ‘list’ in something not a structure or union
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: warning: type defaults to ‘int’ in declaration of ‘__mptr’
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: expected expression before ‘->’ token
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: error: expected expression before ‘)’ token
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1246: warning: type defaults to ‘int’ in declaration of ‘type name’
      /home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.c:1247: error: expected expression before ‘)’ token
      make[3]: *** [/home/bryan/Downloads/saa7164-v4l/v4l/dvb_net.o] Error 1
      make[2]: *** [_module_/home/bryan/Downloads/saa7164-v4l/v4l] Error 2
      make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-22-generic-pae’
      make[1]: *** [default] Error 2
      make[1]: Leaving directory `/home/bryan/Downloads/saa7164-v4l/v4l’
      make: *** [all] Error 2

  21. Hi Devin,

    I just got one of the HVR-850’s, and trying to get it working under PCLinuxOS 2010.07, kernel 2.6.33.5-pclos1.bfs (32 bit). I just have kernel headers, not full source. I followed your instructions, and everything seemed to compile and install correctly. I did get these messages during the build, but I don’t think they’re relevant:

    VIDEO_TVP7002: Requires at least kernel 2.6.34
    RADIO_SAA7706H: Requires at least kernel 2.6.34

    After rebooting, dmesg shows me the following:

    usb 5-4: New USB device found, idVendor=2040, idProduct=b140
    usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 5-4: Product: Hauppauge Device
    usb 5-4: Manufacturer: Hauppauge
    usb 5-4: SerialNumber: 4034019002
    Linux video capture interface: v2.00
    cx231xx v4l2 driver loaded.
    usbcore: registered new interface driver cx231xx

    It seems like all the kernel modules loaded right too:

    # lsmod | grep cx231
    cx231xx 65848 0
    v4l2_common 14774 1 cx231xx
    videodev 31136 2 cx231xx,v4l2_common
    i2c_core 18110 5 i2c_viapro,drm,cx231xx,v4l2_common,videodev
    videobuf_vmalloc 4892 1 cx231xx
    videobuf_core 14289 2 cx231xx,videobuf_vmalloc
    usbcore 124336 6 snd_usb_audio,snd_usb_lib,cx231xx,ehci_hcd,uhci_hcd

    But no /dev/video0 or other video devices got created. Should this work with a 2.6.33 kernel? Any ideas what might be wrong? Any help would be much appreciated (as is the work in developing this driver).

    • Doing some more investigating, the only device that gets created is under /dev/bus/usb/. I ran v4l2-dbg and got some garbled output:

      # v4l2-dbg -D -d /dev/bus/usb/005/004
      Driver info:
      Driver name :
      Card type : ȋw�R�h�ؽM���g�
      ��̿|x��N�^�nfo : �̿�#x���̿��g���̿��M�ii
      Driver version: -1216864644
      Capabilities : 0xB74E16A5
      Video Capture
      Video Overlay
      Video Output Overlay
      VBI Output
      Sliced VBI Output
      Audio
      Radio
      Read/Write
      Async I/O
      Streaming

      I don’t know if the garbled characters will show up properly, but right after “Card type:” and going into the next line is some type of binary output. This probably has something to do with /dev/video0 not being created. Any idea what’s going wrong here?

    • Hi Shocky,

      It looks like you manually did a modprobe on the cx231xx driver and that’s the output you’re seeing. It looks like the new driver has not actually been installed, and what you are seeing is the old driver being loaded.

      The output of lsusb, the lines that start with “usb 5-4” and the presence of “/dev/bus/usb…” have no relationship to whether a driver for the device is present. In fact the behavior you are seeing is identical to if you had tried those steps before attempting to install the driver at all.

      Double check that you actually installed the new driver.

      Devin

  22. Hi Devin,

    Thanks for the reply. No I didn’t manually modprobe it, the system did it automatically when I plugged in the card, or if I boot with it plugged in. I did the “make install” as root, and it ran successfully, so I assumed everything was okay.

    Seems I missed one detail through: PCLInux os uses gzipped kernel modules, but the Makefile doesn’t. When I looked in the kernel moduels I saw that there were *.ko files with a Nov. 28 date, but also *.ko.gz files with an Oct. 3 date. So I got rid of all the old modules and gzipped the new ones. Now when I reboot and plug in the card, dmesg gives me:

    usb 5-4: new high speed USB device using ehci_hcd and address 2
    usb 5-4: New USB device found, idVendor=2040, idProduct=b140
    usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 5-4: Product: Hauppauge Device
    usb 5-4: Manufacturer: Hauppauge
    usb 5-4: SerialNumber: 4034019002
    usb 5-4: configuration #1 chosen from 1 choice
    Linux video capture interface: v2.00
    cx231xx: Unknown symbol cx2341x_ext_ctrls
    cx231xx: Unknown symbol cx2341x_ctrl_query

    There are about 50 of these unknown symbol messages, so I only pasted the first couple. Also, still no /dev/video0 device. Is there another step I might need to do in addition to compressing the new modules?

    BTW, I working against a 2.6.32.24-pclos1.bfs kernel now. I wanted to see if that made any difference, but it didn’t.

    • Hi Sharky,

      Looks like this is entirely some aspect of the way your distro does module management. I cannot really afford to spend the time dealing with every distribution’s whacky module code. Generally I test with Ubuntu and Fedora (which gives me a reasonable level of confidence that the driver code itself is good), and everybody else is on their own.

      Regarding the unknown symbol errors: did you hand-edit what module list you are building? If so, I would suggest you *not* do this and instead build all modules in v4l-dvb. In particular, it looks like you didn’t include the cx23417 driver (cx2341x.ko) which is required.

      Devin

      • Yeah, I understand, too many distros, too many different ways of doing things. I’ll see what I can find out about the right way to do it for PCLinuxOS.

        The only hand-edit I did was when I switched to the 2.6.32 kernel I had to get rid of FIREDTV as in one of your earlier comments. Everything else is as I got it from you. Between different attempts I did a “make distclean” before rebuilding. If http://kernellabs.com/hg/~dheitmueller/polaris4 is a complete v4l-dvb tree then that’s what I’m building. The cx2341x.ko module was built and installed:

        -rw-r–r– 1 root root 6447 Nov 28 21:32 /lib/modules/2.6.32.24-pclos1.bfs/kernel/drivers/media/video/cx2341x.ko.gz

      • Aha, you gave me the clue I needed. The unknown symbols were because cx2341x didn’t get loaded when cx231xx did. That’s because after getting rid of the old ko.gz modules and gzipping the new ones, I needed to do a ‘depmod -a’ again. Once I did that all was well. I now have video on tvtime. I haven’t figured out how to get the sound to play yet other than an arecord piped to an aplay, but that’s another story.

        Thanks for all the help, and for creating this driver for us.

  23. Just a report that I am having success with the HVR-850 device (ID 2040:b140 Hauppauge) with Ubuntu 10.10.

    Kernel Info:
    Linux ubuhtpc 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64 GNU/Linux

    Here’s what I did:
    -MythTV 0.24, built from source code (mythtv.org)
    -cloned git tree for drivers from v4l using “basic” approach described here
    http://linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers

    Based on info in previous posts and elsewhere this driver install wlll fail due to a bug in the Ubuntu headers. What I had to do was run the install script of the “basic” approach. during the “make” step it will fail. After failure, I just went into the \v4l directory and edited (as sudo) the .config file to search for the “firedTV=m” line and change to “firedTV=n” and then reran “sudo make” and “sudo make install” again. This installed the drivers successfully. MythTV is working great now, on my newer core5 machine with integrated i915 video and alsa optical IEC958 digital audio out (gigabyte usb3 mobo)

    Since most searches on this device circle back here, thanks Devin for the work on this device driver and also to those that posted above that got me going in the right direction. Success posts on this topic have been much harder to find than trouble posts, so I thought I would share how I think I got there and also for those in Ubuntu 10.10 to have a confirmation it is possible to get this going with latest v4l git tree drivers.

    • Hi. I have a 2010:b140 as well, trying to get it to work using 2.6.39.3. I can record video,
      yet mplayer never detects sound. Is there a patch that needs application? Has anyone else seen this type of behavior? Thanks!

  24. Mr. Hietmueller,

    No success from Polaris4 or V4L on Meerkat 10.10

    /home/patrick/hauppauge/v4l/media_build/v4l/fmdrv_common.c:41: fatal error: linux/ti_wilink_st.h: No such file or directory
    compilation terminated.
    make[2]: *** [/home/patrick/hauppauge/polaris4/v4l/dvb_net.o] Error 1
    make[1]: *** [_module_/home/patrick/hauppauge/polaris4/v4l] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-25-generic-pae’
    make: *** [default] Error 2

    Here is what I get with uname -a
    Linux desktop 2.6.35-27-generic-pae #48-Ubuntu SMP Tue Feb 22 21:46:58 UTC 2011 i686 GNU/Linux

    I’ve followed all the instruction on the comments and it wasn’t building with 2.6.35-25, so I updated my system. I’m assuming there is a simple fix to this and it is just a header issue, but I’ve hit a wall.
    Any help would be appreciated. If you have a link to a paypal donation page, please post it in the reply. Thank you sir for your time.

  25. Hi Devin,
    i use a Hauppauge USB Live-2 (later generation, usb id 2040:c200) on ubuntu 10.04 (2.6.32-22) with cx231xx from polaris4. It generally works, and i get a good picture once i “v4lctl setnorm pal”. sadly, once the stream is stopped after that and i try to restart, it fails. if i dont switch to PAL, i can restart as often as i like.

    i’ll gladly help debugging; maybe can you say wether “PAL support” might indeed be the a problem?

    best,
    -dan

  26. Hi again,
    found it works just fine with tvtime. i had used “gst-launch v4l2src ! xvimagesink” and v4lctl, seems there’s something fishy with that combination, but not the driver.

    thanks for your excellent work!

    -dan

  27. I did get the USB Live 2 working in October 2010 , but then I did an upgrade, and it’s all stopped again.
    But my new attempts to get it working have failed…
    Here’s what I did: (Debian squeeze)
    uname -a -> Linux rigel 2.6.32-5-686 #1 SMP Wed Jan 12 04:01:41 UTC 2011 i686 GNU/Linux
    apt-get install linux-headers-$(uname -r)
    hg clone http://kernellabs.com/hg/~dheitmueller/polaris4
    cd polaris4
    su
    make
    # all fine to here
    make install
    # seems fine
    # plug in USB Live 2 and get various USB found device messages, then
    v4l2_common: disagrees about version of symbol v4l2_device_register_subdev
    v4l2_common: Unknown symbol v4l2_device_register_subdev
    # about 11 of these messages
    What am I doing wrong?

    • Devin Heitmueller

      Hello Ant,

      The support has been merged upstream, so you should not be using my private tree anymore. Your best bet would be to install the current media_build tree from linuxtv.org (see the LinuxTV wiki for instructions).

      Cheers,

      Devin

      • Thank you for the pointer, but I’m not getting anywhere. Assuming that the instructions in http://www.linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers are what you refer to, I followed them:

        git clone git://linuxtv.org/media_build.git
        cd media_build
        ./build.sh

        and after downloading and it doing some patches for my kernel (2.6.32)
        I got a warning about not having the full kernel sources installed. Do I need this or can I get away with just the headers?
        Then I got several messages like
        V4L2_MEM2MEM_DEV: Requires at least kernel 2.6.33
        then
        File not found: ./../linux/drivers/staging/altera-stapl/kconfig at ./scripts/make_kconfig.pl line 284, line 38
        and eventually
        make: *** [all] Error 2
        I actually only want to get one device working, and I don’t really want to install another new kernel to do that. Is this actually possible?
        And is this the right place to ask this question?
        cheers
        ant

        • Devin Heitmueller

          Hi Ant,

          The developer have been known to sometimes break the build system. General questions of this nature should be directed to the linux-media mailing list (or you might get results asking on the #linuxtv IRC channel).

          Devin

    • Devin Heitmueller

      Yes, audio should work fine. The problem people typically have is getting MythTV to capture on the correct ALSA device. You can list the ALSA devices by running “arecord -l” from the command line.

      Devin

      • So I have ALSA:default set at the moment but should it be
        ALSA:hw something then? this is my arecord
        **** List of CAPTURE Hardware Devices ****
        card 0: SB [HDA ATI SB], device 0: ALC889 Analog [ALC889 Analog]
        Subdevices: 1/1
        Subdevice #0: subdevice #0
        card 0: SB [HDA ATI SB], device 2: ALC889 Analog [ALC889 Analog]
        Subdevices: 2/2
        Subdevice #0: subdevice #0
        Subdevice #1: subdevice #1
        card 2: Cx231xxAudio [Cx231xx Audio], device 0: Cx231xx Audio [Conexant cx231xx Capture]
        Subdevices: 1/1
        Subdevice #0: subdevice #0
        card 3: Cx231xxAudio_1 [Cx231xx Audio], device 0: Cx231xx Audio [Conexant cx231xx Capture]
        Subdevices: 1/1
        Subdevice #0: subdevice #0

        • Devin Heitmueller

          No, ALSA:default will tell MythTV to capture audio from your sound card’s line-in/microphone (not the HVR-850). Looks like you need hw:2,0 or hw:3,0 (it’s not clear why two devices are showing up in the list).

          Devin

          • hmm mythtv reports
            AudioInALSA(hw:3,0) Error: pcm open failed: Protocol error
            and arecord reports
            arecord -D hw:3,0
            arecord: main:654: audio open error: Protocol error

    • Devin Heitmueller

      Hello Vientito,

      Yes, the 850 support includes ATSC, ClearQAM, and NTSC analog. That said, you should probably not use my tree but rather just use the standard linux_media build, since all of my changes have been merged upstream.

      Devin

  28. there’s a model number 1230/1238 for HVR850. is it similar to 1200 at all or is it based on a different chipset? is our driver going to work with 1230/1238?

    • Devin Heitmueller

      Hello Vientito,

      I would have to look to be sure, but to my knowledge the core design hasn’t changed. My guess is that this is probably just a SKU change for something like changes/localization of the manual…

      I won’t be able to say for sure until you plug in the unit and check the USB ID.

      Devin

  29. I am getting a compile error using ubuntu natty.

    /home/joe/850/polaris4/v4l/au0828-video.c: In function ‘au0828_uninit_isoc’:
    /home/joe/850/polaris4/v4l/au0828-video.c:185:5: error: implicit declaration of function ‘usb_buffer_free’

    uname -a
    Linux 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 athlon i386 GNU/Linux

    Is this an known issue

    • Devin Heitmueller

      Hi ncube,

      The changes are already upstream, so you should not need to use the polaris4 source tree at all. If the changes aren’t in your particular kernel for some reason, then just install the mainline media_build tree since it is definitely there (and the mainline tree better tracks breakage in the APIs that other subsystems introduce).

      Devin

  30. Devin,

    Thx for the response. I have tried that now the Media build seemed to work.
    However I have rebooted and Now I am seeing the following errors ?

    [ 5593.960224] dvb_init: looking for tuner / demod on i2c bus: 12
    [ 5593.962901] tda18271 12-0060: attaching existing instance
    [ 5593.962910] DVB: registering new adapter (cx231xx #1)
    [ 5593.962918] DVB: registering adapter 0 frontend 0 (LG Electronics LGDT3305 VSB/QAM Frontend)…
    [ 5593.963625] Successfully loaded cx231xx-dvb
    [ 5593.963846] cx231xx #1: EndPoint Addr 0x84, Alternate settings: 5
    [ 5593.963852] cx231xx #1: Alternate setting 0, max size= 512
    [ 5593.963858] cx231xx #1: Alternate setting 1, max size= 184
    [ 5593.963863] cx231xx #1: Alternate setting 2, max size= 728
    [ 5593.963868] cx231xx #1: Alternate setting 3, max size= 2892
    [ 5593.963873] cx231xx #1: Alternate setting 4, max size= 1800
    [ 5593.963879] cx231xx #1: EndPoint Addr 0x85, Alternate settings: 2
    [ 5593.963884] cx231xx #1: Alternate setting 0, max size= 512
    [ 5593.963889] cx231xx #1: Alternate setting 1, max size= 512
    [ 5593.963895] cx231xx #1: EndPoint Addr 0x86, Alternate settings: 2
    [ 5593.963900] cx231xx #1: Alternate setting 0, max size= 512
    [ 5593.963905] cx231xx #1: Alternate setting 1, max size= 576
    [ 5593.963911] cx231xx #1: EndPoint Addr 0x81, Alternate settings: 6
    [ 5593.963916] cx231xx #1: Alternate setting 0, max size= 512
    [ 5593.963921] cx231xx #1: Alternate setting 1, max size= 64
    [ 5593.963926] cx231xx #1: Alternate setting 2, max size= 128
    [ 5593.963932] cx231xx #1: Alternate setting 3, max size= 316
    [ 5593.963937] cx231xx #1: Alternate setting 4, max size= 712
    [ 5593.963942] cx231xx #1: Alternate setting 5, max size= 1424
    [ 5593.966534] cx231xx #1: cx231xxcx231xx: called cx231xx_uninit_vbi_isoc
    [ 5593.966545] cx231xx #1: cx231xx_stop_stream():: ep_mask = 10
    [ 5594.049406] cx231xx #1: cx231xx_start_stream():: ep_mask = 4
    [ 5594.049849] cx231xx #1: cx231xx_stop_stream():: ep_mask = 4
    [ 5594.053384] cx231xx #1: cx231xx_start_stream():: ep_mask = 4
    [ 5594.053825] cx231xx #1: cx231xx_stop_stream():: ep_mask = 4
    [ 5594.057385] cx231xx #1: cx231xx_start_stream():: ep_mask = 4
    [ 5594.057890] cx231xx #1: cx231xx_stop_stream():: ep_mask = 4
    [ 5594.061385] cx231xx #1: cx231xx_start_stream():: ep_mask = 4
    [ 5594.062679] cx231xx #1: cx231xx_stop_stream():: ep_mask = 4
    [ 5594.066635] cx231xx #1: cx231xx_start_stream():: ep_mask = 4
    [ 5594.067306] cx231xx #1: cx231xx_stop_stream():: ep_mask = 4
    [ 5594.074142] cx231xx #1: cx231xx_start_stream():: ep_mask = 4
    [ 5594.096118] cx231xx #1: cx231xx_init_audio_isoc: Starting ISO AUDIO transfers
    [ 5599.100519] cx231xx #1: cx231xx_stop_stream():: ep_mask = 4
    [ 5621.456275] cx231xx #1: Changing the i2c master port to 1
    [ 5621.524029] cx231xx #1: Reloading firmware for XC5000
    [ 5621.524279] cx231xx #1: UsbInterface::sendCommand, failed with status –32
    [ 5621.524290] tda18271_write_regs: [12-0060|M] ERROR: idx = 0x5, len = 1, i2c_transfer returned: -32
    [ 5621.524299] tda18271_init: [12-0060|M] error -32 on line 831
    [ 5621.524304] cx231xx #1: XC5000 firmware download failed !!!
    [ 5653.776102] cx231xx #1: setPowerMode::mode = 16, No Change req.
    [ 5775.959978] cx231xx #1: setPowerMode::mode = 16, No Change req.
    [ 5787.954212] cx231xx #1: setPowerMode::mode = 16, No Change req.

    Look like the errors I was seeing before.

    JH

  31. Christian Vollmer

    I was able to install the driver on Fedora 13 (kernel version 2.6.34.8-68). However, when I plug in the device, I get the following ouput from dmesg:

    usb 1-5: new high speed USB device using ehci_hcd and address 4
    usb 1-5: New USB device found, idVendor=2040, idProduct=c200
    usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 1-5: Product: Hauppauge Device
    usb 1-5: Manufacturer: Hauppauge
    usb 1-5: SerialNumber: 0013603182
    Linux video capture interface: v2.00
    cx231xx v4l2 driver loaded.
    cx231xx #0: New device Hauppauge Hauppauge Device @ 480 Mbps (2040:c200) with 5 interfaces
    cx231xx #0: registering interface 0
    cx231xx #0: registering interface 1
    cx231xx #0: registering interface 5
    cx231xx #0: can’t change interface 3 alt no. to 3: Max. Pkt size = 0
    cx231xx #0: can’t change interface 4 alt no. to 1: Max. Pkt size = 0
    cx231xx #0: Identified as Hauppauge USB Live 2 (card=9)
    cx231xx #0: UsbInterface::sendCommand, failed with status –32
    cx231xx #0: UsbInterface::sendCommand, failed with status –32
    cx231xx #0: UsbInterface::sendCommand, failed with status –32
    cx231xx #0: UsbInterface::sendCommand, failed with status –32
    cx231xx #0: UsbInterface::sendCommand, failed with status –32
    cx231xx #0: UsbInterface::sendCommand, failed with status –32
    cx231xx #0: UsbInterface::sendCommand, failed with status –32
    cx231xx #0: cx231xx_dev_init: cx231xx_afe init super block – errCode [-32]!
    cx231xx #0: cx231xx_init_dev: cx231xx_i2c_register – errCode [-32]!
    cx231xx: probe of 1-5:1.5 failed with error -32
    usbcore: registered new interface driver cx231xx

    Can anybody tell me, what the problem might be. I read some comments, that mentioned there might be problems with newer kernels like the one I use. Is that the reason?

    I also tried to plug on the device on a machine with the latest OpenSuse distribution. It worked without the need to compile the kernel module from this branch. However, the same error output was produced.

    • Devin Heitmueller

      Hello Christian,

      There has been some discussion with some of the other developers about this issue, but we don’t know exactly what is causing it – it doesn’t happen to everyone.

      The suspicion is that the power sequencing isn’t waiting long enough, so there are attempts to communicate with certain subcomponents before they are fully powered. There isn’t currently a fix though.

      I need to find some time to sit down and debug this issue.

      Devin

      • Christian Vollmer

        Hello Devin,

        from the discussion above, it seems, it worked with some older kernel version. So, it might work, if I install an older kernel version, right? Can you tell what the latest kernel version it worked with was?

        Christian

        • Devin Heitmueller

          Hi Christian,

          The original work was done on an Ubuntu 10.10 box running 2.6.35, in conjunction with the latest media_build tree at the time. Numerous others have reported it working, suggesting that either a regression was introduced or there is something unusual about your environment (e.g. kernel tuning parameters, hardware, etc).

    • Devin Heitmueller

      Hello Sam,

      I have not tried 11.04, nor do I have any immediate plans to. If you can narrow down the problem though to a specific kernel version or build, that would be useful information.

      Devin

  32. Devin,

    I am also having a problem on Ubuntu 11.04 (2.6.38-8) with a USB Live 2. When I open the video device as non-blocking, VIDIOC_DQBUF errnos EAGAIN in perpetuity. If I open the device as just RDWR, DQBUF blocks forever. Regardless of resolution. The same code path works fine with bttv cards. VLC can’t operate the device either.

    Random sampling of errors from dmesg:

    UsbInterface::sendCommand, failed with status –71
    can’t change interface 3 alt no. to 0 (err=-71)
    cx231xx_set_decoder_video_input: adjust_ref_count :Failed to setAFE input mux – errCode [-71]!
    cx25840 0-0044: 704×480 is not a valid size!

    Thank you for your time Devin,

    Rob

    • Devin Heitmueller

      Hi Rob,

      Looks like the S_STREAMING call was never issued, so the engine never started. That said though, I don’t know about the other errors.

      I believe that device requires 720×480 for resolution. It won’t take 704×480, and it should have informed the application of this when the app issued an S_FMT call.

      Have you tried tvtime?

      Devin

      • tvtime segfaults after complaining “Your capture card driver: cx231xx [Hauppauge USB Live 2/usb-0000:00:1d.0-1.6/1] does not support studio-quality colour images required by tvtime… Message from the card was: Invalid argument”

        I’m not familiar with S_STREAMING, is that something lower level than the VIDIOC_STREAMON call I issue to start streaming?

        The resolution errors seem to occur regardless of the resolution (i.e., something else is going on) – they happen at 720×480, 704×480, 640×480, 720×240, 352×240 and 320×240.

        • I’ve got the same issues on later distributions after 10.04. Since I couldn’t get this to work on prev. distributions up to Natty Narwhal (Ubuntu), I decided to revert to maverick on my netbook and use this polaris4 tree. I only ever managed to get it working with this tree *and* on windows, every other attempt in other distros failed. I posted twice to the linux-media list, but never got a reply on this -71 error.

          Just installed Natty today on my netbook to see where things stand at the moment. Got the same -71 error. Then installed the media_build tree to see if that might work, but same error. My netbook is a 32bit system. Plugged the device into my workstation (x64 / natty), but got the same error there.

          Even with the polaris4 tree, there was an issue with tvtime regarding PAL. My small HD camera can output PAL and NTSC. Using PAL mode, tvtime didn’t work. tvtime only worked using NTSC. But I know this device is using NTSC at the moment.

          I could record and play (with lag) PAL video using a combination of mencoder and mplayer commands: mencoder tv:// -tv driver=v4l2:device=/dev/video1:immediatemode=0:outfmt=yv12:norm=pal:width=640:height=480 -nosound -ovc lavc -lavcopts -o >(tee {some-file} | mplayer -cache 32 – ), even though it never worked on tvtime. That way I managed to make a number of videos.

          It looks like it’s certainly in the initialization. Although I am a programmer, I just don’t know enough about drivers, v4l2 and other stuff to resolve this myself.

          When the stick is plugged in on 10.04, I see the audio hardware appearing in sound prefs and so on.

          Relevant bits from log (natty):
          [27678.086980] usb 1-1: new high speed USB device using ehci_hcd and address 27
          [27678.243341] cx231xx #3: New device Hauppauge Hauppauge Device @ 480 Mbps (2040:c200) with 5 interfaces
          [27678.243343] cx231xx #3: registering interface 1
          [27678.243445] cx231xx #3: can’t change interface 3 alt no. to 3: Max. Pkt size = 0
          [27678.243555] cx231xx #3: can’t change interface 4 alt no. to 1: Max. Pkt size = 0
          [27678.243657] cx231xx #3: Identified as Hauppauge USB Live 2 (card=9)

          [27685.504632] cx231xx #3: cannot change alt number to 3 (error=-110)
          [27685.512699] cx231xx #3: UsbInterface::sendCommand, failed with status –71
          [27685.521067] cx231xx #3: UsbInterface::sendCommand, failed with status –71
          [27685.521130] cx231xx #3: cx231xx_stop_stream():: ep_mask = 8
          [27685.537742] cx231xx #3: can’t change interface 3 alt no. to 0 (err=-71)
          [27685.546065] cx231xx #3: can’t change interface 2 alt no. to 1 (err=-71)
          [27685.546071] cx231xx #3: failed to set alternate setting !
          [27685.546144] cx231xx #3: cx231xx_stop_stream():: ep_mask = 8
          [27685.562714] cx231xx #3: can’t change interface 3 alt no. to 0 (err=-71)
          [27685.566865] cx231xx #3: can’t change interface 2 alt no. to 1 (err=-71)
          [27685.566869] cx231xx #3: failed to set alternate setting !
          [27691.949101] usb 1-1: USB disconnect, address 27

  33. Devin,I’ve switched to ubuntu 10.04 to just get this to work.
    Still,I’m facing problems.

    2002.386591] cx25840 2-0044: 640×480 is not a valid size!
    [ 2002.390705] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.394831] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.398960] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.403079] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.403089] cx25840 2-0044: 640×480 is not a valid size!
    [ 2002.407210] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.411329] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.415458] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.419581] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.419589] cx25840 2-0044: 640×480 is not a valid size!
    [ 2002.420322] cx231xx #0: cx231xx_stop_stream():: ep_mask = 8
    [ 2002.425310] cx231xx #0: cx231xx_initialize_stream_xfer: set video registers
    [ 2002.435335] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.537694] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2002.541815] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2007.551547] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2007.555653] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2007.560277] cx231xx #0: UsbInterface::sendCommand, failed with status –71
    [ 2007.633934] cx231xx #0: cx231xx_stop_stream():: ep_mask = 8
    [ 2007.642041] cx231xx #0: can’t change interface 3 alt no. to 0 (err=-71)

    Any idea what is actually a valid size?

    Thanks

  34. I’m using Mplayer now.This is what I’m using :

    sudo mplayer -cache 128 -tv driver=v4l2:width=256:height=192:input=1:normid=5:amode=1:device=/dev/video1 tv://

    But,it provides an output like this :
    MPlayer SVN-r1.0~rc3+svn20090426-4.4.3 (C) 2000-2009 MPlayer Team
    mplayer: could not connect to socket
    mplayer: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.

    Playing tv://.
    Cache fill: 0.00% (0 bytes)
    TV file format detected.
    Selected driver: v4l2
    name: Video 4 Linux 2 input
    author: Martin Olschewski
    comment: first try, more to come 😉
    Selected device: Hauppauge USB Live 2
    Capabilites: video capture VBI capture device audio read/write streaming
    supported norms: 0 = NTSC; 1 = NTSC-M; 2 = NTSC-M-JP; 3 = NTSC-M-KR; 4 = NTSC-443; 5 = PAL; 6 = PAL-BG; 7 = PAL-H; 8 = PAL-I; 9 = PAL-DK; 10 = PAL-M; 11 = PAL-N; 12 = PAL-Nc; 13 = PAL-60; 14 = SECAM; 15 = SECAM-B; 16 = SECAM-G; 17 = SECAM-H; 18 = SECAM-DK; 19 = SECAM-L; 20 = SECAM-Lc;
    inputs: 0 = Composite1; 1 = S-Video;
    Current input: 1
    Current format: YUYV
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    v4l2: ioctl set format failed: Invalid argument
    Selected input hasn’t got a tuner!
    open: No such file or directory
    [MGA] Couldn’t open: /dev/mga_vid
    open: No such file or directory
    [MGA] Couldn’t open: /dev/mga_vid
    [VO_TDFXFB] This driver only supports the 3Dfx Banshee, Voodoo3 and Voodoo 5.
    [VO_3DFX] Unable to open /dev/3dfx.
    ==========================================================================
    Opening video decoder: [raw] RAW Uncompressed Video
    VDec: vo config request – 256 x 192 (preferred colorspace: Packed YUY2)
    VDec: using Packed YUY2 as output csp (no 0)
    Movie-Aspect is undefined – no prescaling applied.
    VO: [xv] 256×192 => 256×192 Packed YUY2
    Selected video codec: [rawyuy2] vfm: raw (RAW YUY2)
    ==========================================================================
    Audio: no sound
    Starting playback…
    v4l2: select timeout
    v4l2: select timeout ??% ??,?% 0 0 0%
    v4l2: select timeout ??% ??,?% 0 0 0%

    I’ve also updated my blogpost and posted a screenshot. It displays a green screen now.
    Please see it here : http://csharpnews.wordpress.com/2011/06/15/usb-live-2-on-ubuntu-shows-only-black-screen/
    Please help me. Thanks so much.

  35. Devin,Its working on my Ubuntu 10.04 now with your Polaris4 branch,not with the one from linuxtv.org.

    But,I could see the video but I cannot use it because,if I change the resolution or any setting,it does not work.
    It’s also not working for PAL system video. PLease help Devin.

  36. Is there any way to unload and reload the driver without restarting the PC? The video display becomes a black screen if I change any video parameters (like resolution) and Its also not working with PAL system. Suddenly,it just displays a black screen again.

    Unloading and reloading the driver can take me one more step ahead. Please advice.

    I would appreciate any help. Thanks so much.

  37. Devin,

    What can I do to facilitate this? It’s no problem to bring up a quick console 11.04 install in VirtualBox and work with the kernel source in there. The first thing I would look at is what -71 #defines to (if anything) and then work my way up the call chain, but a little nudge in the right direction from you would go a long way – it’s been years since I’ve hacked the kernel. You could certainly narrow this down orders of magnitude faster than I.

    On a related note, do you know for sure if the USB Live 2 is working with the latest media_tree?

  38. Hey,
    I’ve been using this for some months now, so first, thank you for this 🙂
    Now for my problem… I have two Hauppauge USB Live 2 (cx231xx) which I both want to show at the same time. I am using TVTime for this:
    > tvtime -d /dev/video0 -F /etc/tvtime/tvtime2.xml
    > tvtime -d /dev/video1 -F /etc/tvtime/tvtime.xml

    But only the first TVTime will show, the second one outputs:
    > Your capture card driver: cx231xx [Hauppauge USB Live 2/usb-0000:00:04.1-8.4/1]
    > does not support studio-quality colour images required by tvtime.
    > This is a hardware limitation of some cards including many
    > low-quality webcams. Please select a different video device to use
    > with the command line option –device.
    > Message from the card was: The argument is invalid

    So I have two cards, but it acts like it was just one tuner.
    Is it somehow possible to capture inputs from both cards at once? Or is switching back and forth between them the best solution?

    • Devin Heitmueller

      Hi Chris,

      You probably have both devices connected to the same USB host controller and thus don’t have enough bandwidth to capture video on both simultaneously. Bear in mind that each device takes up about 60% of a 480Mb USB controller’s bandwidth.

      That, combined with some crappy exception handling in tvtime is probably why it reports the failure as “not supporing studio-quality color images”…

      Devin

        • Devin Heitmueller

          Chris,

          Correct, you would not have this problem if you had a PCI video grabber, or even if you just installed a second dedicated USB host controller card.

          Running multiple instances of tvtime is supported (in fact I’ve run four instances at the same time before).

          You’ve hit a general limitation of a single USB bus – overcome that problem and you can definitely support more than one video capture device.

          Devin

Leave a Reply