Skip to content


Christmas present to users: PCTV 340e Support!

I finally got the new DVB generator up and running, and spent the afternoon debugging the PCTV 340e. The digital support is now working!

http://kernellabs.com/hg/~dheitmueller/pctv-340e-2/

As always, there are a bunch of caveats:

The testing as of this point has been *very* limited. I have basically confirmed that tuning works with tzap/mplayer with 8MHz DVB-T.

The code needs a bunch of cleanup before it could go into the mainline. It’s also based off a version of the v4l-dvb tree that is several months old and needs to be rebased against the current tip. This means that if you have other tuners that require a recent version of the v4l-dvb tree, you’re not going to be able to use the 340e at the same time as your other tuner.

The firmware can be found here:

http://kernellabs.com/firmware/xc4000/

I am not responsible/liable if the device burns your house down or something. ;-)

Support is limited to digital only. There is no analog support forthcoming unless someone adds analog support to the underlying dvb-usb framework.

I haven’t done the power management for the xc4000 tuner yet, so it will stay warm even when you are not actively watching a TV with it.

Of course, I am interested in feedback from testers, both positive and negative. It’s all too common to only hear from users when things are broken. If you try the code and it works for you, please spend a minute to post a comment below, even if it’s just a three word “works for me” comment.

UPDATE 12-28-2009 0924: When commenting, could you please tell me roughly where you are located, so I can get some idea how much of the functionality is being exercised (in terms of modulations, frequency ranges, etc). Also what applications you tested with would be helpful. Thanks!

Posted in 340e, pctv systems, xc4000.


