DTMB capture

Task

Solved January 2018: Develop the systems needed to capture DTMB television broadcasts.

Related links

DTMB

DTMB is a major standard for digital broadcast. It is used in China, Hong Kong, and Cuba and may be adopted in other nations.

The GB20600-2006 standard described may just specify the transport stream format and not the digital layer, which is what we can process in software.

For information on DTMB hardware, see

Joker TV

A new initiative is the Joker TV device and drivers, see linux-kernel message, with support for DTMB and several other standards.

    1. Joker TV (2017) -- github
  1. https://tv.jokersys.com/
    1. Installation video at https://tv.jokersys.com/manuals/
  2. https://jokersys.com/2017/07/06/joker-tv-linuxosxwindows-drivers-apps/
    1. https://jokersys.com/2017/12/21/joker-tv-raspberry-pi-3/

How to download and build the driver

    1. From https://jokersys.com/2017/12/21/joker-tv-raspberry-pi-3/:
    2. Compile driver and apps from sources on Linux
    3. Install dependencies first (example for Ubuntu/Debian/Raspbian Linux)
    4. sudo apt install git cmake build-essential automake autoconf libtool pkg-config libudev-dev libxml2-dev
    5. then compile drivers and apps:
      1. git clone -b master --single-branch https://github.com/aospan/libjokertv --depth 1
    6. (or git clone https://github.com/aospan/libjokertv)
    7. cd libjokertv
    8. mkdir build
    9. cd build
    10. cmake ../
    11. make
    12. Or download the precompiled version to /mnt/HD1/software/.
    13. Symlink the executables and the library:
        1. ln -sf /usr/lib/ to /mnt/HD1/software/joker_tv-1.6.4-Linux/bin/joker-tv /usr/local/bin/
        2. ln -sf /usr/lib/ to /mnt/HD1/software/joker_tv-1.6.4-Linux/bin/tscheck /usr/local/bin/
        3. ln -sf /usr/lib/ to /mnt/HD1/software/joker_tv-1.6.4-Linux/bin/tsgen /usr/local/bin/
        4. ln -sf /usr/lib/ to /mnt/HD1/software/joker_tv-1.6.4-Linux/bin/i2c-scan /usr/local/bin/
        5. ln -sf /mnt/HD1/software/joker_tv-1.6.4-Linux/lib/libjokertv.so.1.6.4 /usr/lib/ ; ldconfig

Use the software

    1. joker-tv is the main application to interact with your Joker TV device. This application can start tuning and save the resulting Transport Stream to an output file.
    1. Example screenshot with tuning to ATSC
    2. Here is some help from joker-tv app:
    3. # ./joker-tv -h
      1. joker-tv usage:
      2. -d delsys Delivery system. Options:
      3. 11-ATSC 5-DVB-S 1-DVB-C 3-DVB-T 16-DVB-T2 8-ISDB-T 13-DTMB
      4. -m modulation Modulation. Options:
      5. 7-VSB8 (for ATSC) 0-AUTO
      6. -f freq Frequency in Hz. Example: 1402000000
      7. -s symbol_rate Symbol rate. Options: 0-AUTO. Example: 20000000
      8. -b bandwidth Bandwidth in Hz. Example: 8000000
      9. -o filename Output TS filename. Default: out.ts
      10. -t Enable TS generator. Default: disabled
      11. -n Disable TS data processing. Default: enabled
      12. -u level Libusb verbose level (0 - less, 4 - more verbose). Default: 0
      13. -w filename Update firmware on flash. Default: none
    4. Tune to DVB-C on 150MHz with bandwidth 8MHz
      1. ./joker-tv -d 1 -f 150000000 -b 8000000
    5. Tune to ATSC on 575MHz with bandwidth 6MHz and modulation 8VSB
      1. ./joker-tv -d 11 -f 575000000 -b 6000000 -m 7
    6. Tune to DVB-T on 650MHz with bandwidth 8MHz
      1. ./joker-tv -d 3 -f 650000000 -b 8000000
    7. Tune to ISDB-T on 473MHz with bandwidth 6MHz
      1. ./joker-tv -d 8 -f 473000000 -b 6000000
    8. Tune to DTMB on 650MHz
      1. ./joker-tv -d 13 -f 650000000
    9. TS stream generator
    10. FPGA firmware has built-in TS stream generator. Generated TS has specially prepared content with predefined pattern, so we can check data correctness on the host’s side. To activate the TS generator use following command:
      1. ./joker-tv -t
    11. generated TS will be saved into ‘out.ts’ file. Check the TS stream correctness with following command:
      1. ./tscheck -f out.ts -p

More joker-tv tips:

      • There is console app 'joker-tv' comes with: https://github.com/aospan/libjokertv. No GUI or X server required !
      • joker-tv can capture full TS.
      • See libjokertv.so library ( https://github.com/aospan/libjokertv ) and console app. Can be used to record any stream or modified to specific requirements.
      • Lock instructions can be given to xml file:
        • ./build/joker-tv
        • --in in.xml XML file with lock instructions. Example: --in ./docs/atsc_north_america_freq.xml
        • --out out.csv output CSV file with lock results (BER, etc). Example: --out ant1-result.csv
      • Use the supplied xml files (in docs/ dir) or build your own.
      • Save TS file with '-o' option.
      • Limit (MB) with option '-l'.
      • Scheduling not yet implemented on joker-tv.

Linux support

DVEO provides a Linux SDK for their TVB593 DTMB capture card; for Red Hen Lab, a LAN-based tuner like HDHomeRun or a USB tuner would be preferable to a PCIe capture card.

Linux driver development

    1. CTTB driver patch (linux-media 2011, Mauro Carvalho Chehab)
    2. DTMB support for DVB API (linux-media 2012, Antti Palosaari)
    3. Better document DTMB time interleaving (linuxtv 2015, Mauro Carvalho Chehab)
            1. Submit bug reports for DTMB to linux-media@vger.kernel.org -- subscribe and archive

Linux Kernel developer Antti Palosaari <crope@iki.fi> has written some basic DTMB support into the Linux kernel, see blog entry. He also wrote a HDIC HD29L2 DTMB (aka CMMB or DMB-T/H) demodulator driver (hd29l2) for kernel 3.3, but notes there is no longer any public hardware for that driver.

For discussion (in Chinese) of Linux in Hong Kong and China, see

    1. HKEPC Forum (Hong Kong)

Android support

Several devices appear to be supported in Android:

Text extraction

CCextractor probably does not yet handle DTMB text extraction -- we don't have any samples yet to test.

The HKCA1108.pdf regulatory document from the Hong Kong government states that "Receivers shall include provisions to decode and display subtitles conforming to ETSI EN 300 743." This is the specification that regulates European subtitles over DVB. It's possible that DTMB regulates only the physical signal but has nothing to do with subtitles or video encoding.

Similarly this Test Procedure document from the Cuban government says "The TV Set is intended for the reception of DTMB Digital Terrestrial Television in 6MHz bandwidth, according to the specifications GB 20600-2006 and DVB subtitles (ETSI EN 300 743). The DUT must support DVB subtitles (ETSI EN 300 743)."

Next Steps

  1. Get some recordings of broadcast streams—not examples from the web, which do not include digital closed captions.
    1. Get the technical specifications documents on the DTMB standard that would be needed by CCextractor staff to add support for DTMB.