Posts by leading_edjge

    I just got a Raspberry Pi 3, and trying to get the dual tuner (model 15950 to work with ATSC).

    There are a lot of references to retrieving patches, but It's not clear to me how to pull down the patch files.

    I am far more familiar with svn than git, though I have tried various git commands to get the desired patch files, and also looked at the web page links (like clicking on the patch link above). Also, after I figure how to get the patch files, can they all sit in the same directory I make for holding them (them patch files). Thanks. (I have compiled kernels before, though as Linux has become so much more friendly, and there is so much module support, I have not done so for a while).


    Try the following:

    Code
    wget https://raw.githubusercontent.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/master/patches/ubuntu-zesty-4.10.0/extra/0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch

    Edit the 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch file

    Remove this from the top of the file:

    Code
    From a4bb762c6f1a975387099f224510116f85d5bd97 Mon Sep 17 00:00:00 2001
    From: Brad Love <[email protected]>
    Date: Sun, 16 Apr 2017 00:13:39 -0500
    Subject: [PATCH 1/5] em28xx: Hauppauge DualHD DVB/ATSC second tuner support
    
    --- drivers/media/usb/em28xx/em28xx-cards.c | 123 +++++++++++++++++++++++++++++++- drivers/media/usb/em28xx/em28xx-core.c  |  47 +++++++++--- drivers/media/usb/em28xx/em28xx-dvb.c   |  28 ++++++-- drivers/media/usb/em28xx/em28xx.h       |  12 ++++ 4 files changed, 192 insertions(+), 18 deletions(-)

    Remove this from the bottom of file:

    Code
    -- 2.11.0

    Save the 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch file

    If you still cannot get the patch working, go to Ubuntu-media-tree-kernel-builder/patches/ubuntu-zesty-4.10.0/extra at master · b-rad-NDi/Ubuntu-media-tree-kernel-builder · GitHub

    Click on 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch

    Click on Raw

    You should be now at 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch

    Copy everything from

    Diff
    diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
    index a12b599a1fa2..df0e080bd08e 100644
    --- a/drivers/media/usb/em28xx/em28xx-cards.c
    +++ b/drivers/media/usb/em28xx/em28xx-cards.c

    to

    Code
    +
    +    struct em28xx    *dev_next;
    +    int ts; };  #define kref_to_dev(d) container_of(d, struct em28xx, ref)

    and paste into 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch. These steps should work.

    Try the following:

    Code
    wget https://raw.githubusercontent.com/b-rad-NDi/Ubuntu-media-tree-kernel-builder/master/patches/ubuntu-zesty-4.10.0/extra/0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch

    Edit the 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch file

    Remove this from the top of the file:

    Remove this from the bottom of file:

    Code
    -- 
    2.11.0

    Save the 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch file


    If you still cannot get the patch working, go to Ubuntu-media-tree-kernel-builder/patches/ubuntu-zesty-4.10.0/extra at master · b-rad-NDi/Ubuntu-media-tree-kernel-builder · GitHub

    Click on 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch

    Click on Raw

    You should be now at 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch

    Copy everything from

    Diff
    diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
    index a12b599a1fa2..df0e080bd08e 100644
    --- a/drivers/media/usb/em28xx/em28xx-cards.c
    +++ b/drivers/media/usb/em28xx/em28xx-cards.c

    to

    Code
    +
    +    struct em28xx    *dev_next;
    +    int ts;
     };
     
     #define kref_to_dev(d) container_of(d, struct em28xx, ref)

    and paste into 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch. These steps should work.

    Here is the 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch. Copy below using the copy icon and paste it into the file of 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch.

    One question : is the new patch different from the one from @Puffin Chunks in post #24 ?

    Now I have not one but 2 x wintv-dual hd so 4 DVB-T2 tunners in total that for now look to works perfectly with Puffin Chunks patch.

    I am wondering if it worth repatching with the new one.


    Yes, the new patch is different. Puffin Chunks commented out the lgdt3306a section (ATSC tuner) to get his patch to be successfully applied.

    I had both of my ATSC tuners working using a different patch for kernel linux 4.2.5. See Post #26

    Here is my reason for repatching with a newer patch:

    I was only 2 versions behind the Raspberry kernel of 4.4 at that time.

    Now that Raspberry kernel has been updated to 4.9, I was 7 versions behind.

    I was trying to figure out how to put the ATSC/lgdt3306a section for the single tuner ATSC patches now in kernel 4.11 into Puffin Chunks patches. I gave up since the new patch is out, for kernel 4.11. Now I am 2 versions ahead of the updated Raspberry kernel.

    The new patch should be closer to the one in the mainline of the future kernel. Kernel 4.12 will come out in the beginning of July. It will be months after July when we will see a future kernel with the new patch in the mainline.

    Instructions given in post #24 worked for me on DVB-T version.

    thanks a lot @Puffin Chunks

    Now this thread is talking about patching ATSC version of the dongle witch is a complete different beast only used in north america/Canada

    Maybe splitting this thread would help avoiding confusion?

    The latest patch add hauppauge patch · CvH/LibreELEC.tv@6f53d92 · GitHub will solve the dual tuner problem on ATSC and DVB-C/T/T2. Any solution on the ATSC will fix problems on the DVB-C/T/T2 and visa versa. A Hauppauge engineer is evaluating this patch and will work on it to submit it to the mainline of a future Linux kernel.

    I am updating Puffin Chunks instructions to cover both DVB-C/T/T2 and ATSC tuners. Thanks @Puffin Chunks 

    • This patch has been built, tested and confirmed working on a rPi Model 3 for Kernel 4.11.3
    • Whilst this patch was compiled for a Model 3, I see no reason why it would not work on other models of Pi as the sources are the same.


    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.11 kernel:
    Code
    git clone --depth 1 -b rpi-4.11.y https://github.com/raspberrypi/linux

    Once you have retrieved the sources, but before running any other commands, grab the patch from here: add hauppauge patch · CvH/LibreELEC.tv@6f53d92 · GitHub 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 < ../0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch

    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.
    • For DVB-C/T/T2 tuners only: 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.

    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.

    Are you sure that the previous patches had altered your linux kernel 4.11 source code? Normally when you apply a patch that does not work, you have to reverse the patch with the following command:

    Code
    patch -p1 -R < path/file.patch


    You might have to get a clean linux kernel 4.11 source code and start over again with 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch.

    How about putting 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch into packages/linux/patches/ (packages/linux/patches/default?) and trying again?

    Alternatively

    I assume if your linux kernel 4.11 is located in packages/linux/ and the patches are located in packages/linux/patches/, you should able to run the patch command.

    Code
    cd linux
    patch -p1 < patches/0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch

    If the patch is successful, you should be able to compile the kernel 4.11 with the patch.

    I compiled the latest Leia Rpi2/3 build last night (which includes kernel 4.11.5) with all 5 of the patches and I can still only see 1 front end. Perhaps adding the other 4 patches messed something else up?

    Maybe you should only use the 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch. The other patches might have reverted some parts of your Linux kernel 4.11 to Linux kernel 4.10.

    if you have something what works pls ping me to include it in official rls, tx :thumbup:

    How about putting in the kernel 4.11.x with the patch 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch from Ubuntu-media-tree-kernel-builder/patches/ubuntu-zesty-4.10.0/extra
    at master · b-rad-NDi/Ubuntu-media-tree-kernel-builder · GitHub?

    This patch should be removed when the future kernel supports both tuners.

    What does everyone else think?

    No. I did not modify the 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch.

    I used Kernel 4.11.3 only with above patch. I used these instruction to get both my tuners working. I did not want to use the Kernel release candidate 4.12, and I found that Kernel 4.11.3 worked fine.

    Re: Fwd: [PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner — Linux media

    I was able to build the patches for two tuners.

    I extracted the one patch file 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch from Ubuntu-media-tree-kernel-builder/patches/ubuntu-zesty-4.10.0/extra at master · b-rad-NDi/Ubuntu-media-tree-kernel-builder · GitHub

    I had trouble applying the patch with Linux Kernel 4.9 and Linux Kernel 4.10.

    I was successful in applying the patch with Linux Kernel 4.11.

    I built the patch with Linux Kernel 4.11 using these instructions: Kernel building - Raspberry Pi Documentation

    I did not use the LibreElec instructions to compile for my two tuners. I apologize in advance for any bogus suggestion.

    Compile - LibreELEC

    Would this command work to build Linux Kernel 4.11?

    Raspberry Pi 2 or 3 (for master branch):

    Code
    PROJECT=RPi DEVICE=RPi2 ARCH=arm LINUX_VERSION=4.11

    and put the patch file of 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch into projects/RPi2/patches/linux/

    Then perform the compilation of the Linux Kernel 4.11 with the patch and create a new image for your Raspberry Pi 3.

    Thanks for replying. I believe mine is ATSC as well, North American broadcast, correct? I also have the firmware in my lib/firmware folder.

    That firmware is only for the Si2168-B40 demodulator on the DVB-C tuner version of the Hauppauge Wintv-Dual HD. It does nothing for the North American ATSC tuner version since it uses a LGDT3306a for its demodulator.

    Sorry but LibreELEC version 8.0.2 with Linux Kernel 4.9.x does not support any ATSC tuner of the Hauppauge Wintv-Dual HD.

    The single ATSC tuner support of the Hauppauge Wintv-Dual HD showed up in the newly released Linux Kernel 4.11.x.

    You would have to wait for a future version of LibreELEC with a Linux Kernel of 4.11.x or greater to see ATSC tuner support. You would have to wait future version of LibreELEC with a future Linux Kernel to see dual ATSC/DVB-C tuner support.

    Re: Fwd: [PATCH] em28xx: add support for Hauppauge WinTV-dualHD DVB tuner — Linux media

    The other option is to build a new Linux Kernel 4.11.x to make the single ATSC tuner work. If you select this option, you might as well build the patch to support both ATSC tuners.

    I'm not very savvy in this arena, but I cannot even get one tuner listed in Tvheadend. I'm on Generic build LE version 8.0.2 and I read earlier in this topic that kernel 4.7 and up should support at least one tuner, but they won't show for me. Am I missing something?

    Edit: I also tried creating a firmware file in storage/.config/ and adding all of the firmware available in this thread, but no dice. Any sort of help would be appreciated.

    For the DVB-C tuner version of the Hauppauge Wintv-Dual HD, can you confirm that you have the correct firmware?

    Check if /lib/firmware has the file dvb-demod-si2168-b40-01.fw.

    If not, here are the instructions to getting the firmware for the DVB-C tuner version of the Hauppauge Wintv-Dual HD and putting in the /lib/firmware.

    Hopefully you will able to see the first tuner.

    Sorry I only have the ATSC version of the Hauppauge Wintv-Dual HD, so I cannot verify these instructions.

    Code
    wget http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/4.0.11/dvb-demod-si2168-b40-01.fw
    mv dvb-demod-si2168-b40-01.fw /lib/firmware/

    I got both ATSC tuners working for my Raspberry Pi 3 with the patch 0001-em28xx-Hauppauge-DualHD-DVB-ATSC-second-tuner-suppor.patch from Ubuntu-media-tree-kernel-builder/patches/ubuntu-zesty-4.10.0/extra at master · b-rad-NDi/Ubuntu-media-tree-kernel-builder · GitHub

    I had problems applying the patch with kernel 4.9 and 4.10.

    I got it working with kernel 4.11.

    I assume that two DVB-C tuners are supported with this patch.

    Hopefully this patch will be accepted in the future kernel (4.12 or 4.13?). A future Libreelec with the new kernel should see both tuners on the Hauppauge-DualHD.

    Can anyone tell me if both of the DVB-C tuners in Hauppauge Wintv-Dual HD work simultaneously with TVHeadend on LibreElec 8?

    I've tried looking for info on this everywhere but the information seems conflicting,

    I already bought one tuner that only works on Windows (Astrometa DVB T/T2/C) and I don't want to repeat that mistake.

    Libreelec/TVHeadend with Linux Kernel 4.7 and higher will support one DVB-C tuner on Hauppauge Wintv-Dual HD currently . You have to build the custom patches listed earlier to get both DVB-C tuners working simultaneously.

    Hi,

    Thanks for your efforts on this. I'd love to switch to TVHeadEnd, but lack the knowledge of how to apply these patches.

    Do you know when libreelec will support both tuners for this device out of the box?

    Thanks,

    Mark


    No. Libreelec will not support both tuners out of the box. You would set up TVHeadEnd under Libreelec. Libreelec with Linux Kernel 4.7 and higher will support one DVB tuner. Libreelec does not support ATSC tuner currently. When this patch ([v3,2/2,media] em28xx: support for Hauppauge WinTV-dualHD 01595 ATSC/QAM - Patchwork) is accepted, Libreelec in a future Linux Kernel will support one ATSC tuner. We have to wait until technical bureaucracy of supporting two WinTV-dualHD tuners to be settled in one of the patches and placed in the future Linux Kernel. Until then, I would recommend the "unofficial" patches to get the two tuners working.