How To Watch Digital TV (DVB-T, DVB-T2, DVB-C, FM, DAB) and Radio On A Computer/Laptop Running(Linux) With a USB TV Stick. (Using Kaffeine or VLC)

Macharia Muguku
8 min readApr 3, 2018

--

N/B:

  1. See instructions for Windows here
  2. Tested on Debian based Distros; Linux Mint and Ubuntu
  3. You can only watch FREE TO AIR channels using this method. In Kenya they include channels from Signet, ADN, Pang and Bamba providers.
  4. Excuse my black and white pictures, i had just changed my Linux theme.

Case in point: A globemax DVB-T2 Tv stick (see the naked hardware tear-down for the panasonic MN88472 here ) and the (hardware tear-down for the MN88473 demodulator version here). There are two variants of the stick with the following components:

Key components:
Realtek RTL2832P USB interface
Panasonic MN88472/MN88473 Demodulator (2013 and 2014 variants respectively)
Rafael Micro R828D Tuner

sample pictures:

Instructions for Linux OS (Tested on Debian based Distros; Linux Mint and Ubuntu):

  1. The first step would be to find out whether your USB TV STICK is actually supported. There’s no point to laboring in vain (pun not intended). To do so:
  • Open Terminal (ctrl+alt+T)
  • To see if the kernel supports the device out of the box, Type:
dmesg | tail| grep dvb

If you see something like: “registered new interface driver dvb_usb_…” and/or “…. successfully initiated” (my sample below) you can jump to step 3.

dmesg | tail| grep dvb
[11201.078264] usb 2-1.2: dvb_usb_v2: schedule remote query interval to 200 msecs
[11201.090886] usb 2-1.2:
dvb_usb_v2: 'Astrometa DVB-T2' successfully initialized and connected

However if you see something like: “did not find the firmware file” Its not supported as it is and you’ll need to download a separate firmware file and copy it to “lib/firmware” folder

2. If the device is not supported out of the box:

a) Go to your system logs (/var/log/syslog) and look for a message like: “did not find the firmware file” with the firmware filename printed afterwards in brackets (write the firmware filename down, since you’ll need to download it and copy to the firmware folder as explained above later).

  • If you don’t see the firmware name, Type:
lsusb
  • you’ll see something like:
lsusb
Bus 002 Device 005: ID 15f4:0131 HanfTek
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 007: ID 04f2:b15e Chicony Electronics Co., Ltd
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  • Note down the device ID and name. For example my Device above is a Hanftek with an id of “15f4:0131”.
  • Head over to linuxtv.org and search for the firmware’s name (as on log file) or Google the device name and ID followed by firmware (after “lsusb”). For example, “Hanftek 15f4:0131 firmware” and look for a download link. I would personally vouch form Antti palosaari. For example, the firmware and driver’s for the above device is at: http://palosaari.fi/linux/v4l-dvb/firmware/MN88472/02/ and http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/mn88472_dvbc respectively.
  • Install the driver and copy the firmware file to “lib/firmware” (the firmware file extension is .fw eg “firmware1.fw”) as root (“sudo nautilus” in Ubuntu and right click and select open as root for Linux mint cinnamon).
  • Restart your PC, reconnect the device and look again in the system log. you should now see something like:
kernel: [ 8208.101100] usb 2-1.2: new high-speed USB device number 6 using ehci-pci
kernel: [ 8208.221545] usb 2-1.2: New USB device found, idVendor=15f4, idProduct=0131
kernel: [ 8208.221551] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [ 8208.221554] usb 2-1.2: Product: dvbt2
kernel: [ 8208.221556] usb 2-1.2: Manufacturer: astrometadvbt2
kernel: [ 8208.221558] usb 2-1.2: SerialNumber: 0
kernel: [ 8208.228936] usb 2-1.2: dvb_usb_v2: found a 'Astrometa DVB-T2' in warm state
kernel: [ 8208.305653] usb 2-1.2: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
kernel: [ 8208.305675] DVB: registering new adapter (Astrometa DVB-T2)
kernel: [ 8208.332873] i2c i2c-10: Added multiplexed i2c bus 11
kernel: [ 8208.332877] rtl2832 10-0010: Realtek RTL2832 successfully attached
kernel: [ 8208.339641] mn88473 10-0018: Panasonic MN88473 successfully identified
kernel: [ 8208.339664] usb 2-1.2: DVB: registering adapter 0 frontend 0 (Realtek RTL2832 (DVB-T))...
kernel: [ 8208.339865] usb 2-1.2: DVB: registering adapter 0 frontend 1 (Panasonic MN88473)...
kernel: [ 8208.339993] r820t 11-003a: creating new instance
kernel: [ 8208.347143] r820t 11-003a: Rafael Micro r820t successfully identified
kernel: [ 8208.347152] r820t 11-003a: attaching existing instance
kernel: [ 8208.351993] r820t 11-003a: Rafael Micro r820t successfully identified
kernel: [ 8208.353720] rtl2832_sdr rtl2832_sdr.1.auto: Registered as swradio0
kernel: [ 8208.353724] rtl2832_sdr rtl2832_sdr.1.auto: Realtek RTL2832 SDR attached
kernel: [ 8208.353728] rtl2832_sdr rtl2832_sdr.1.auto: SDR API is still slightly experimental and functionality changes may follow
kernel: [ 8208.360516] Registered IR keymap rc-empty
kernel: [ 8208.360693] input: Astrometa DVB-T2 as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/rc/rc0/input26
kernel: [ 8208.360769] rc rc0: Astrometa DVB-T2 as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/rc/rc0
kernel: [ 8208.360878] rc rc0: lirc_dev: driver ir-lirc-codec (dvb_usb_rtl28xxu) registered at minor = 0
kernel: [ 8208.360880] usb 2-1.2: dvb_usb_v2: schedule remote query interval to 200 msecs
kernel: [ 8208.369018] usb 2-1.2: dvb_usb_v2: 'Astrometa DVB-T2' successfully initialized and connected
  • 3. The next step is to install the actual GUI app you’ll view with and the channel scanning applications. There are numerous GUI viewing applications on linux some of which include: Kaffeine, tvheadend, mplayer, vlc and xine. I would recommend Kaffeine as it comes with a relatively simple GUI and search mechanism.

