PCTV 340e: Help Wanted

So I am now at the point where I am ready to start debugging signal lock. This is the phase in the project where all the code is written but has never actually been tested/debugged. My situation however is complicated by the fact that I do not actually have access to a DVB-T signal currently.

While I will be soliciting testers in general once I have something that I think basically works, at this point, I need one experienced user with access to a DVB signal who can provide an environment for me to remotely debug the board.

The ideal candidate:

  • Owns a PCTV 340e
  • Has used DVB devices under Linux in the past
  • Owns at least one other DVB board other than the PCTV 340e that is supported under Linux
  • Has access to a reliable DVB-T signal
  • Can provide a “known good” channels.conf created with their other tuner
  • Has recompiled the v4l-dvb codebase from source in the past.
  • Can provide ssh access to a PC that has both the 340e connected and this other card, and doesn’t care if they have to reinstall the OS when the project is done
  • The PC should also have installed the gcc toolchain and linux headers required to build v4l-dvb from source

The plan would be that once the environment is setup, I would ssh in, install my v4l-dvb development tree, and then debug dvb signal acquisition with the tuner until it is working. (using the “other device” as a reference). My expectation is the PC would have to be made available for about a week.

If there is someone out there wishing to help who meet the above criteria, please email me at dheitmueller at kernellabs.com.

The sooner I can get the board bootstrapped, the sooner 340e users who have been waiting for support for so long will finally get it.


