June 3, 2016 - Mauro Carvalho Chehab

Watching Digital TV Via Kaffeine

Kaffeine is a media player application that uses the KDE libraries. As part of my work maintaining the Linux Kernel media subsystem I needed some tools to test whether or not the digital TV core support works properly and to test Linux drivers for new devices. So, I’ve recently been working to improve Kaffeine to offer the necessary features for such tests. As part of this, I recently created a major Kaffeine version (2.0) that uses the latest version of KF5 (KDE Frameworks 5), and to use Qt5 library. I also started helping with upstream Kaffeine maintenance.

UPDATE: Added instructions for Arch Linux

About Kaffeine

Kaffeine now supports KDE 5 and Qt5

How to Install Kaffeine

Installing Kaffeine is easy.

If you run openSUSE Tumbleweed, you can find an up-to-date package with the latest state of development tree in the KDE:Unstable:Extra repository. So, to use the newest version of Kaffeine, all you need to do is to run:

On Gentoo, installing Kaffeine 2.0.1 is as simple as:

On Arch Linux, installing Kaffeine version 2.0.x is as simple as:

On other distributions the best method is to use git to retrieve the last version:

A number of packages are needed to build it; the README file contains instructions for both Debian and Fedora:

On Debian (and Ubuntu), you should run the following as root:

On Fedora, you should run the following as root:

Then, run cmake:

If some packages are missing, cmake will complain. Otherwise, you can build it with make:

If you want translations too, you should run:

Finally, Kaffeine is installed by running the following as root:

Kaffeine Player Basic Functionality

Like many other media players, Kaffeine supports a wide range of video and audio formats as well as playing audio and video from DVD and CD. Additionally, it supports live Digital TV playback if your machine has a Digital Video Broadcast (DVB) device plugged into it. Once Kaffeine starts, it presents a screen with the main functions in the middle, and it’s possible to switch to other functions via either the pop up menu or the lateral menu:

Kaffeine initial menu

Playing a video or audio file is as simple as clicking on the Play File button. It will ask you to select the file to be played, and wil begin playing it. Since Kaffeine uses LibVLC for the backend it supports all the same file formats as VLC. It also supports opening a list of files to create and manage playlists.

Kaffeine playing a file

Worldwide video standards and Linux Kernel support

I want to take a moment to describe how media software and hardware play digital audio/video streams. There are quite a few variations of video standards around the world. Building software to support most of these standards is a very tough challenge. For example, there are 4 Digital TV standards for terrestrial (air) broadcast worldwide:

  • ATSC – used mainly in Mexico, USA, Canada and South Korea
  • ISDB-T – used mainly in Japan, South America, Central America and some countries in Asia and Africa
  • DVB-T – used mainly in Europe, Asia and Oceania. There’s a second generation of this standard called DVB-T2
  • DTMB – used in China

These are shown in the following image:

Digital TV standards

Source: https://en.wikipedia.org/wiki/ISDB#/media/File:Digital_broadcast_standards.svg

Additionally, there are two public standards used for digital TV via satellite:

  • DVB-S – used in most countries. There’s a second generation of this standard, called DVB-S2
  • ISDB-S – used in Japan

Finally, there are two public standards for Cable TV:

  • DVB-C – used in most countries (also known as ITU-T J.83 Annex A and Annex C). There’s a second generation of the standard, called DVB-C2, but it is not widely used yet
  • clearQAM – used mainly in Mexico, USA, Canada and South Korea (also known as ITU-T J.83 Annex B)

Before 2008, the Linux Kernel only supported ATSC and the first generations of the DVB standards. In 2008 – with the addition of the DVB API version 5 – support for other standards was gradually introduced starting with DVB-S2. Yet, most Linux applications still don’t use the Linux DVB version 5 API, or use it only for DVB-S2.

Digital TV hardware

As shown in my previous article on Media Controller Support for Digital Video Broadcasting, a digital TV device has several internal components:

Media device block diagram

Media device block diagram

The digital TV frontend is the piece of hardware that is dependent on the standards; it’s responsible for tuning into a TV channel and outputting a MPEG transport stream data for the digital TV decoder. When the Linux APIs were conceived, frontends were bound to one specific digital TV standard. However, on modern hardware the same frontend can work with multiple digital TV standards. There are hardware devices available in the market that can even support all digital TV standards in a single component. Such devices require the use of the Linux DVB API version 5 in order to be capable of dynamically changing the supported TV standard on the frontend in real time.

Kaffeine as a Graphical User Interface for Digital TV

