hauppauge wintv-dual hd - only see one tuner

  • Hi everybody,

    I've just purchased a WinTV-dualHD here in New Zealand, and I'm trying to get it running on a Raspberry Pi 3 running OSMC (based off Raspbian) and I'm wondering if there is anything I can do with the great work already outlined in this thread to get a similar result on this setup? Or should I wipe it and run LibreELEC?

    I'd really appreciate any help you could provide.

    Cheers!

  • Just wanted to drop in and give you guys a big thank you for getting this device working fully. (for my scenario, at least) :cool:

    I'm using the LibreELEC-Generic.x86_64-8.0.0 build on a Zotac mini HTPC - ZBOX ID45 with Intel cpu/Nvidia gpu.

    Previously I had a crappy old Afatech AF9013 based device - SD single DVB-T tuner.
    Just replaced it with this device and its HD dual DVB-T2 tuners - rebooted HTPC, half a dozen clicks or so in TVHeadend web UI to enable the new tuners and remap channels and hey presto - everything is working fantastically.

    Gotta love it when stuff like this Just Works™ first time - I was expecting *hours* of futzing around to get everything to behave, but the hours of work already put in by the LE code team made it all completely painless.


    Sorry I haven't got any useful input to give you RPi guys - hope you get your solution sorted out soon :(

    Edited once, last by kurai (March 4, 2017 at 1:35 PM).

  • Hi everybody,

    I've just purchased a WinTV-dualHD here in New Zealand, and I'm trying to get it running on a Raspberry Pi 3 running OSMC (based off Raspbian) and I'm wondering if there is anything I can do with the great work already outlined in this thread to get a similar result on this setup? Or should I wipe it and run LibreELEC?

    I'd really appreciate any help you could provide.

    Cheers!

    Hi

    I never actually tried using the LibreElec build as my LibreElec install runs on a different device, so I can't say whether this works out of the box with it, but I would try that first, because if it does, then life will be a lot easier.

    If not, then post back and I'll see if I can create a patch for the 4.9.11 kernel. Based off my experience, you will need to compile your own kernel to get this working on a Raspbian based Pi (not as daunting as it sounds).

  • Ok, I decided to put together a guide to how to get this to work on a Pi.

    Some notes to be aware of:

    • This is tested and working on a Raspberry Pi Model B+
    • The code below assumes that you are cross compiling, so you will either need access to a linux machine (either VM or actual computer. Mine was built on Ubuntu Server 14.04) or you will need to amend the code to compile on the Pi itself.
    • This guide only gives support for DVB (and DVB-T2). I am in the UK so do not have access to ATSC, so have no need for, nor any means to test, any amends made to the relevant ATSC sources.
    • The instructions below are not technically how you are meant to use git. I know this. My interest is not in a git tutorial, but how to get the Hauppage Win-TV Dual working on a Raspberry Pi.


    The guide:

    • If you do not already have a working Raspbian distribution installed on your Pi, then head over to FrontPage - Raspbian and follow their instructions for installing an image. NB: I run /root off a USB stick. I recommend this for a more stable and faster install.
    • Run raspi-config to set up your Pi
      Code
      sudo raspi-config


      Set your various optional options such as hostname, SSH access and overclock (I use the Modest Overclock, but it probably isn't necessary)
      Enable automatic loading of I2C Modules. The location of this will vary depending on your version of raspi-config, but mine is located in Interfacing Options

    • Reboot your Pi then shutdown.
    • On your Ubuntu machine, make a folder for compiling your kernel and navigate to it
      Code
      mkdir -p ~/git/rpi && cd ~/git/rpi
    • Download required packages for compiling your own kernel (NB this may not be a complete list, if more packages are required, let me know and I will amend)
      Code
      sudo apt update && sudo apt install git bc -y
    • Grab the toolchain required for cross compiling
      Code
      git clone --depth 1 https://github.com/raspberrypi/tools
    • Get the Raspberry Pi Kernel sources for Kernel 4.9
      Code
      git clone --depth 1 -b rpi-4.9.y https://github.com/raspberrypi/linux
    • Download my amended sources
      Code
      wget https://drive.google.com/open?id=0B4QJttpe0CpLdDNKbHVpWFNlaGs && \
      wget https://drive.google.com/open?id=0B4QJttpe0CpLWEhheHJMa2RKTjQ && \
      wget https://drive.google.com/open?id=0B4QJttpe0CpLS0FsenJ1Z0JwRkk && \
      wget https://drive.google.com/open?id=0B4QJttpe0CpLZS1Yck91bGhiWWc
  • Hi

    I never actually tried using the LibreElec build as my LibreElec install runs on a different device, so I can't say whether this works out of the box with it, but I would try that first, because if it does, then life will be a lot easier.

    If not, then post back and I'll see if I can create a patch for the 4.9.11 kernel. Based off my experience, you will need to compile your own kernel to get this working on a Raspbian based Pi (not as daunting as it sounds).

    It didn't work out of the box on a new LibreELEC install on my RPi3. :( Not even detecting the dualHD at all now?

    Any help you can provide with how to compile my own kernel, or the idiot's guide to getting this working on an RPi3 (any distro) would be amazing!

    Also - and forgive my ignorance - but if I custom compile and patch a kernel, what happens when the system updates?

    And (last dumb question): am I compiling all of these on a separate build machine? If so, how am I transferring the right files to the RPi?

    Edited once, last by thecrane (March 5, 2017 at 7:42 AM).

  • It didn't work out of the box on a new LibreELEC install on my RPi3. :( Not even detecting the dualHD at all now?

    Any help you can provide with how to compile my own kernel, or the idiot's guide to getting this working on an RPi3 (any distro) would be amazing!

    Also - and forgive my ignorance - but if I custom compile and patch a kernel, what happens when the system updates?

    And (last dumb question): am I compiling all of these on a separate build machine? If so, how am I transferring the right files to the RPi?

    Ok, I have created a patch for version 4.9.y for Rasperry Pi. Some notes for anyone looking to use this.

    • This patch was created for my use only, anyone is free to use it, change it and amend it for reposting, but I will not troubleshoot or fix any issues anyone has. It has just been created from my amends to the 4.9 kernel to get dual tuner support working on an rPi Model B+
    • This patch has been built, tested and confirmed working on a rPi Model B+ for Kernel 4.9.13
    • Whilst this patch was compiled for a Model B+, I see no reason why it would not work on other models of Pi as the sources are the same.
    • This adds support for DVB only! I am in the UK so do not have a need for ATSC nor have any means for testing it. The amended code for ATSC is in my patch, but it has been commented out and has not been tested. The source for lgdt3306a would need to be amended to get ATSC working and I have not touched this. So to reiterate ATSC will NOT work with this patch. Do not try it.


    With that said, follow the instructions for compiling your own kernel as detailed in the Raspberry Pi documentation here: Kernel building - Raspberry Pi Documentation but make the following changes:

    • When instructed to get the sources, use the following command instead to ensure that you grab the sources for the 4.9 kernel:
      Code
      git clone --depth 1 -b rpi-4.9.y https://github.com/raspberrypi/linux
    • Once you have retrieved the sources, but before running any other commands, grab my patch from here: hauppage_winTV_dualHD_DVB_PuffinChunks_4.9.y.diff - Google Drive and copy it one folder up from where you have downloaded the rpi kernel source (eg: if your source downloaded to /home/user/linux then copy the patch to /home/user)
    • Enter the kernel source directory and apply the patch
      Code
      cd linux
      patch -p1 < ../hauppage_winTV_dualHD_DVB_PuffinChunks_4.9.y.diff


      The following output should tell you whether you've successfully applied the patch:

      Code
      patching file drivers/media/usb/em28xx/em28xx-cards.c
      patching file drivers/media/usb/em28xx/em28xx-core.c
      patching file drivers/media/usb/em28xx/em28xx-dvb.c
      patching file drivers/media/usb/em28xx/em28xx.h
    • With the patch successfully applied to the source you can now continue to follow the instructions on the Raspberry Pi documentation. It is up to you whether you compile locally on the Pi or on a different machine. My advice is the latter as it takes just minutes, but can take many hours to compile on a Pi.
    • Once compiled and installed on the Pi, don't forget to grab the firmware for the card from here: dvb-demod-si2168-b40-01.fw and copy it to your /lib/firmware folder on your Pi. You may still be missing some firmware. If this is the case, then I recommend getting CrazyCat's firmware tarball and just installing the whole lot, so you have all bases covered (dvb-firmwares.tar.bz2)

    As to your other questions, be aware, an apt-get upgrade will update the kernel if a new one has been released for Raspbian, so you will want to suppress this from your updates to avoid overwriting your custom kernel.

    The Raspberry Pi documentation will tell you how to either compile on your pi or on another system and transfer it over. As I stated above, I recommend cross-compiling on a different machine, but do whatever you feel most comfortable with, just be prepared for a long wait if compiling on the Pi.

    If you run in to any issues, let me know, but I can't promise anything as I am by no means an expert!

    Cheers

    Edited once, last by Puffin Chunks (March 11, 2017 at 10:07 AM).

  • Thanks so much for all that detail and help!!! I'll give it a go when I get home from work tonight, but I really appreciate you taking the time! Thanks again!

  • This adds support for DVB only! I am in the UK so do not have a need for ATSC nor have any means for testing it. The amended code for ATSC is in my patch, but it has been commented out and has not been tested. The source for lgdt3306a would need to be amended to get ATSC working and I have not touched this. So to reiterate ATSC will NOT work with this patch. Do not try it.

    Any ideas on how to get the ATSC working with your patch?

    Thanks Puffin Chunks for your detailed instructions so I can use the workaround to get both of my WinTV-DualHD ATSC tuners working on my Raspberry Pi 3

    I got the patch file for kernel 4.2.5 that was mentioned earlier at Dropbox - wintv-dualhd-kernel-4.2.5-2016-08-10.patch.tar.xz

    I followed your suggestion as well as Kernel building - Raspberry Pi Documentation

    I am now enjoying having both ATSC tuners working.

    Edited once, last by leading_edjge (March 15, 2017 at 2:42 AM).

  • What OS install did you use? It doesn't seem like you're running an LE build.

    No. I was not using the LE build because of all the warnings that the WinTV-DualHD ATSC would not work with that current build. I am too much of a newbie to fix the source for lgdt3306a. I am hoping that the LE build will work in the future. The instructions for building the Raspbian Linux kernel listed above was for the Raspberry Pi 3. Here is the reference: Kernel building - Raspberry Pi Documentation

    Edited once, last by leading_edjge (March 15, 2017 at 7:43 PM).

  • If you run in to any issues, let me know, but I can't promise anything as I am by no means an expert!

    Cheers


    Just a quick question - what were you using as the base build OS? Was it Raspbian? Or Libreelec? I've tried on both, and after patching and compiling the custom kernel, all I get is the rainbow screen when the RPi boots. :(

  • Okay, so I've managed to get past the rainbow screen...but not that much past it!

    I used a LibreELEC build, managed to follow all the instructions (I think) to cross-compile on an Ubuntu machine, and get it all installed on my Raspberry Pi (B+ - not a Raspberry Pi 2 that I originally thought).

    But now I get a kernel panic saying "Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)" with another note a two lines down saying "Hardware name: BCM2835" and then a stack trace.

    The last line is "random: fast init done".

    :( So close and yet so far. If anyone can help, I'll be super appreciative!

  • SUCCESS!!!!

    Some of the final mistakes were at my end and some (super-noobish-)mistakes.

    A couple of notes for anyone else as dumb as me:

    • Make sure you're using a Raspbian (not LibreELEC) build on your SD card. I think my errors were due to the compiled kernel not having support for squashfs
    • Make sure you're clear what version your Raspberry Pi is. I thought I was using an old Raspberry Pi 2 and was, therefore, compiling in 64-bit. But it is actually a RPi original, model B, so I should have been compiling in 32-bit.

    Other than that, everything looks promising, so thank you very much, Puffin Chunks, for your help!


  • SUCCESS!!!!

    Some of the final mistakes were at my end and some (super-noobish-)mistakes.

    A couple of notes for anyone else as dumb as me:

    • Make sure you're using a Raspbian (not LibreELEC) build on your SD card. I think my errors were due to the compiled kernel not having support for squashfs
    • Make sure you're clear what version your Raspberry Pi is. I thought I was using an old Raspberry Pi 2 and was, therefore, compiling in 64-bit. But it is actually a RPi original, model B, so I should have been compiling in 32-bit.

    Other than that, everything looks promising, so thank you very much, Puffin Chunks, for your help!

    No problem, dude. Sorry I haven't been about for a bit, so glad you got there! It's a great feeling when they both finally show up!

  • Puffin Chunks

    Thanks for the great work above, justt a quick question though..

    How easy would it be to apply the patches to an AMD64 based system running 4.9 kernel? My openmediavault server runs the 4.9 BPO kernel and im dying to get both the DVBC tuners running sucessfully.

    Thanks

  • Hi Crazycat,
    is this for twin tuner support or ATSC?

    There is single tuner support for ATSC.
    [v3,2/2,media] em28xx: support for Hauppauge WinTV-dualHD 01595 ATSC/QAM - Patchwork
    Hopefully with the patch listed above and the patches listed here, someone can get both ATSC tuners working.
    I got both ATSC tuners working on my Raspberry Pi 3 running on a patched kernel 4.2.8.
    Raspberry Pi 3 has updated Raspbian from kernel 4.4.x to 4.9.x.


  • Hello. Nube here. Has anyone been successful getting both tuners working yet? ATSC for both?

    Yes, I got both ATSC tuners working for my Raspberry Pi 3.
    I extracted the patch file for kernel 4.2.5 from Dropbox - wintv-dualhd-kernel-4.2.5-2016-08-10.patch.tar.xz
    I used the instructions to apply the patch from Kernel building - Raspberry Pi Documentation

    After rebooting with the patched kernel, the two ATSC tuners appeared.