66 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. wojtek says

    [/usr/src/pctv-340e-2-927fd2a915c4/v4l/firedtv-1394.o] Error 1
    make[2]: *** [_module_/usr/src/pctv-340e-2-927fd2a915c4/v4l] Error 2
    make[2]: Leaving directory `/usr/src/linux-headers-2.6.31-17-generic’

    make menuconfig delete module Firedtv .
    make ok
    make install
    reboot

    • Devin Heitmueller says

      Yeah, if you are an Ubuntu user, you have to disable the firedtv module. This is not specific to my PCTV 340e tree – you have to do that even with the current v4l-dvb tree.

      Devin

  2. Alfonso says

    Mr. Devin Heitmueller, you’re a star.

    Works for me under Ubuntu 9.10. Some notes for the less versed (like me)

    - You need to install the linux-source and ncurses-devel packages, otherwise make menuconfig will not work.
    - Don’t forget “make” and “sudo make install”
    - Don’t forget to copy the firmware file into /lib/firmware (as root)
    - If you don’t have a channels.conf file, like me, you can use VideoLan opening the DVB device. I needed to enter the channel frequency manually, I got the number from a digital tv set by looking at the channel info.

    After a while, I started to get libdvpsi and libmpeg2 warnings and things started to jitter. I’ll investigate more.

    • Devin Heitmueller says

      Alfonso,

      Thanks for taking the time to provide feedback.

      Thanks for provding the above tips. I sometimes take for granted that people are used to compiling v4l-dvb from source and therefore overlook providing more detailed instructions. I can confirm though that all the above are valid.

      You may wish to consider using a channel scanner to build a channels.conf (such as “scan” or “w_scan”), as opposed to manually typing in channel frequencies to VDR. Kaffeine also has a channel scanner built-in.

      Cheers,

      Devin

  3. kk says

    nice work! works out of the box with kaffeine. thanks :D

    • Devin Heitmueller says

      Hello kk,

      Glad it’s working for you. Just for my information, are you using Kaffeine3 or Kaffeine4? Did Kaffeine’s channel scanning work? And which country are you located in (so I can see what modulation types you have)?

      Devin

  4. kk says

    I’m in Italy using “autoscan Italy” source in kaffeine4 (and yes, autoscan works perfectly)

  5. jerzy says

    I’m green at these stuff, could somebody tell me what should I download to build linux driver. The firmware from here http://kernellabs.com/firmware/xc4000/ I’ve already downloaded.

    • Devin Heitmueller says

      Depends on what distro you are running. Look above for the series of command and Ubuntu user used. Essentially, you need to run the following as root:

      hg clone http://www.kernellabs.com/hg/~dheitmueller/pctv-340e-2/
      cd pctv-340e-2
      make
      make install
      reboot

      • Szabolcs Hodosi says

        Devin,

        I have compile issues with that. I have a 2.6.32.2 kernel source.
        (installed under the /usr/src/linux-source-2.6.32.2 (there are /usr/src/linux symlinks as usual), /lib/modules//build symlink point to good place.)

        I followed these instructions but I got this for ‘make’:

        CC [M] /usr/src/pctv-340e-2/v4l/dvbdev.o
        /usr/src/pctv-340e-2/v4l/dvbdev.c: In function ‘init_dvbdev’:
        /usr/src/pctv-340e-2/v4l/dvbdev.c:516: error: ‘struct class’ has no member named ‘nodename’
        make[3]: *** [/usr/src/pctv-340e-2/v4l/dvbdev.o] Error 1
        make[2]: *** [_module_/usr/src/pctv-340e-2/v4l] Error 2
        make[2]: Leaving directory `/usr/src/linux-2.6.32.2′
        make[1]: *** [default] Error 2
        make[1]: Leaving directory `/usr/src/pctv-340e-2/v4l’
        make: *** [all] Error 2

        root@htpc:/usr/src/pctv-340e-2# uname -r
        2.6.32.2

        I have MythBuntu 9.10

        root@htpc:/usr/src/pctv-340e-2# uname -a
        Linux htpc 2.6.32.2 #1 SMP Thu Dec 31 14:04:36 CET 2009 x86_64 GNU/Linux

        What are the next steps for a successful compilation?
        Thank you for your help in advance and Happy New Year to you :)

        Szabolcs

        • Devin Heitmueller says

          Szabolcs,

          Apparently it’s a build issue due to 2.6.32. If you look further up in the thread, you can see how other people worked around it. Otherwise, you will just have to wait a few days until I rebase the tree off of the current v4l-dvb tree (I branched the code several months ago and now need to resync it back to the mainline).

          Devin

          • Szabolcs Hodosi says

            Devin,

            Ok, thanks.. After I wrote my message I saw others comment that I should use the 2.6.31.x kernel.
            Now I rebuilt your source with 2.6.31.9 and it’s working.
            Despite of that I found this in my dmesg:

            beaver@htpc:~$ dmesg | grep “dvb”
            dvb-usb: found a ‘Pinnacle PCTV 340e HD Pro USB Stick’ in warm state.
            dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
            dvb-usb: schedule remote query interval to 50 msecs.
            dvb-usb: Pinnacle PCTV 340e HD Pro USB Stick successfully initialized and connected.
            usbcore: registered new interface driver dvb_usb_dib0700

            beaver@htpc:~$ dmesg | grep “xc4000″
            xc4000 3-0061: creating new instance
            xc4000: I2C read failed
            xc4000 3-0061: destroying instance

            So it looks good afterall, but I guess if the line “xc4000: I2C read failed
            ” is normal or not. I can access the device through kaffeine for example, but I can’t scan channels. Maybe it’s normal.
            I’m back to Windows and will see if I should see any channels with my internal antenna indoor. (I live only 10 km far from the DVB-T station, and they have 14,5 kW output transmit power, so I should see something :) ).

            i’ll update my “thread” with the latest status.

            Thank you for the response and help.

            Great work anyway, thanks a bunch :)

          • Devin Heitmueller says

            Hello Szabolcs,

            Please email me the full dmesg output and I will take a look (dheitmueller at kernellabs.com)

            Devin

          • Szabolcs Hodosi says

            Devin, mail sent.
            Unfortunately changed my system to an Intel Pine Trail mobo, so the only kernel I’ve succed to get the graphical chipset live is 2.6.32.X:( I know your sources are not yet compatible with that, I guess only if you are planning to upload your source to the mainline or make the source compilable with 2.6.32x vanilla kernels?

            Until then I’m blind :( and not able to test :(

            Anyway just a general question to everybody: Is there any DVB-T (or hybrid) card in the market which have hardware accelerated H.264 transcode? I suspect, but I’m not sure that pvr softwares including MythTV make recordings in MPEG2. I guess that only because in Hungary locally the H.264 has MPEG4 (MPEG2 Layer 4?) stream. Thus I’m not sure my Intel D510MO has enough power to do the transcoding in realtime.

            Thanks again.

          • Devin Heitmueller says

            Hello Szabolcs,

            The plan at this point is to rebase the code against the current v4l-dvb tip (which will allow it to work with other kernels), and then once the code is deemed stable it will be submitted upstream to be merged into the v4l-dvb tree (and subsequently to be merged into the mainline kernel).

            None of the cards that receive DVB-T will transcode to H.264 (as far as I know). The current cards just take the MPEG-2 coming off of the broadcast and write it to disk (requiring very little computation load). Doing a transcode would significantly increase the cost of such products. However, if the broadcaster is transmitting H.264, that is what will be written to disk and MythTV will play it back without any conversion to/from MPEG-2.

            Devin

          • Szabolcs Hodosi says

            Devin,

            I’m very apreciating all your investments on this project, which helps a lot of users being happy and just politely asking if there is any update on making xc4000 compatible with 2.6.32+? Since Mythbuntu 10.04 LTS is out and kernel is around 2.6.34 now in the mainline, are you plan any further resource investment to upload xc4000 driver into the mainline kernel or you just let it open to others?

            I haven’t coded in C, C++ for 5 years but if you need some help maybe I can help with migration. I can not estimate how much is it, since I’ve never did kernel-related development before.

            All the bests,
            Szabi

          • Szabolcs Hodosi says

            Devin,

            I merged your code into 2.6.34 on my local machine, it complies but it seems it doesn’t recognize my device and xc4000 module is not loading. I sent a separate mail to you.

            Can you help me where to go, what are the next steps to check?

            Thank you,

            Szabi

          • Cocodidou says

            Hello Szabolcs Hodosi,
            If you want your 340e to work under a 2.6.34 kernel then see the end of the discussion in http://www.kernellabs.com/blog/?p=1279
            I’ve posted a tarball and some instructions in order for you to get your 340e working on recent kernels.
            Hoping I helped you
            Cocodidou

          • raquel says

            Devin,

            I’ve found the same problem in my computer. Unfortunately, I have not found any patch yet and the 2.6.32 is the current stable version used by ubuntu. What would be the most appropiate solution?

          • Devin Heitmueller says

            Hello Raquel,

            The only solution at this point (other than manually making the fix described above to your source tree), is to wait for me to rebase the tree against the latest v4l-dvb tip. It’s on my TODO list, but I just haven’t found a couple of hours to do it yet.

            Devin

    • Alfonso says

      Let’s hope I have not forgot anything. First, goto http://kernellabs.com/hg/~dheitmueller/pctv-340e-2/ with your browser and click the “gz” link. You’ll download the source for the dvb tree in a .gz file. Unpack this file anywhere on your home folder.

      Open a command line and type the following commands.

      cd
      sudo apt-get install linux-source
      sudo apt-get install libncurses5-dev
      sudo make menuconfig

      You’ll see a text menu. Navigate to Multimedia Support->DVB/ATSC Adapters and look at the bottom of the list. Go to the “FireDTV” entry and press the N key to unselect this module. Exit and save your configuration.

      Then type the following commands (the first one may take a while to complete):

      make
      sudo make install
      sudo cp /lib/firmware

      If all has been going well, you can now plug the device into an USB port. The command

      dmesg

      should display as one of the last lines

      dvb-usb: Pinnacle PCTV 340e HD Pro USB Stick successfully initialized and connected.

      And now you can start kaffeine and see if it works. Warning, kaffeine has worked for me on a desktop KUbuntu install. I have installed kaffeine it on a netbook running Ubuntu and, while the channels are recognized, the image is not displayed. I get a message about missing codecs instead.

  6. Alfonso says

    Hey Devin, tried now in a box with kaffeine installed and using a good signal source (the same as my domestic TV Set). The kaffeine autoscan was able to tune 34 different channels.

    Cheers (from Spain, by the way)

  7. Sergey Ershov says

    I have only h.264 channels.
    I can not burn ts file.
    Filesize recording.ts 0 bytes.

    # w_scan -ft -cRU -X > channels1.dvbt
    w_scan version 20091118 (compiled for DVB API 5.0)
    using settings for RUSSIAN FEDERATION
    Country identifier RU not defined. Using defaults.
    frontend_type DVB-T, channellist 4
    output format czap/tzap/szap/xine
    Info: using DVB adapter auto detection.
    /dev/dvb/adapter0/frontend0 -> DVB-T “DiBcom 7000PC”: good :-)
    Using DVB-T frontend (adapter /dev/dvb/adapter0/frontend0)
    -_-_-_-_ Getting frontend capabilities-_-_-_-_
    Using DVB API 5.1
    frontend DiBcom 7000PC supports
    INVERSION_AUTO
    QAM_AUTO
    TRANSMISSION_MODE_AUTO
    GUARD_INTERVAL_AUTO
    HIERARCHY_AUTO
    FEC_AUTO
    -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
    Scanning 7MHz frequencies…
    177500: (time: 00:08)

    Scanning 8MHz frequencies…

    498000: (time: 01:32) (time: 01:42) signal ok:
    QAM_AUTO f = 498000 kHz I999B8C999D999T999G999Y999
    updating transponder:
    (QAM_AUTO f = 498000 kHz I999B8C999D999T999G999Y999)
    to (QAM_64 f = 498000 kHz I999B8C34D0T8G4Y0)
    506000: (time: 02:04)

    858000: (time: 16:25)
    tune to: QAM_64 f = 498000 kHz I999B8C34D0T8G4Y0
    (time: 16:45) service = Rossia (GTRK KURSK)
    service = Perviy Kanal (GTRK KURSK)
    service = NTV (GTRK KURSK)
    service = TRK-5 (GTRK KURSK)
    service = Kultura (GTRK KURSK)
    service = Sport (GTRK KURSK)
    service = Vesti-24 (GTRK KURSK)
    service = Detskiy (GTRK KURSK)
    service = Radio Rossia (GTRK KURSK)
    service = Vesti FM (GTRK KURSK)
    service = Radio Mayak (GTRK KURSK)
    dumping lists (11 services)
    Done.

    # cat channels1.dvbt
    Rossia(GTRK KURSK):498000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_NONE:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:201:301:1
    …….

    # ./tzap -cchannels1.dvbt “Rossia(GTRK KURSK)”
    using ‘/dev/dvb/adapter0/frontend0′ and ‘/dev/dvb/adapter0/demux0′
    reading channels from file ‘channels1.dvbt’
    tuning to 498000000 Hz
    video pid 0x00c9, audio pid 0x012d
    status 00 | signal 976d | snr 034c | ber 001fffff | unc 00000000 |
    status 07 | signal 8065 | snr 00da | ber 001fffff | unc 00000000 |
    status 1f | signal 81f6 | snr 00ea | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 826b | snr 00de | ber 00000000 | unc 00000000 | FE_HAS_LOCK
    status 1f | signal 829c | snr 00de | ber 00000000 | unc 00000000 | FE_HAS_LOCK

    Second console:

    # cat /dev/dvb/adapter0/dvr0 > recording.ts
    # ls -s r*
    0 recording.ts

    Filesize recording.ts 0 bytes.

    • Devin Heitmueller says

      Sergey,

      You need to pass “-r” to tzap in order to be able to capture on dvr0:

      ./tzap -r -cchannels1.dvbt “Rossia(GTRK KURSK)”

      This is not specific to the 340e – you would have to do this with any DVB device.

      Cheers,

      Devin

  8. jerzy says

    If you talking about copying firmware file into /lib/firmware do you have in mind to copy file locatet in http://kernellabs.com/firmware/xc4000/ which is named “dvb-fe-xc4000-1.4.1.fw”

    • Devin Heitmueller says

      Jerzy,

      Yes, you should end up with the following file:

      /lib/firmware/dvb-fe-xc4000-1.4.1.fw

      Devin

  9. Faed says

    Nice work! I’m in Czech Republic using Ubuntu 9.10 and Kaffeine 4 with “Autoscan”. It works :)

  10. Mohammad Bahathir Hashim says

    What can I say, except THANK YOU VERY MUCH!!!.
    After waiting patiently for more than a year, at last, I can view my country’s DVB-T test transmission. :)

    Anyway, I have to use Linux kernel version 2.6.31 because, the pctv340e did not compiled with 2.6.32.
    http://old.nabble.com/-Bug-55411–kernel-desktop-devel,-NEW:-nodename-missing-in-device.h-td26253103.html

    I am using MPlayer SVN-r30130-4.4.0 to tune channels, view and listen to digital radio broadcasts.
    Here are my basic steps to view/listen the broadcasts with MPlayer, after successfully installed the pctv 340e drivers.

    1) I did not found any channels.conf for my country, so I create it.
    $ w_scan -c MY -x > initial_tune_data.txt
    Here I got, 3 frequencies (8MHz), and each has the SAME contents.

    2) Generate channels.conf with linuxtv-dvb-apps’ scan
    $ scan initial_tune_data.txt > my_rtm_channels.conf

    4) Copy the file to mplayer etc
    $ cp my_rtm_channels.conf /usr/local/etc/mplayer/channels.conf

    Finally, … fire up the MPlayer
    $ mplayer dvb://TV1

    You can change channels with ‘h’ and ‘k’ keys.

    System configuration.
    GNU/Linux Slamd64 12.0 distro, kernel version 2.6.31 64 bits
    gcc 4.4.0…

    Location : Malaysia.
    DVB-T frequencies
    650000000
    658000000
    666000000

    I am looking forward for the version which can be compiled with 2.6.32 and being included in main Linux kernel. :)

    Good luck and thank you.

    • Devin Heitmueller says

      Hi Mohommad,

      Yeah, Mandriva has a custom version which is broken when attempting to use an upstream v4l-dvb tree. It’s their own fault. You can work around it by patching the code as Thomas Backlund suggested, but I can tell you that there will not be any code changes to v4l-dvb to make that work. Of course it becomes a non-issue once the changes are merged in to the mainline kernel and you update your Mandriva distro.

      Cheers,

      Devin

  11. Mohammad Bahathir Hashim says

    Hi Devin. :)

    I am not using Mandriva. I am using SLAMD64 12.0 (Slackware based 64 bits). The ‘nodename’ has been changed to devnode in 2.6.32. That’s why it’s failed with my vanilla 2.6.32. FYI, in my GNU/Linux environment, the /usr/include/linux is being linked directly to current kernel’s include directories.

    bahathir@darkstar:~$ ls -l /usr/include/linux
    lrwxrwxrwx 1 root root 28 2008-04-23 17:37 /usr/include/linux -> /usr/src/linux-2.6.32/include/linux/

    and also several other kernel related include directories.

    Anyway, yes, I am very happy to and, I may leave it ON for several hours after this, to see the stability.

    Thanks again. :)

    • Devin Heitmueller says

      Ah ok.

      Does the mainline http://linuxtv.org/hg/v4l-dvb tree build cleanly on your system? If so, then the problem will go away when I sync up against the latest v4l-dvb tree (my tree is based off a a v4l-dvb that is several months old). If not, then you’re out of luck as your distro is doing something nonstandard (unless you hand-merge the patch into your environment).

      Yeah, I’m definitely interested in seeing what happens when you run it for a few hours. Let me know.

      Cheers,

      Devin

  12. wojtbar says

    Hello ,
    lirc :=(

    cat /proc/bus/input/devices
    I: Bus=0003 Vendor=2304 Product=023d Version=0100
    N: Name=”IR-receiver inside an USB DVB receiver”
    P: Phys=usb-0000:00:1d.7-3/ir0
    S: Sysfs=/devices/pci0000:00/0000:00:1d.7/usb1/1-3/input/input18
    U: Uniq=
    H: Handlers=kbd event8
    B: EV=3
    B: KEY=14afc336 294284d 0 0 0 4 80158000 2190 40000801 9e96c0 0 900200 10004ffd

    generate code
    irrecord -H devinput -d /dev/input/event8 /home/wojtbar/pinnacle

    configure /etc/lirc/hardware.conf
    copy pinnacle.conf to /etc/lirc/lircd.conf
    configure ~/.lircrc
    start lirc
    kernel message :
    1. dib0700: Unknown remote controller key: 0000 00 ff
    reboot
    2. dib0700: Unknown remote controller key: 0004 24 db
    cheers

    • Devin Heitmueller says

      Admittedly I’m not much of an lirc person. For the dib0700 tuners I typically just set it up to use the the in-kernel IR handler for the remote that shipped with the product (something which I forgot to do for the 340e). Should just be a one-line change.

      If you really want to use lirc, there is some stuff in the linuxtv wiki about making lirc work with the dib0700 (for example in the Nova-T 500 page).

      Devin

  13. wojtbar says

    Hello

    LIRC ok :=)

    wojtbar

    • Cocodidou says

      Hello wojtbar,
      How did you do for lirc to support the 340e? I don’t know how to do…
      Thanks by advance
      Cocodidou

      • Devin Heitmueller says

        Hello Cocodidou,

        If you read today’s post, I think you can understand why I cannot go into a tutorial on how to setup lircd. Your best bet is to look at the Linux TV Wiki for how to configure lircd to work with other dib0700 based devices such as the Nova-T 500. The 340e works just like all the other dib0700 devices.

        Devin

  14. Sergey Ershov says

    I had problems with my h.264 channels. I had a bad video and bad ts file.
    My PCTV Hybrit Stick Solo 340e SE has no remote control.
    I changed dib0700_device.c

    { “Pinnacle PCTV Hybrid Stick Solo”,
    { &dib0700_usb_id_table[65], NULL },
    { NULL },
    },
    },
    // .rc_interval = DEFAULT_RC_INTERVAL,
    // .rc_key_map = dib0700_rc_keys,
    // .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
    // .rc_query = dib0700_rc_query
    },
    };

    VDR-1.7.7 works !
    h.264 channels ok!
    Thanks

    • Devin Heitmueller says

      Sergey,

      I accidentally damaged my 340eSE hardware, so wasn’t able to test with that particular board.

      I’m a little surprised to find that the definition of an RC profile causes corrupted TS streams when the device isn’t present.

      Nonetheless, I agree that we probably shouldn’t be advertising an IR controller on a device that doesn’t have one, so I will split out the 340eSE into a separate profile without the IR definition.

      Thanks for reporting this!

      Devin

  15. Marcello says

    Hi all,
    all compilation went fine on my ubuntu 8.10 with 2.6.27
    However when loading the firmware I get this
    [ 2787.518868] dvb-usb: found a ‘Pinnacle PCTV Hybrid Stick Solo’ in cold state, will try to load a firmware
    [ 2787.518872] firmware: requesting dvb-usb-dib0700-1.20.fw

    which is not the one supplied by Devin. (tried to make a soft link, but of course did not work). My PCTV is a 340e SE

    thanks for everything
    Any guess

    • Devin Heitmueller says

      Marcello,

      The firmware for the dib0700 is required for the tuner to work. I failed to mention it in the original post because many distributions already have it (since it is used by other products already supported).

      KernelLabs worked with the vendor to get redistribution rights so it can be bundled into the Linux distributions. It can be found here:

      http://kernellabs.com/firmware/dib0700/

      Cheers,

      Devin

  16. Marcello says

    updates to the one above.
    Tried adding the firmware /lib/firmware/dvb-usb-dib0700-1.20.fw
    and now it works smoothly with kaffeine3 in italy!
    But don’t know what’s going on though. Maybe Devin can figure this out

  17. Mohammad Bahathir Hashim says

    Yes, compiling problem due to the usage of ‘nodename’ in v4l codes which are in your current pctv 340e development directory. I am not rushing to build the latest vdl and can wait for the official pctv 340e driver in mainline kernel.

    I realized that, as soon I plugged in the PCTV 340e, system load increased up to 0.50, even when I am not using/accesing it. System load will goes down after removing (rmmod) the ‘dvb_usb_dib0700′module.

    BTW, PCTV 340e working fine all day long, without any major problem. Sometimes there were problems with lipsync (A-V sync), but, IMHO, it is was to the signal quality/strength.

    Thank you.

    • Devin Heitmueller says

      I have some idea as to the cause of the system load – it has to do with the way the IR controller is implemented in the 1.20 firmware (something I spent some time debugging on Monday). I’m working on the problem, but I can say it’s not specific to the 340e but occurs with all of the dib0700 boards.

      When I do the cleanup work, I will rebase off of the current v4l-dvb tip, which will address the “nodename” issue.

      Any lipsync issues you might run into are not the card, but probably rather your sound card or application. The tuner just passes through the MPEG packets, and has no knowledge which packets contain video and which contain audio.

      Devin

  18. Mohammad Bahathir Hashim says

    I see. Since I am not using the IR remote control, is ot possible if you can implement the ‘remote control’ disable option/parameter in the mentioned module, which hopefully can bypass the ‘bug’ :) .

    Thank you.

    • Devin Heitmueller says

      Mohommad,

      Sure. Just pass “disable_rc_polling=1″ as an option to the dvb-usb modprobe options.

      Devin

  19. Mohammad Bahathir Hashim says

    YEESS!!!.. it works. :) Thank you. Now, i feel my laptop less sluggish, and the load average is 0.00, even currently using the pctv 340e to watch dvb-t broadcast. p/s: Now showing retro tv episode of ‘Starsky and Hutch’ :)

    It would be nice this tip can be documented in the pctv 340e README. :)

    Thank’s again.

    • Devin Heitmueller says

      Mohammad,

      Thanks for the additional testing.

      I’m not against putting the info into the wiki page for the 340e (once the tree is merged). Really what needs to happen though is I need to fix the IR handler in the dib0700 so that it’s not an issue for any of those boards.

      Devin

  20. Gabriele Whisky Visconti says

    Device seems to be correctly recognized by the kernel, but I’m unable to make it work properly….

    - While scanning with kaffeine4 the SNR level remains always under 2%… Sometimes it says “tuned” but no channel appears in the list of detected channels. In the meanwhile in the kernel log appears a bunch of messages like:
    xc4000 bandwidth 7MHz not supported

    - w_scan gives:
    sudo w_scan -cIT
    w_scan version 20090808 (compiled for DVB API 5.0)
    using settings for ITALY
    DVB aerial
    DVB-T Europe
    frontend_type DVB-T, channellist 4
    output format vdr-1.6
    Info: using DVB adapter auto detection.
    /dev/dvb/adapter0/frontend0 -> DVB-T “DiBcom 7000PC”: good :-)
    Using DVB-T frontend (adapter /dev/dvb/adapter0/frontend0)
    -_-_-_-_ Getting frontend capabilities-_-_-_-_
    Using DVB API 5.1
    frontend DiBcom 7000PC supports
    INVERSION_AUTO
    QAM_AUTO
    TRANSMISSION_MODE_AUTO
    GUARD_INTERVAL_AUTO
    HIERARCHY_AUTO
    FEC_AUTO
    -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
    Scanning 7MHz frequencies…
    177500: (time: 00:01) set_frontend:1690: FATAL: unsupported DVB API Version 5.1

    - and scan gives:
    scan -c
    using ‘/dev/dvb/adapter0/frontend0′ and ‘/dev/dvb/adapter0/demux0′
    WARNING: filter timeout pid 0×0011
    WARNING: filter timeout pid 0×0000
    dumping lists (0 services)
    Done.

    - or:
    scan /usr/share/dvb/dvb-t/it-Roma
    scanning /usr/share/dvb/dvb-t/it-Roma
    using ‘/dev/dvb/adapter0/frontend0′ and ‘/dev/dvb/adapter0/demux0′
    initial transponder 810000000 0 2 9 3 1 0 0
    initial transponder 730000000 0 2 9 3 1 0 0
    initial transponder 626000000 0 2 9 3 1 0 0
    initial transponder 762000000 0 2 9 3 1 0 0
    initial transponder 698000000 0 2 9 3 1 0 0
    initial transponder 186000000 1 2 9 3 1 0 0
    initial transponder 538000000 0 2 9 3 1 0 0
    >>> tune to: 810000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
    WARNING: >>> tuning failed!!!
    >>> tune to: 810000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
    WARNING: >>> tuning failed!!!
    >>> tune to: 730000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
    WARNING: >>> tuning failed!!!
    >>> tune to: 730000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
    WARNING: >>> tuning failed!!!
    >>> tune to: 626000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
    WARNING: >>> tuning failed!!!
    >>> tune to: 626000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
    WARNING: >>> tuning failed!!!
    >>> tune to: 762000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
    WARNING: >>> tuning failed!!!
    >>> tune to: 762000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
    WARNING: >>> tuning failed!!!
    >>> tune to: 698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
    WARNING: >>> tuning failed!!!
    >>> tune to: 698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
    WARNING: >>> tuning failed!!!
    >>> tune to: 186000000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
    WARNING: >>> tuning failed!!!
    >>> tune to: 186000000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
    WARNING: >>> tuning failed!!!
    >>> tune to: 538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
    WARNING: >>> tuning failed!!!
    >>> tune to: 538000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE (tuning failed)
    WARNING: >>> tuning failed!!!
    ERROR: initial tuning failed
    dumping lists (0 services)
    Done.

    I’m in Italy, nearby Rome. Using Kubuntu Karmic
    uname -a
    Linux mars 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 16:20:31 UTC 2009 i686 GNU/Linux

    • Devin Heitmueller says

      Hello Gabriele,

      Thanks for the feedback!

      The SNR reporting in Kaffeine is based on assumptions about how SNR is represented that are not appropriate for this card. The issue is the format for the SNR field is not standardized across frontends, and the author of Kaffeine chose what happened to work for his particular card.

      Yeah, the 7MHz support in the xc4000 driver needs some work. It’s on my todo list. You’ll have to bear with me for a bit while I try to get caught up in various projects. I will definitely get the 7Mhz support working before the driver is submitted upstream for inclusion in the mainline kernel.

      Devin

  21. jerzy says

    after upgrading to ubuntu 9.10 and changing kernel of course I was amazed, beacause the driver is still working …. if is it some way to uninstall it. It was installed by command make install insted of checkinstall -D :(

  22. Szabolcs Hodosi says

    Devin,

    I’ve downgraded my kernel to 2.6.31 and reach my X screen via NX, this way I was able to test.
    Here aremy results… I don’t report these are faults by your code, because I don’t have any other DVB-T device. Maybe only misconfigurations…

    /var/log/dmesg:
    —————

    usb 1-1: new high speed USB device using ehci_hcd and address 2
    usb 1-1: configuration #1 chosen from 1 choice
    dib0700: loaded with support for 14 different device-types
    dvb-usb: found a ‘Pinnacle PCTV 340e HD Pro USB Stick’ in cold state, will try to load a firmware
    usb 1-1: firmware: requesting dvb-usb-dib0700-1.20.fw
    dvb-usb: downloading firmware from file ‘dvb-usb-dib0700-1.20.fw’
    dib0700: firmware started successfully.
    dvb-usb: found a ‘Pinnacle PCTV 340e HD Pro USB Stick’ in warm state.
    dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
    DVB: registering new adapter (Pinnacle PCTV 340e HD Pro USB Stick)
    DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)…
    xc4000 3-0061: creating new instance
    xc4000: Successfully identified at address 0×61
    xc4000: Firmware has not been loaded previously
    Reading firmware dvb-fe-xc4000-1.4.1.fw
    usb 1-1: firmware: requesting dvb-fe-xc4000-1.4.1.fw
    xc4000 3-0061: Loading SCODE for type=HAS_IF_5400 (40000000), id 0000000000000000.
    input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1d.7/usb1/1-1/input/input3
    dvb-usb: schedule remote query interval to 50 msecs.
    dvb-usb: Pinnacle PCTV 340e HD Pro USB Stick successfully initialized and connected.
    usbcore: registered new interface driver dvb_usb_dib0700

    RESULT: Passed.

    Scanning for channels:
    ———————-

    I., w_scan

    root@torch:/lib/firmware# w_scan -c HU
    w_scan version 20090808 (compiled for DVB API 5.0)
    using settings for HUNGARY
    Country identifier HU not defined. Using defaults.
    frontend_type DVB-T, channellist 4
    output format vdr-1.6
    Info: using DVB adapter auto detection.
    /dev/dvb/adapter0/frontend0 -> DVB-T “DiBcom 7000PC”: good :-)
    Using DVB-T frontend (adapter /dev/dvb/adapter0/frontend0)
    -_-_-_-_ Getting frontend capabilities-_-_-_-_
    Using DVB API 5.1
    frontend DiBcom 7000PC supports
    INVERSION_AUTO
    QAM_AUTO
    TRANSMISSION_MODE_AUTO
    GUARD_INTERVAL_AUTO
    HIERARCHY_AUTO
    FEC_AUTO
    -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
    Scanning 7MHz frequencies…
    177500: (time: 00:00) set_frontend:1690: FATAL: unsupported DVB API Version 5.1

    RESULT: Failed.

    Playing Channels
    —————-

    I., Mplayer

    beaver@torch:~$ mplayer dvb://”DunaTV HD”
    MPlayer UNKNOWN-4.4.1 (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 dvb://DunaTV HD.
    dvb_tune Freq: 802000000
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 2048 bytes
    dvb_streaming_read, attempt N. 5 failed with errno 0 when reading 732 bytes
    dvb_streaming_read, attempt N. 4 failed with errno 0 when reading 168 bytes
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 1088 bytes
    dvb_streaming_read, attempt N. 5 failed with errno 0 when reading 524 bytes
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 1444 bytes
    TS file format detected.
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 840 bytes
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 1364 bytes
    dvb_streaming_read, attempt N. 5 failed with errno 0 when reading 424 bytes
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 216 bytes
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 948 bytes
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 740 bytes
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 532 bytes
    dvb_streaming_read, attempt N. 5 failed with errno 0 when reading 156 bytes
    dvb_streaming_read, attempt N. 6 failed with errno 0 when reading 324 bytes

    This time dmesg shows:

    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!
    xc4000 bandwidth not set!

    RESULT: Failed.

    root@torch:/usr/src# scan /usr/share/dvb/dvb-t/hu-Debrecen > /etc/channels.conf
    scanning /usr/share/dvb/dvb-t/hu-Debrecen
    using ‘/dev/dvb/adapter0/frontend0′ and ‘/dev/dvb/adapter0/demux0′
    initial transponder 714000000 0 3 9 3 1 2 0
    initial transponder 802000000 0 3 9 3 1 2 0
    >>> tune to: 714000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE
    WARNING: >>> tuning failed!!!
    >>> tune to: 714000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE (tuning failed)
    WARNING: >>> tuning failed!!!
    >>> tune to: 802000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE
    WARNING: filter timeout pid 0×0011
    WARNING: filter timeout pid 0×0000
    WARNING: filter timeout pid 0×0010
    dumping lists (0 services)
    Done.

    RESULT: Failed.

    With Windows XP & original drivers & a free dvb player I was able to scan channels.
    What can be the problem with my configs, box?
    Any idea?

  23. Domenico says

    Hello Devin,
    thank you very much for this great job.
    I compiled this module on Debian lenny with kernel source 2.6.26-21.
    I used Kaffeine3 with autoscan and channel list “AUTO”. I’m in Italy.
    I had only one problem, I had to insert manually the module xc4000 because it was not loaded automatically.
    Thanks again!

  24. Robert says

    Last week, my Ubuntu 9.10 did a kernel upgrade from 2.6.31-17 to 2.6.31-19 and now the stick is not recognized anymore (it worked in -17), even after a re-compile and -install of the modules. syslog only lists a generic USB device. What can I do?

    I would also like to mention, I could watch tv only with mplayer and xine. kaffeine always claims (even before the kernel upgrade) that no appropriate dvb-t card is present.

    • Devin Heitmueller says

      Hello Robert,

      Upgrading the kernel results in the modules no longer being in the active kernel tree (since the kernel tree gets switched with the upgrade)

      Goto your v4l-dvb hg tree and run:

      make distclean
      make
      make install

      The “make distclean” is required so that the v4l-dvb compile knows to look for the latest kernel headers.

      Cheers,

      Devin

      • Robert says

        That ideed did the job. I had made clean but not distclean. Thanks a lot.

        Robert

  25. Szabolcs Hodosi says

    Your code looks good for me. I sign off :)
    Recording in MythTV worked like a charm.
    When your code would planned to be merged into the mainline?

    I would have two questions:
    1., Do you plan to decrease the warmth of the device? As I remember you told the device is active even if it’s not doing active work.
    2., Do you plan to support the +5V, +12V voltage outtake to the antenna? The hardware supports it AFAIK. i’m using it with antenna built-in amplifier and external adapter on the cable. I hope this 12V with 100mA won’t make the device hurt :)

    All the things looks good afterall, great work.
    I owe you a beer or several :)

  26. wojtbar says

    Hello
    pctv340e compiled with 2.6.32.:
    1 error “dvbdev”
    copy /usr/src/linux-source-2.6.32/drivers/media/dvb/dvb-core /usr/src/pctv-340e-2/linux/drivers/media/dvb
    2 error “meye”
    copy /usr/src/linux-source-2.6.32/drivers/media/video/meye.c meye.h /usr/src/pctv-340e-2/linux/drivers/media/video/
    3 error videobuf-core
    copy 5 files /usr/src/linux-source-2.6.32/drivers/media/video/videobuf-core.c videobuf-dma-contig.c videobuf-dma-sg.c videobuf-dvb.c videobuf-vmalloc.c
    /usr/src/pctv-340e-2/linux/drivers/media/video/
    4 error “dabusb”
    copy 2 files /usr/src/linux-source-2.6.32/drivers/media/video/dabusb.c dabusb.h
    /usr/src/pctv-340e-2/linux/drivers/media/video/
    5 error “radio-cadet”
    copy /usr/src/linux-source-2.6.32/drivers/media/radio/radio-cadet.c
    /usr/src/pctv-340e-2/linux/drivers/media/radio/

    compilation sucesful
    make install
    reboot
    :)

  27. Magnus says

    Hi!

    I bought this stick by mistake, was looking for a older type tho, one that had working support for both analog and digital.
    Nevertheless, the tuner works like charm in Mythtv, I was pleasantly surprised that you could watch one channel while recording another.

    I don’t have access to any HD channels nor H.264, so can’t if that works, just the few FTA channels here in Sweden.

  28. Rob Van Dyck says

    Thanx for your great work Devin!

  29. PY says

    Hi Devin,
    When you find some time and motivation to spend on this project, on top of the code rebase and the power management, please consider adding 7MHz support. I can help with testing on the FTA channels here in Australia-Sydney
    Cheers

    • Devin Heitmueller says

      A user who did some additional work on the xc4000 driver did do some support for 7MHz, although I do not know if it has actually been tested. You can find the discussion on the linux-media mailing list.

      Devin

  30. Alexander B. Kostenko says

    I am in Ukraine, Kiev. I use Kubuntu 9.10, kaffeine 1.0-pre2 (autoscanning works perfectly – all 25 channels are found in a frequency range 634000 – 818000 KHz). Magnificent quality of a picture. Huge gratitude to the author.

  31. mambro says

    Hi,
    I still got this error compiling under kernel 2.6.32 (Ubuntu 10.04)

    /home/mambro/tv_usb/pctv-340e-2/v4l/dvbdev.c: In function ‘init_dvbdev’:
    /home/mambro/tv_usb/pctv-340e-2/v4l/dvbdev.c:516: error: ‘struct class’ has no member named ‘nodename’
    make[3]: *** [/home/mambro/tv_usb/pctv-340e-2/v4l/dvbdev.o] Error 1
    make[2]: *** [_module_/home/mambro/tv_usb/pctv-340e-2/v4l] Error 2
    make[2]: Leaving directory `/usr/src/linux-headers-2.6.32-22-generic’
    make[1]: *** [default] Error 2
    make[1]: Leaving directory `/home/mambro/tv_usb/pctv-340e-2/v4l’
    make: *** [all] Error 2
    mambro@marte ~/tv_usb/pctv-340e-2 $ uname -a
    Linux marte 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:28:05 UTC 2010 x86_64 GNU/Linux

    Will you rebase to the current v4l-dvb tree to fix it?

    Thanks!

  32. Guillaume Anciaux says

    Hi,

    I ported your driver extension to xc4000 to the latest v4l version and tested on 2.6.32. It appears to work well. Let me know who I should give the patch to in order to see your work appearing in distributions….

    Thanks again for your work,,

    All the best,

    Guillaume

  33. Szabolcs Hodosi says

    Devin,

    I merged your code into 2.6.34 on my local machine, it complies but it seems it doesn’t recognize my device and xc4000 module is not loading. I sent a separate mail to you.

    Can you help me where to go, what are the next steps to check?

    Thank you,

    Szabi

  34. chriscross says

    Works in Fedora 12 64 with 2.6.32.14-127.fc12.x86_64 kernel , only with http://corentin.ferry.free.fr/pctv-340e.tar.gz Cocodidou’s v4l version . ofc i used your 2 firmware modules and i disabled the Firetv Module in make menuconfig command.



Some HTML is OK

or, reply to this post via trackback.