While the basic functionality is useful enough for someone who wants a simple, yet powerful media player, the best feature in Kaffeine is to use it as a GUI frontend to watch and record digital TV. Kaffeine version 1.2 and 1.3 were limited to ATSC, clearQAM, DVB-T and DVB-S and DVB-S2. Yet, it doesn’t support some modern hardware that have a single silicon chip which is capable of supporting multiple standards.

In Kaffeine version 2.0 the digital TV support was extended to support DVB-T2 and ISDB-T. Since it now uses libdvbv5, extending support for other digital TV standards is simple. Also, since it uses the Linux DVB version 5 API, it supports frontends capable of implementing multiple TVs at once.

Setting the TV configuration on Kaffeine is as simple as clicking on the Television pop up menu, and selecting the Configure Television option. A pop up window will open that requests the parameters to be used:

Kaffeine TV configuration

The Device menus have the per-device setup. Usually selecting the country and the city in the Source combo box (or using one of the Autoscan sources) is enough for non-satellite configurations. The same happens for devices that support multiple TV standards:


After clicking on the Ok button, the next step is to scan for the digital channels, using the Television pop up menu, option Channels:


If more then one standard is supported, the Source combo box will allow you to select the one that will be used to scan. Don’t forget to connect the device’s antenna cable to match the standard that will be used. Then, click Start Scan to start scanning for channels. Once finished, the discovered channels will appear on the left. These channels can be copied to the left side by clicking Add filtered. It is possible to check the tuning parameters for the channel in the left side by clicking on the Edit button. Some parameters are adjustable in the window that pops up.

Kaffeine channel settings

Once the channels are saved, watching TV is as simple as clicking on the Digital TV icon in the main window:

Kaffeine live view

Side note: the above window is using a different language one purpose to show that Kaffeine also has translations for 56 languages.

Kaffeine also allows you to click on the media-playback-pause button to pause it. When the button is clicked, Kaffeine will record the program and once the media-playback-start button is pressed it will start the program from the point it was paused. There is also a document-save button that allows you to quick record and save the program to disk.

Recording Programs in Kaffeine

Besides clicking on the record button( document-save) when the live view is opened, Kaffeine has other ways to record a program. One method is to select the program to be recorded using the Television pop up menu and selecting the Program Guide option. It will present a list of programs that were identified on a previously played program:

Electronic Program Guide

Clicking on the media-record (Record Show) button will mark the program to be recorded. The record needs to be enabled via the Recording Schedule option, also located in the Television menu:

Kaffeine Record Schedule

By clicking one the New button, it is also possible to directly define a time and duration for a program to be recorded.

Kaffeine offers many more options and this is only a sneak pick of the most used functions. We’ve made a great effort to port it to KDE 5 and fix several issues to make it ready for others to use. We hope you’ll enjoy our efforts! Have Fun!

Note: the icon images above are licensed as LGPL and are part of the Breeze icon set on KDE 5.

About Mauro Carvalho Chehab

Mauro is the upstream maintainer of the Linux kernel media and EDAC subsystems, and also a major contributor for the Reliability Availability and Serviceability (RAS) subsystems. Mauro also maintains Tizen on Yocto packages upstream. He works for the Samsung Open Source Group since 2013. Has worked during 5 years at the Red Hat RHEL Kernel team, having broad experience in telecommunications due to his work at some of the Brazilian largest wired and wireless carriers.

Development / Linux / Users c++11 / Digital TV / KDE / Linux / Linux TV / Multimidia /


  • […] la reproducción de TV digital. Os aconsejo leer la siguiente entrada de Mauro Carvalho Chehab “Watching Digital TV Via Kaffeine” para aprender mucho más acerca de los aspectos técnicos y prácticos de esta funcionalidad, como […]

  • Shalok Shalom says:

    Thanks a lot for this superb development

    KaOS offer this version of Kaffeine in the default repos:

    sudo pacman -S kaffeine

    install it

  • kanibalv says:


    How can I configure ISDB-T for Chile Channels, there is a way to import the channels.conf that is used in vlc?

  • Norman says:

    You made my day!

    Thank you, now I`m able to use my Astrometa DVB-C USB Stick with Linux Mint and Koffeine.

  • Tim O'Neil says:

    I purchased a USB HDStar V3 satellite box 2 years ago that has been worthless to me until Ubuntu 17.10 , Kaffeine 2.0 and v4l-updatelee all worked together to make it work perfectly on every channel. I even kept my ethernet this time. Great work! Thank you.

  • […] la reproducción de TV digital. Os aconsejo leer la siguiente entrada de Mauro Carvalho Chehab “Watching Digital TV Via Kaffeine” para aprender mucho más acerca de los aspectos técnicos y prácticos de esta funcionalidad, como […]

Leave a Reply to Kaffeine portado a Qt5/KF5 - KDE Blog Cancel reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Anti-Spam