DVB-T

DVB-T is a standard for transmitting terrestrial digital video broadcast, which is used in the majority of Africa, Asia, Australia and Europe. It is possible to receive DVB-T using several different hardware setups, however this article will focus on DVB-T USB dongles based on the RTL2832U chipset (which are also very popular as cheap software defined radios using RTL-SDR).

Contents

Driver

The main driver in use is dvb_usb_rtl28xxu, and exists in the latest kernels. If it is not loaded, do so manually:

# modprobe dvb_usb_rtl28xxu

You might also need to load rtl2832 or rtl2830:

# modprobe rtl2830
# modprobe rtl2832

Note: If you have RTL-SDR installed, note that it conflicts with this driver, and therefore blacklists it. Make sure to remove any necessary blacklists before loading the driver. The default location for the blacklist file is in /etc/modprobe.d/rtlsdr.conf.

Note: in this case we see that the dongle has a R820T tuner, but there are several other popular tuners that you might run into. Also note the IR sensor device that was recognized that, properly configured, can be used with the device remote control. See LIRC for more information.

Additionally, you should now see the adapter device under /dev/dvb/adapter0. Some cards need additional firmwares that are not distributed for various reasons. Usually you will find an explicit message about that in dmesg. Look for the name of the file(s) you see with your favorite search engine, and once you have them, put the required firmware(s) in /usr/lib/firmware. Possibly a package might exist in the AUR.

Clients

See also how to disable screensaver when playing video/TV by using configuration files or use xset command before and after player starts to enable/disable it. If you have installed xscreensaver then you will need to use xscreensaver-command instead of xset to activate/deactivate screensaver from command line.

VLC

The simplest way to watch DVB-T channels with VLC is to first generate a playlist:

$ w_scan -ft -c [country_code] -L > dvb.xspf
$ vlc dvb.xspf

You can also specify the frequency and programs by hand. This can be done using:

$ vlc dvb://frequency=543000000

where the frequency is set in Hz, and should match the base frequency for the transmissions in your area. You can also explicitly specify which demodulation you would like to use, so instead of dvb you can use dvb-t, dvb-t2, etc.

VLC also accepts various command line arguments, for example if you want to tune into a different program:

$ vlc dvb://frequency=543000000 :program=3

MPlayer / mpv

For DVB streaming, MPlayer (or mpv) requires a channels configuration file at ~/.mplayer/channels.conf. Follow #Scanning for instructions on how to generate it, but make sure to use the -M flag to generate the proper format for MPlayer, if you're using w_scan:

$ w_scan -ft -c [country_code] -M > ~/.mplayer/channels.conf

For mpv, use:

$ w_scan -ft -c [country_code] -M > ~/.config/mpv/channels.conf

Try the configuration with mplayer dvb://, which should start to play the first channel. If it does not, you might need to use -demuxer lavf or -demuxer mpegts in order to properly receive the stream.

If the configuration works, you can simply run:

$ mplayer dvb://"STREAM NAME"

with a valid STREAM NAME from the channels configuration file.

Note: MPlayer cannot handle and play channels from a command line that contains some of Linux special symbols like / in their names, but you can manually rename them by editing ~/.mplayer/channels.conf.

Channel selector

Here is a lstvAUR script that will show a numbered list of channels by reading data from a ~/.mplayer/channels.conf file. You will be able to watch a channel by using a number associated to it by the script instead of having to type the whole channel name on the command line, e.g. lstv 3. The channel number associated by the script equals to the line number with tuning configuration for it. The script disables display power saving and a screen saver before starting mplayer and enables both again after you close it to disable screensaver management in this script remove xset ...; before and after MPlayer.

If the list of channels is too long then you can use something like lstv | less and search for channels name by pressing / and writing its name. When found press q for exiting of less and use the channel associated number with lstvAUR.

Once tzap is encoding the stream, /dev/dvb/adapter0/dvr0 should be available to ffmpeg (or any other program).

A simple command to stream a program, without addditional encoding might look like so:

$ ffmpeg -f mpegts -i /dev/dvb/adapter0/dvr0 out.mp4

(Note: the above command will not generate output if the card requires to setup the frontend and/or the demuxer).

dvbjet

DVB cards receive several simultaneous programs multiplexed.
The command-line dvbjet standalone tool (has no dependencies)
tunes the TV card by selecting the frequency, as with a radio, and saves the full MPEG-TS stream.
To play or extract a separate program from it (with all its audio, video and subtitle tracks) its companion python script lists the programs and invokes ffmpeg.

Troubleshooting

If you bump into problems, try these tools to help debug:

dvbsnoopAUR is an advanced tool that can show all the necessary data regarding the bandwidth, signal, frontend, etc.