Installing Kaffeine:

  • There’s a repository package but i found it to be outdated (to a time kaffeine did’t support DVB-T2). The surest method is to compile kaffeine from the github repository (https://github.com/KDE/kaffeine).
  • The instructions to compile the app are in the repo ReadMe file but i’ll walk you through.
  • You’ll need git installed first though.
  • To check whether git is installed type:
git
  • If it is installed you’ll see the help menu and if not type:
sudo apt-get install git
  • and follow the prompts.
  • Open your terminal and move to your Desktop directory
cd ~/Desktop
  • Then to Clone the repository to your desktop, navigate through your browser to the repository url “https://github.com/KDE/kaffeine” and under the repository name, click Clone or download. On the drop down menu click on the clipboard icon to copy the URL address of the repo. Open the terminal and type “sudo git clone and paste in the URL” like the following:
git clone https://github.com/KDE/kaffeine.git
  • You’ll now have a copy of the repo on your desktop.
  • Install the required tools and headers needed to run kaffeine with the following:
sudo apt-get install kdelibs5-dev libvlc-dev libxss-dev vlc \
libkf5coreaddons-dev libkf5i18n-dev libqt5x11extras5-dev \
libkf5windowsystem-dev \
libkf5solid-dev libkf5widgetsaddons-dev kio-dev \
qt5-default libdvbv5-dev \
cmake extra-cmake-modules make g++ gettext\
kdoctools-dev
  • When done, cd into the cloned directory with
cd kaffeine
  • Then make kaffeine with
$ cmake path/to/kaffeine options $ make
  • our path/to/kaffeine is the current directory so we need to make it with (.) as the path like shown below:
sudo cmake . & make
  • To install kaffeine do the following as root
make install
  • Install done and dusted.

Now to install the scanning utilities.

  • You’ll need scanning utilities to tune kaffeine to local frequencies for the app to work. There are a number of scan utilities like w_scan, scan, scan-s2,(dvb)scan, alexplore and dvbv5-scan. I’ve tried all of them and only Dvbv5-scan worked for me. The only downside is that it needs an initial scan file which can be generated with w_scan or downloaded from linuxtv.org or from my github page if you are in kenya .
  • install W_scan with
sudo apt-get install w-scan
  • install Dvbv5-scan and sample scan tables with
sudo apt-get install dvb-tools dtv-scan-tables
  • open the dtv-scan-tables folder, move to dvb-t and select the file with your country and city name. eg ours would be “ke-nairobi” or clone one from my github repository (recommended for Kenya) or generate an initial one with w_scan like
w_scan -ft -c KE -x > ~/initial_v3.conf
  • That will produce an initial scan file of V3 type which Dvbv5-scan no longer supports so you’ll have to convert it to V5 with
dvb-format-convert -I CHANNEL -O DVBV5 ~/initial_v3.conf ~/initial_data_v5.conf
  • Then now you can run dvbv5-scan with this new V5 file like
dvbv5-scan ~/initial_data_v5.conf
  • reconvert the v5 file to v3 which is the one compatible with kaffeine.
  • Open Kaffeine. Navigate to: Television — configure television — edit scan file.
  • Copy the contents of the generated v3 file and paste them in in the “scanfile.dvb” file in the respective country and city entry. For example under the “ke-nairobi” entry.
  • Navigate to “device 1” and “device 2” tabs and under the source and name folders put the name of your country-city entry eg Ke-Nairobi and terrestrial respectively.
  • Navigate to Television — channels tab. Under source choose terrestrial (T2) and click on start scan.
  • A number of channels should start showing on the right side. Wait for the scan to clock 100% and highlight all and click add selected. They should all be copied left.
  • Click OK and now you are brought to the viewing page. Click on a channel to watch it and enjoy watching free to air channels on your linux computer using a free to air DVB-T2 USB TV stick.

--

--