2014-09-21

Linux DVB-T2 tuning problems

Linux DVB-T2 tuning problems

Quite many people have reported some sort of DVB-T2 tuning problems, in case of PCTV tripleStick (292e). DVB-T2 is broadcasting standard and it is many times called as a HD, even though technically HD and DVB-T2 are a bit different thing. Many have noticed that old PCTV nanoStick T2 (290e) appears to tune DVB-T2 channels on same configuration, whilst tripleStick not. That is because cxd2820r demod driver behind the nanoStick T2 does automatic switching from DVB-T to DVB-T2 and vice versa when requested TV standard does not lock (tune fails). So if application tries to tune DVB-T2 channel using DVB-T request, driver first tunes using DVB-T standard, then detects it does not work, then driver makes another tuning attempt using DVB-T2 standard and finally it succeeds. Application could not even know it is actually using DVB-T2, unless it does not check it after the successful tuning.

I made cxd2820r driver over three years ago, and it went eventually Kernel 3.0 (released 21 July 2011). It was very first chip and driver supporting DVB-T2. Because of that I decided add this kind of hackish solution to driver, in order to provide easy transfer to new technology. However, I decided not to do same for si2168 driver as I simply want get a rid of such hacks. Three years time to update apps should be enough :)

I don't know very well which apps supports DVB-T2. I use VLC to watch TV and at least it supports, has been supported many years. Another very popular app which supports DVB-T2 is w_scan, starting from version 20140727. Also all dvbv5 tools from v4l-utils supports it. Newer the v4l-utils package the better support is - a lot of improvements done recently.

If you know DVB-T2 support status of some other app, please add a comment.

I took three scan examples. First two are w_scan examples, one is using old PCTV 290e and another is taken with newer 292e. w_scan verbose switch is enabled in order to show how w_scan detects wrongly tuned channels in case of cxd2820r driver. Last output is taken from dvbv5-scan.

I can receive 4 DVB-T and 5 DVB-T2 multiplexes. All relevant information could be seen following input file I used for dvbv5-scan on last example.

mux-Oulu-t-t2, input file for dvbv5-scan



PCTV 292e w_scan (si2168 driver)



PCTV 290e w_scan (cxd2820r driver)



PCTV 292e dvbv5-scan (si2168 driver)