45 thoughts on “PCTV 340e: Help Wanted

  1. Hey I would help you but now I’m in the US with no DVB-T signal for the next 6 months 🙁
    I hope somebody can help you (and us 🙂 ). Bye and thank for your work!

  2. Hi, I would like to help,too, but I just own the 340e and have no other dvb-t device working under linux. I bought the 340e (french version) not knowing that linux support was not accomplished yet.
    If I can help anyways, let me know (I’m even willing to buy/borrow a cheap stick for testing, just let me know what dvb-t usb stick works already fine under linux).
    I’m located in Belgium, under Windows I get (hd)dvb-t signals and can also connect to analog source (analog cable).

  3. Mi Mambro,

    Yeah, I’m in the United States myself, which is precisely the problem. Given the interest in seeing this device work, I am confident someone will step up to help.



  4. Hi, I would like to help,too, but I just own the 340e and have no other dvb-t device working under linux. Assistance will be difficult I am a driver
    Internet is not everywhere.

    Owns a PCTV 340e — YES
    Has used DVB devices under Linux in the past — YES
    Owns at least one other DVB board other than the PCTV 340e that is supported under Linux — NO Terratec Cinergy XS FM – Not Supported kernel 2.6.31-12-generic
    Has access to a reliable DVB-T signal — in my area is not (Poland)
    Can provide a “known good” channels.conf created with their other tuner –YES (Germany–and cinergyXSfm)
    Has recompiled the v4l-dvb codebase from source in the past. –YES
    Can provide ssh access to a PC that has both the 340e connected — YES
    The PC should also have installed the gcc toolchain-? and linux headers required to build v4l-dvb from source –YES

    It will be a problem. Here I have internet but
    I have no signal. The route I have a signal but
    I do not have internet.


    • Constantin Mihalache

      Hello Devin,

      My name is Constantin, I’m from Romania (EU) and I can help you with testing: DVB-T and Analog. Currently i’m running Ubuntu 9.10. Please let me know if my help is needed.

      Thank you,

  5. Hi,
    On Monday I will be in Germany. How do I have a signal dvb-t and internet
    something we can act, but only by a few hours at night my time. I do not know when the next opportunity. I will be in touch.

  6. Hello,
    I’m also willing to help.
    Unfortunately, I’m in a similar situation as Dan is: I do not have any other dvb device working under linux (yet :))
    I’m currently running a 2.6.30 kernel and the dvb tree is built. I do have access to a reliable dvb / analog signal and my network connection is generally very stable.

    Let me know if I can be of any help.

    Thanks for all your hard work,


  7. Mohammad Bahathir Hashim

    > Owns a PCTV 340e
    I own PCTV 340e .. since last year 🙂

    Has used DVB devices under Linux in the past
    No, PCTV 340e is my first DVB device. Previously, in early 2000’s I tried the analogue tv card. So, I not much problem though, because I can RTFM. 🙂

    > Owns at least one other DVB board other than the PCTV 340e that is supported under Linux
    Sorry, I don’t have any other DVB devices.

    > Has access to a reliable DVB-T signal
    Yes, I can get good DVB-T signal in my home, with the default ‘small’ antenna. I also have outdoor antenna with booster too. Signal should be not a problem.

    > Can provide a “known good” channels.conf created with their other tuner
    Suggestion, can we decode and use the conf from the Windows’ TV Center conf?

    > Has recompiled the v4l-dvb codebase from source in the past.
    The code compiling is my favorite :),

    > Can provide ssh access to a PC that has both the 340e connected and this other card, and doesn’t care if they have to reinstall the OS when the project is done
    I am on ADSL dynamic IP network, but if you want to, I can set the dynip hostname for you. You are can be access to my AMD Phenom 9950 BE (Quad cores), 4GB RAM, Slamd64 12.1, Kernel 2.6.31 vanilla. p/s will soon change to Slackware64 13. 🙂

    >The PC should also have installed the gcc toolchain and linux headers required to build v4l-dvb from source
    I compiled most of my favorite programs, and should be not much problem to compile the v4l codes.

    Thanks you.

  8. Hi Devin,
    I can prepare for you a machine with any distribution and packages you need, with a pc340e connected to a quite good dvb-t signal, and ssh access to it.

    let me know if this could help you



  9. Hi Devin, I could meet all the conditions except for the working DVB USB stick with channels.conf., unless you have any minimal HW requirements. My 340e is sitting unused after trying to make it work under Windows on my “lowly” Athlon+ 2.8 Ghz pc and seeing the Windows setup advice that my PC is too slow to be used with the stick. It has been my experience, specially with multimedia, that Linux requires about a third of the CPU to do the same job.

    Could you recommend us a working DVB USB device that we could purchase? (hint to HW manufacturers: this is the moment where your efforts to support Linux pay off in terms of increased sales, I certainly got the 340e based on Pinnacle’s reputation but should have researched more and went for another brand that officially supports Linux instead of relying on the work of brilliant people like Devin)

    • Hello Alfonso,

      Generally speaking, the Pinnacle people (now PCTV Systems) have been extremely supportive. They have provided me with free sample hardware for various products, answered questions on the specifics of their hardware designs, and pushed chipset vendors to give me the necessary documentation.

      In the case of the 340e, the gating issue is just that I’m in the United States and don’t have a DVB-T generator with which to do testing/debugging (at $1500 US, it’s a rather expensive piece of equipment).

      I’m actually pretty close to having the device working – all the code is written and I just need to test/debug with a real signal.


  10. Hi ! I do not know if this information is of any help, but I tried the XC4000 driver with a Leadtek DTV 2000H Plus (also using an older patch from the V4L lists for identifying the device and setting GPIOs).
    Unfortunately I do not have the firmware file, so I disabled all firmware loading code, and also commented out any resetting of the tuner so that the firmware loaded in Windows could be used.
    This way, I did get analogue (PAL) TV to work, channels and audio mode (mono/stereo) can be selected, the frequency is locked according to the kernel messages, and the picture is generally good (other than too high contrast, which is not necessarily an issue with the tuner, since it also occurs with the composite video input). I cannot test DVB, though, and did not try the FM radio and IR yet.

    • Istvanv,

      I’m confused how on you managed to use the xc4000 without the firmware. It shouldn’t be working at all. And what “older patch” are you referring to?


  11. Well, probably I was just lucky that the firmware loaded by the Windows driver still worked under Linux after a reboot. I tried this trick because I already read earlier that it is possible to use this card under Linux to a limited extent by booting in Windows first, selecting a channel, and then booting Linux. So, I assumed that most of the state of the tuner is not lost on a reboot. I did need to comment out the resetting of the tuner chip by GPIOs, because otherwise it did indeed not work at all as you suggested.
    It would however be interesting to try the driver with an actual firmware file, but I did not have one, and did not know how to extract it.
    The old patch file I mentioned is the one posted by Mirek Slugeň on 28 Nov 2008, and can be found here: http://www.spinics.net/lists/linux-dvb/msg30504.html. I merged the changes related to DTV 2000H+ into the pctv-340e-2-ca8ab021fd47 sources, replacing references to the XC3028 with XC4000.

    • Ah, ok. Well indeed if you do not strobe the reset, it’s not surprising that the firmware would stay loaded. I’m pretty shocked that channel changing worked though, since I had spent almost no time debugging the analog part of the tuner.

      Did you add code to do an xc4000_attach()? What demodulator does your product have?


      • I did not implement a version of attach_xc3028() for the XC4000 in cx88-dvb.c, since I could only test analogue TV and FM radio (the latter does not seem to work yet).

        The DVB demodulator is a WJCE6353.

    • Hello Jerzy,

      The analog support will not be forthcoming in the near future. The initial release will be for digital only, because the dvb-usb framework does not have any analog support.


  12. Is there any progress on PCTV 340e? I could help with test system, but I do not have another DVB-T card working under Linux. If you can do something w/o second card (can I collect something from Windows system), I am willing to help.

  13. Hi Devin,

    Thanks for posting the picture of the DVB-T generator. I had no idea such a thing existed. Also thanks very much for all your work on the driver. I have a Leadtek DTV2000H+ at home that uses the xc4000 chip that I am itching to install in my ubuntu system once a driver is available.



  14. Hi! Is the firmware file “xc4000-02.fw” needed by xc4000.c available ? As mentioned earlier, I was able to get analogue TV working with this driver, but I had to load the firmware in Windows first. I would like to test it with firmware loading (I see selecting the standard needs to be written first, though), and try FM radio as well (which is apparently not written yet either, but would only need firmware loading and the frequency is in different units ?).
    Also, is the code in the “pctv-340e-2” repository up to date ?

    • I guess putting the sentence “[DO NOT USE]” into the description for the repository wasn’t enough to stop people.

      With the arrival of my new DVB-T generator (finally), I am hoping to get the 340e driver wrapped up in the next few days (at which point I will release a firmware image that can be used). Note that due to the lack of analog support in the dvb-usb framework, only digital will be supported (no analog video or FM).


        • Well, at the time I was strongly concerned about how misprogramming the device could damage your hardware. However, if you look at the current blog, I’ve actually released the code. I haven’t done any analog work though since my xc4000 based devices cannot do analog, so feel free to submit patches if you have any issues.

      • Sorry for the incomplete message above. I have now got PAL TV and FM radio on a Leadtek WinFast DTV2000H+ without any initialization in Windows first; it still needs some fixing, but it basically works. Since the released firmware file only included support for DVB, I had to extract the missing analogue code from the Windows driver, and create a new firmware.

        • I believe I did include the analog support in the firmware blob, although the driver may not be reading it properly and loading it into the device.

          Everything should be there, but the driver just needs to be debugged to get the analog working.


          • No, the released firmware indeed only includes DTV7, DTV78, and DTV8. In the modified version, I added 9 more standard specific firmwares (one digital, 7 analogue TV, and one FM radio), as well as 6 SCODE tables.

            In xc4000.c, I made some changes so that the firmware is also selected and loaded in the analogue modes, and the frequency is calculated correctly for FM radio. Additionally, the Windows driver sets some registers that the Linux driver previously did not – adding these fixed some picture quality issues.

          • Well let me take a look at the code I wrote to compile the firmware. It’s possible I just missed the entires (and will add them and spin a new image).

            If you send me a patch with your current set of proposed changes against xc4000.c, I will review/comment.



          • Here is a patch against v4l-dvb-75c97b2d1a2a with my current changes to get the DTV 2000H Plus working on Linux:
            http://linuxtv.org/hg/v4l-dvb/archive/75c97b2d1a2a.tar.bz2 (original V4L code)
            http://www.sharemation.com/IstvanV/v4l/xc4000.patch (patch for xc4000.c only)
            It adds the modified XC4000 driver, and also CX88 changes based on Mirek Slugen’s patch (http://www.spinics.net/lists/linux-dvb/msg30504.html). Some of the XC4000 changes were based on the Leadtek Windows driver and may not actually be needed or useful, especially with other cards.
            I could not test if the DVB-T mode works, although there is code for it.
            In the analogue modes, one problem I know of is that stereo audio is not automatically detected/set; this issue was also present when using firmware loaded in Windows and then rebooting to Linux.
            The following firmware was extracted from the Leadtek Windows driver:
            As far as I can tell, the driver only used those parts of the firmware that are included in this file, even though the original .sys file has more that are apparently not referenced. The SCODE loaded for digital TV is different from what is in dvb-fe-xc4000-1.4.1.fw.

          • I’ll try to look at what you sent this weekend, and figure out what actually needs to be merged. All of the scodes should already be in the firmware image, although I believe there might be some problems with the way the xc4000 driver code was attempting to read them.


  15. The current dvb-fe-xc4000-1.4.1.fw file actually includes only one type of SCODE, although it is repeated 46 times with different IF frequency values in the header (the data is always the same).
    By the way, in the above patches, the if_khz value in attach_xc4000 (cx88-dvb.c) is probably wrong. With my firmware image (which needs to be renamed to dvb-fe-xc4000-1.4.1.fw for use), the correct SCODE is still found, however, for a later complete “official” firmware it will need to be fixed.

    • IstvanV,

      Good catch. A second look revealed that I had a bug in the code that generated the firmware that was always inserting the same s-code table (I added it during debugging and forgot to remove it). I will fix the code and spin a new firmware that has correct images.


  16. Hello,
    I found this page after trying to get a Pinnacle PC340e stick running under Fedora 12. I have progressed as far as compiling v4l-dvb and getting the firmware loaded.
    “dvb-usb: Pinnacle PCTV 340e HD Pro USB Stick successfully initialized and connected.”
    I had to do a custom compile of the drivers, and had to make the following changes:
    .nodename has become .devnode (dabusb.c, dvb-core/dvbdev.c)
    The following files need linux/sched.h added due to missing structures and defines:
    dmxdev.c dvb_demux.c, dvbdev.c dvb_net.c radio-cadet.c dabusb.c meye.c videobuf-core.c)
    I’m still trying to figure out why /dev/video and /dev/video0 are not being created.


    • Hello Michael,

      There is no /dev/video0 device because the current 340e driver does not have any analog support. The current driver support is for DVB only (due to limitations in the dvb-usb driver framework).

      You should however be seeing the /dev/dvb/adapter0/frontend0 device assuming the driver loaded properly.


      • The DVB works perfectly and is detected by kaffeine, mythtv and linuxtv.
        I’m getting a message from kaffeine:
        kaffeine(19493) DvbDevice::frontendEvent: tuning failed, dmesg returns:
        xc4000 bandwidth 7MHz not supported.
        Tuning signal quality is never more than 56%, so I might need a bigger antennae.

Leave a Reply