22 comments:

  1. Hi Antii,

    Following up from last week, I suspect this is the issue I am facing. I have tried the device on Windows with same aerial source and it has no difficulty in tuning to DVB-T2 channels.

    On Linux, with latest w_scan, it finds both DVB-T and DVB-T2 multiplexes but when it searches for the channel, the DVB-T ones are found but reports no_signal when tuning to DVB-T2 multiplexes.

    I have also tried using channel configuration file generated from a 290e device - both tzap and dvbv5-scan fail to tune to DVB-T2 channels, though DVB-T channels work fine.

    Is there any chance to provide a patch for Si2168 driver which tries to tune to both DVB-T and DVB-T2 channels like you did for the cxd2820r driver? It looks like the the common DVB apps have not yet managed to cater for this situation.

    Thanks.

    ReplyDelete
    Replies
    1. w_scan works, but which app says no_signal?

      Old tzap will not work in any case for DVB-T2 as it sets TV standard always to DVB-T.

      dvbv5-scan should work as shown on blog post example. Install latest v4l-utils from Git if it does not work for some reason. Please note that you will need initial tuning file which contains correct "DELIVERY_SYSTEM = DVBT2". See example "mux-Oulu-t-t2, input file for dvbv5-scan"

      It is possible to make such hack to driver, but I will not do it as otherwise it will took next 3 years more and applications are not updated to DVB-T2.

      Delete
    2. Hi Antti,

      I have now managed to get the stick working. I used the git version of v4l as you suggested. With this version I was able to both locate the DVB-T2 muxes and tune to DVB-T2 channels with dvbv5-scan and dvbv5-zap.

      Thanks for you help.

      Delete
    3. I tried Fedora 20 version of dvbv5-scan and it crashed. So better to install latest v4l-utils from Git if some weird error is seen.

      Delete
  2. http://linuxtv.org/wiki/index.php/W_scan tells "DVB-T2 support requires a w_scan version >= 20120111" but I failed to scan channels by the tuner and current w_scan from http://wirbel.htpc-forum.de/w_scan/index2.html. Scanning DVB-T succeeded by a different tuner. I tested by Mythbuntu 14.10 (daily) that runs linux 3.16.

    ReplyDelete
    Replies
    1. Output of w_scan: http://paste.ubuntu.com/8544377/

      Delete
  3. The best solution of course is to use the _hardware's_ autodetection capabilities so neither the driver nor the software needs to try all the possible transmission standards.

    Unfortunately, much more demodulators are capable of autodetection than there are drivers which utilize that possibility. The CXD2820R can be programmed to check for DVB-T/T2 signals in parallel without host interaction, and would only need one register change to select the demodulator circuit to output the stream from, but that is not implemented in the driver.

    The STB0899 is another example, it is in fact capable of full DVB-S/S2 autodetection including stream output with no host interaction at all, but AFAIK that's not implemented either.

    ReplyDelete
  4. Hi Antti,
    I've been following your work on Panasonic MN488473 demodulator and have finally been able get my Astrometa dvb-t/t2 stick to scan channels with w-scan, it however only gives me 9 channels out of almost 15. However my main problem came when i had to introduce it to mythtv. It gives me this error "mythtv failed to open demux device /dev/dvb/adapter0/demux1: file not found". I lately realised the same threads with CXD2820R on 292e sticks all of which are commonly hybrids.
    I don't know if it can be possible that for this sticks, a demod driver with separate frontends can be made, thus solving problems for vlc and other media players

    Thanks for the good work, we really owe it all to you guys.

    ReplyDelete
  5. This is my syslog:

    Jan 3 09:56:59 Myth-Centre ntpd_intres[2663]: host name not found: 0.ubuntu.pool.ntp.org
    Jan 3 09:56:59 Myth-Centre ntpd_intres[2663]: host name not found: 1.ubuntu.pool.ntp.org
    Jan 3 09:56:59 Myth-Centre ntpd_intres[2663]: host name not found: 2.ubuntu.pool.ntp.org
    Jan 3 09:56:59 Myth-Centre ntpd_intres[2663]: host name not found: 3.ubuntu.pool.ntp.org
    Jan 3 09:56:59 Myth-Centre ntpd_intres[2663]: host name not found: ntp.ubuntu.com
    Jan 3 09:57:00 Myth-Centre mythbackend: message repeated 4 times: [ mythbackend[1896]: E DVBRead recorders/dvbstreamhandler.cpp:615 (Open) PIDInfo(/dev/dvb/adapter0/frontend1): Failed to open demux device /dev/dvb/adapter0/demux1 for filter on pid 0x0]
    Jan 3 09:57:31 Myth-Centre mythbackend: message repeated 28 times: [ mythbackend[1896]: E DVBRead recorders/dvbstreamhandler.cpp:615 (Open) PIDInfo(/dev/dvb/adapter0/frontend1): Failed to open demux device /dev/dvb/adapter0/demux1 for filter on pid 0x0]
    Jan 3 09:57:34 Myth-Centre mythbackend: message repeated 5 times: [ mythbackend[1896]: E DVBRead recorders/dvbstreamhandler.cpp:615 (Open) PIDInfo(/dev/dvb/adapter0/frontend1): Failed to open demux device /dev/dvb/adapter0/demux1 for filter on pid 0x0]
    Jan 3 09:58:04 Myth-Centre mythbackend: message repeated 28 times: [ mythbackend[1896]: E DVBRead recorders/dvbstreamhandler.cpp:615 (Open) PIDInfo(/dev/dvb/adapter0/frontend1): Failed to open demux device /dev/dvb/adapter0/demux1 for filter on pid 0x0]
    Jan 3 09:59:01 Myth-Centre ntpd_intres[2663]: host name not found: 0.ubuntu.pool.ntp.org
    Jan 3 09:59:01 Myth-Centre ntpd_intres[2663]: host name not found: 1.ubuntu.pool.ntp.org
    Jan 3 09:59:01 Myth-Centre ntpd_intres[2663]: host name not found: 2.ubuntu.pool.ntp.org
    Jan 3 09:59:01 Myth-Centre ntpd_intres[2663]: host name not found: 3.ubuntu.pool.ntp.org
    Jan 3 09:59:01 Myth-Centre ntpd_intres[2663]: host name not found: ntp.ubuntu.com



    I tried to create demux1 by making link to demux0 but didn't work.

    ReplyDelete
  6. Antti,
    I can understand the principal of expecting software developers to move with the times and add native support. However when all of the available software, which actually includes PVR functionality (DVBLogic, MythTv etc), haven't solved the issue in over 6 months it does seem like its actually doing harm to the prospects of TV on linux in the long term. Its also very frustrating for the end users trying to get this working. How much effort does it take for you to hack the driver versus every software developer to update their software?
    Do you know of any programmes which will do PVR and DVB-T2 for linux with 292e?

    ReplyDelete
    Replies
    1. I have to say I don't know very well PVR applications...

      Adding DVB-T/T2 switching logic to driver is rather simply, just few lines of code. There is also PLP ID parameter defined for DVB-T2 transmission and it is in use in Russia. Adding automatic DVB-T/T2 switching means it will still not work in Russia or any other country using PLP IDs.

      So I really hope application will update from old and legacy DVBv3 API to current DVBv5 API. It is DVBv5 API which supports all these new standards, DVBv3 supports only DVB-T/C/S (without hacks). Old DVBv3 API has been deprecated many many years ago and for more workarounds we add to kernel the less there is pressure to update applications to DVBv5 API.

      http://linuxtv.org/docs/libdvbv5/

      Delete
    2. The SI2168 features on-chip DVB-T/T2 autodetection. Write 0x02F0|bw instead of 0x0020|bw or 0x0070|bw to property 0x100A to enable it.

      Also, the CBER/BER/PER/FER counters return exponent and mantissa as the second and third bytes, i.e. they really return the RATE, not a counter. 0x00 0x01 means BER=1*10^0 (every bit is bad), e.g. 0x05 0x09 means BER=9*10^-5, i.e. 9 out of 10^5 bits were bad.

      Delete
    3. Thank you for the information. I will take a look and test those when I find out some time. Patches are also welcome!

      Delete
    4. P.S.: To find out which of DVB-T/T2 the demodulator found, send command 0x87. The third byte & 0x04 signals if the demodulator is locked and the fourth byte & 0x0F contains the system type (2=DVB-T, 3=DVB-C, 7=DVB-T2).

      Delete
    5. Laurence, check out tvheadend. Starting from 3.9 it has good support for DVBv5. Multiple frontends per adapter, no problem. Multiple broadcasting standards per adapter, no problem.

      Delete
  7. Hi !

    I have a TBS 6281 pcie card (dual tuner DVB-T/T2/C):
    saa716x, cxd2820r, si2157, si2168.

    It works like a charm using the available open source driver (saa716x) by ljalves (from https://github.com/ljalves/linux_media/wiki.
    That is, when using DVB-C and DVB-T.

    DVB-T2 does not work at all.
    At the most I've managed to get some spurious "Carrier" lines from dvbv5-scan (no "Sync" or "Lock").

    The proprietary driver from TBS does work using DVB-T2 (at least with 3.18 kernels).

    From ljalves I got the suggestion that there might be some problem with the si2157/si2168 drivers ?
    (Is perhaps some fw modification required when used in pcie/saa716x environment instead of usb ?)

    Tested on kernel 3.18, 3.19 and 4.0

    ReplyDelete
  8. Hello,

    I am interested in having my dvb-c cable received through the Silicon Labs Si2168-B40, PCTV tripleStick (292e.

    I notice that it was asking for the firmware dvb-demod-si2168-b40-01.fw and dvb-demod-si2168-02.fw and that the firmware available on the supplied CD was dvb-demod-si2168-01.fw.

    I found dvb-demod-si2168-b40-01.fw and dvb-demod-si2168-02.fw and copied them on lib/firmware. the result was:

    [103217.928771] si2168 1-0064: found a 'Silicon Labs Si2168-B40'
    [103217.937066] si2168 1-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
    [103218.142955] si2168 1-0064: firmware version: 4.0.11
    [103218.145610] si2157 2-0060: found a 'Silicon Labs Si2157-A30'
    [103218.194197] si2157 2-0060: firmware version: 3.0.5
    [103250.575843] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:00:24:c9:51:d1:90:08:00 SRC=192.168.1.1 DST=224.0.0.1 LEN=36 TOS=0x08 PREC=0x80 TTL=1 ID=0 DF PROTO=2

    then, firmwares installed and pctv recognized.

    Then, if I scan I get this result:

    ERROR: Sorry - i couldn't get any working frequency/transponder
    Nothing to scan!!

    I tried everything, I do not know what to do. Any advice?

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. Still no luck getting dvb-t2 to work on the RPi3 with the most recent Raspbian Jesse (September 2016).

    w_scan v20141122 built from source detects the dvb-t2 transponders but refuses to tune into them, claiming "no signal".

    Given the lack of searchable information about what combination of OS/hardware/software that supports the tripleStick I am ready to try other devices in the hope they work.

    In September of 2016, are there any DVB-T2 devices on the market that have working Linux driver support that is supported on an RPi3?

    ReplyDelete
  11. with kernel 4.4 and fw 4.0.11 for 292e I can get it to tune but without any audio.. any idea what's wrong?

    ReplyDelete
    Replies
    1. the old 290 works fine with VDR (ubuntu 14.04 based yaVDR 0.6), so I doubt the issue is there

      Delete
  12. The following workaround for PCTV 290e HD auto-tuning fail works for me (this is post Crystal Palace (UK) Mar 18 changes that also required a new wide-band aerial):

    Symptoms:
    Post Crystal Palace changes need to retune my MythTV to locate changed HD channels. However, MythTV auto-tune fails to pick them up. Neither does TVheadend nor w_scan. w-scan does find the MUX/transponder but not the channels within. When I insert the 290e into my Windows laptop (running TVCenter 6.4.9.1033) it finds the new HD channels automatically with a reported signal strength of > 80%. The issue is therefore not my aerial, too high or too low a signal but something software related on my arch linux arm box (4.4.47-1-ARCH armv5tel) common to the autoscan detection process in TvHeadend, MythTV and w_scan.

    Workaround:
    Autodetect of the HD channels is no longer working (it did before the recent Crystal Palace changes). However, manually adding the MUXs/transports to TVheadend/MythTV etc and specifying that they are QAM256 modulation and 8Mhz bandwidth (rather than leaving them both at Auto) does enable both TVheadend and MythTV to discover the channels on the MUX/transport.

    I don't know why auto-detect does not work nor why specifying the modulation and bandwidth manually solves my problem, but am happy to offer my setup as a reproducible testbed for any expert willing to investigate the matter further.

    ReplyDelete