Manual
Manual
35∗,
User’s guide for version 4.35
1
Contents
1 Introduction 3
1.1 Related software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 The GUI 6
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Main widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 The correlation widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 The TII spectrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.5 The spectrum scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.6 The SNR widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.7 Technical details of the selected service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.8 Configuration widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.9 Extended content description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.10 Schedule list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11 Device widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.12 Colors and coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.13 Putting it all together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7 dabMini 34
7.1 Why a dabMini . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.2 The GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.3 dabMini on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.4 dabMini on x64 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.5 Building an executable on Linux and RPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8 Acknowledgements 36
2
1 Introduction
Qt-DAB is an advanced program for decoding terrestrial DAB (DAB+) transmissions. Qt-DAB, a
program with a GUI, is designed to run on both Linux (x64) computers, on RPI 2 and up running
Linux, and is cross compiled for Windows1 .
For Linux (x64) a so-called AppImage is available, a kind of container, an executable file that contains
- next to the executable program - the libraries needed to run.
For Windows, an installer is available that will install the executable together with the required
libraries.
These precompiled versions can be found in the releases section of the repository for Qt-DAB
(https://github.com/JvanKatwijk/qt-dab/releases).
For creating an executable on an RPI 2 or higher or any other Linux system, section 5 of this report
contains a pretty detailed description with scripts for Debian and Ubuntu.
Qt-DAB is implemented in C++, with extensive use of the Qt framework for its graphical ap-
pearance. Furthermore, it uses a number of existing open source libraries, such as fftw, libsndfile,
libsamplerate, libusb, and Qt-DAB is itself open source, available under the Gnu GPL V2.
The sourcetree for Qt-DAB contains - obviously - sources to generate an executable for Qt-DAB. It
actually contains subdirectories for three decoder versions (next to a number of shared subdirectories),
dab-maxi, dab-mini and dab-2.
• dab-maxi contains sources specific to the Qt-DAB program, the configuration files (i.e. a ”.pro”
file and a ”CMakeLists.txt” file) and the files needed for having an appImage created for Qt-DAB.
• dab-mini contains sources, with configuration files and with a description on how to create an
executable version with a minimal interface, i.e. dabMini.
• dab-2 contains sources for an experimental version, but is considered obsolete and not supported.
The dabMini version is described in section 7, that section also includes a description of how to build
an executable.
The structure of this guide is simple, in section 2 the GUI and GUI widgets for the Qt-DAB
program are discussed, in section 3 command line parameters and user provided settings in the ini file
(configuration settings) for the Qt-DAB program are discussed, in section 4 the supported devices and
their control widgets for the Qt-DAB program are briefly discussed.
In section 5, a description is given on how to configure and build an executable for Qt-DAB. First
the configuration parameters are briefly discussed, a description is given of which libraries have to be
installed on a Linux system, and what to do with either cmake or qmake.
In section 6 the device interface as used in Qt-DAB is discussed and an explanation is given how to
interface another device to the system configuration (note that the device interfaces for dabMini and
dab-2 are - slightly - different).
As said, in section 7, a brief description is given of the dabMini program, a decoder version built on
the same set of sources but with a minimal interface.
3
dab-cmdline is set up as a library, with a number of command line based example programs. The
command line in these examples is simple, a channel, a servicename and some gain settings are passed
as parameter, e.g.
dab-airspy -M 1 -B "BAND III" -C 12C -P "Radio 4" -G 80 -A default
Mode and Band are by default Mode 1 and Band III, see the README in https://github.com/JvanKatwijk/dab-
cmdline for details.
Example 2, the most common one, can be configured to provide support for any of RTLSDR based
sticks, SDRplay devices, HackRF and Lime devices, Adalm Pluto devices and file input.
terminal-DAB-xxx is a program to run a DAB decoder, without using a complex GUI and accom-
panying libraries as Qt. As can be seen on the picture in figure 1, available services are listed on the
command terminal (using the Curses library). Indicating a service in the list for selection is by using
the up or down keys. The next or previous channels can be selected using the plus resp. minus keys.
To keep things simple, support for the device is compiled in.
As configuration option, slides, passed as Program Associated Data (PAD), can be made visible in
a separate widget. See https://github.com/JvanKatwijk/terminal-DAB-xxx.
duoreceiver Since both the FM broadcast band as BAND III, where the DAB transmissions are, are
covered by common SDR hardware, it seems obvious to have a receiver covering both the FM and DAB
transmissions.
Duoreceiver is such a receiver, basically a combination of dabMini, and the FM software, see figure
2). Figure 2 shows instances of both the DAB selection and the FM selection in a single screen.
4
dab2fm-pluto is a program, written to exercise the transmission possibilities of the Adalm pluto
device. The program is a - more or less regular - DAB decoder, with as backend an FM modulator,
feeding the transmitter side of the Pluto. The command line takes a channel, a service name, some gain
setting parameters and a transmission frequency as parameter.
The decoder will transmit the audio of the selected service as stereo FM signal on the selected
frequency. The text of the dynamic label in the transmission of the selected service is added to the FM
signal as an RDS signal. See https://github.com/JvanKatwijk/dab2fm-pluto.
dabScanner and channelScanner are programs, developed for scanning the band. dabScanner
is a GUI driven program to continuously scan the band and record information on what is received
(https://github.com/JvanKatwijk/dab-scanner)2 .
channelScanner is the command line driven little brother to run a scan over a set of specified
channels. If a channel contains (detectable) DAB data, a record will be written with a description of
the contents of the ensemble, transmitted over that channel. Furthermore, the command line based
version has as command line option to dump the raw input of the channels containing DAB data onto
a file in the xml format (https://github.com/JvanKatwijk/channel-scanner).
DAB server controlled over the web A simple DAB server, to be controlled using an extremely
simple web interface, is yet another member of the Qt-DAB family. The web interface is shown in 3. It
merely contains controls to select a channel, a service and some device settings. Sources can be found
https://github.com/JvanKatwijk/webDAB.
Figure 3: Qt-DAB:webserver
2 Note that anything that can now be done with dabScanner can be done using Qt-DAB as well
5
2 The GUI
2.1 Introduction
Extensibility played a major role in the development of the GUI for Qt-DAB. Curiosity and a continu-
ously growing of the functionality lead to the curent design: a single (relatively) simple (main) widget
with other widgets that can be made visible when needed.
Visibility of the additional widgets is controlled by button on the main widget. Of course, the
number of buttons on the main widget is fairly large, while most of the time none of these buttons is
needed. The main widget therefore was equipped with an additional button to hide or show the button
panel as shown in figure 4.
• the combobox for the presets. A preset can be added to this list by clicking with the right mouse
button on the name of the selected service in the service list. Clicking with the left mouse button
on the entry in the preset list instructs the software to select the channel, wait until the services
of the channel are visible, and finally, select the service. Removing an element from the list is by
clicking with the right-hand mouse button on the entry in the preset list.
• a previous (−) and a next (+) service button. With these button one can easily scan through the
list of services.
3 closing this window will terminate the program execution
6
Figure 5: Qt-DAB, channel and service selection
• the combobox for channel selection. While (regular) DAB transmissions are in Band III, configu-
ration provides options to select channels in the L Band or channels in a user defined band. The
channel names are the elements in the combobox.
• a previous (−) and a next (+) channel button, making it easy to scan through the channels in the
selected band.
Note that the software will record the selected channel and service, on program termination these values
will be saved, and on program start up, these values will be taken as start value.
• when muting, the remaining muting time in seconds is displayed. If audio is not muted, the
number display is not shown. The picture shows that muting is off.
• the run time, the amount of time the program is running;
• the current time, this time is taken from the time encoding in the transmission. When playing a
recording, the time found in the recording is shown rather than the actual time of listening;
7
• the copyright symbol. Touching this with the cursor when the widget is in focus, will reveal (a.o)
the time and date the executable was built.
• the mute button, touching it will mute the audio output, for at most a time specified in the ”.ini”
file. The time - in minutes - can be set in the configuration widget. Touching the button while
muting, will unmute the audio output.
Below this line, there are boxes with labels:
• SNR, the measured signal/noise ratio. SNR is computed as the overall strength of the signal
compared to the strength during transmission of the NULL period of DAB frames;
• Frequency, the frequency, in MHz, of the selected channel;
• Offset, the frequency correction applied to the signal (in Hz). This offset is computed from the
samples in the time domain;
• CPU load, the overall CPU load, i.e. not only for running the program.
Below these - system related - pieces, there is a line with:
The remaining part is devoted to describing the name of the ensemble, displayed together with its
ID (a hex number), if it can be deduced, the name of the country the transmission is received from,
and (usuall) two number preceded by ”Est”. The numbers give an estimate of the so called TII codes,
Transmitter Identification Information. TII will be discussed later on. Below this line there is a line
with the name of the selected service, and the ”hide” button, and there is some room for the text of
the Dynamic Label.
Since Qt-DAB-4.3 a line is added - depending on the configuration - with - if found - the name of the
transmitter received, its distance to the receiver and the azimuth. Since the provider of the database
has requested not to reveal the source of the database, the code loading and interpreting the database
is only available as an non-open source library. The library is included in the precompiled versions
though.
The control buttons on the main widget contain for the various widgets, discussed in the following
subsections, a button to show or hide the widget. The function of a few other buttons are discussed
here.
8
Figure 8: Qt-DAB: schedule select
The reset button The reset button stops and starts the current channel.
The schedule button Touching the schedule button will show a list of services and actions from
which a selection can be made. The list is composed of the actions, the services in the current ensemble
and the services in the preset list, see figure 8. For the actions audiodump and framedump it holds that
switching to another service will stop the action. The dlText action is not bound to the current service.
After selecting the service a small time select widget will show where the time for the action can be
specified to up to a week ahead.
Audio channel select The combobox, labeled pipewire in figure 7, contains the audio channel names.
Of course the names of the audio channels depend on the system the program is running on.
Device selector The combobox, labeled sdrplay-v3 in figure 7, contains the names of the configured
devices. Note that changing the device while running the program is - at least in principle - possible.
list Inspired by my car radio, all services encountered are stored in a list, the history list. Selecting
an entry in the list (see figure 9 is possible. Of course, when using a laptop on different locations, or
with file input, not all entries are reachable.
Clicking with the right hand mouse button will erase all entries in the list.
Raw dump Dumping the input in 16 bits signed stereo PCM files is possible. Note that the file size
is large, it will increase with 8 Mbyte per second.
9
Figure 9: Qt-DAB: history list
The picture makes sense, the transmitter with the signal used is, from where I live, about 18 Km
away, the two signals arriving early come from transmitters with a distance of app 6 and 10 Km, and
the signal arriving late from a transmitter on about 35 km distance.
The spinbox at the bottom of the widget controls the length of the segment of the correlation result
that is made visible.
10
Figure 11: Qt-DAB: tii spectrum
The spectrum scope shows - as the name suggests - the spectrum of the incoming signal. Ideally,
such a spectrum looks like the one in figure 12, just an almost flat line. The black field at the right
hand side shows the (almost ideal) signal constellation of the decoded DAB signal. There are 4 dots, it
is easy to see that a dot in each quadrant corresponds to two bits (4 possibilities).
In reality the spectrum of the signal is usually more like that from figure 13.
The bottom line of the widget shows some quality indicators of the received signal. From left to
right:
• the degree to which the constellation matches the ideal constellation (10 is maximum);
• a clock offset, what is counted is the number of samples received and the difference - for 10
subsequent DAB frames - with nominal number of samples (20480000) is measured;
• the offset of the receiver clock in taking the samples;
• the error as detected in the clock of the AD converter;
11
Figure 13: Qt-DAB: spectrum scope
The SNR (Signal Noise Ratio) of the signal is continuously measured. The value is computed as the
difference - in dB - between the overall signal amplitude and the signal amplitude in the NULL period.
The widget shows the development of SNR over time. By default measurement is taken as an
average over two DAB frames, since only one of the two carries TII information in the NULL period.
The spinbox at the bottom allows choosing another value for averaging. The other spinbox, default set
to 312, is for setting the length of the X-axis.
A dump button is there for recording the values in a file (a small application exists for inspecting
such a file).
12
Figure 15: Qt-DAB: technical details
a single progress indicator is shown. The indicator rs corrections/100 is somewhat special, it indicates
the number of errors corrected by the Reed-Solomon module per 100 frames (per frame at most 5 byte
errors can be repaired).
13
Figure 16: Qt-DAB: configuration widget
• save service. When selected, the service, active on termination of the program will be saved and
selected when starting the program again;
• new tii detector. When selected another algorithm is used for decoding the TII data from the
spectrum of the NULL periods of DAB frames. The algorithm is slightly less conservative and
will give sooner results, with an increased risk of an erroneous result;
• close without asking. By default the software will ask for a confirmation when closing the program.
When selected, the confirmation step is skipped;
• logger. When selected a file selection widget wil ask for a filename for a file in which subsequently
some logging information is stored. The logger is experimental and - if per country transmitter
description files are installed - will tell a.o. the transmitter name, the coordinates and the distance
to the receiver. However, in this version transmitter description files are only available for a few
countries on request.
• utc selector. When selected the time on the scans and in the log file are UTC rather than local
time.
• load table. When pressed an attempt is made to renew (or load) the database with which the TII
data is mapped upon transmitters and distances. The button will be a no-op if the tii library is
not available.
• service order. One may choose here the order in which the services in an ensemble will be displayed.
• dlText button. The text appearing as dyamic label texts on the main widget may be saved in
a file. Touching the button will show a file selection menu, touching the button when texts are
saved will stop the process. The software maintains a small cache to avoid duplicates in this file
• coordinates. When touched a widget will appear on which one can give the coordinates (in decimal
notation) of the transmitter. The data is - obviously - used for computing distance and azimuth.
14
A fragment of the output of the dlText is given below
12C.NPO Radio 2 2022-01-10 14:47:00 Red Hot Chili Peppers - By The Way
12C.NPO Radio 2 2022-01-10 14:47:00 NPO Radio 2 - Gijs 2.4 - KRO-NCRV
12C.NPO Radio 2 2022-01-10 14:47:00 Tina Turner - Private Dancer
12C.NPO Radio 2 2022-01-10 14:51:00 Son Mieux - The Mustard Seed
12C.NPO Radio 4 2022-01-10 14:52:00 Charlie Haden - Ellen David
12C.NPO Soul & Jazz 2022-01-10 14:53:00 Alicia Keys - Teenage love affair
Sometimes one wants to see more of the services in the current ensemble. The content widget gives
some more details as can be seen in figure 17. In Qt-DAB 4.35 the format of the data is equal to the
format of the data when scanning, basically a ”.csv” content with 12 columns.
Of course, one might select a service by clicking with the left mouse button on the service name in
this extended overview.
Double clicking on any place in the widget will activate a file selection menu where one may choose
a filename for a dump of the content of the widget into a ”.csv” file.
15
Figure 18: Qt-DAB: schedule list
16
• the display color, for selecting the background color of the scope;
• the grid color, for selecting the color of the grid; and
• the curve color, for selecting the color of the line.
Setting a brush is possible by adding brush=1 in the appropriate section for the widget in the
”.ini” file. The color settings are kept in the ”.ini” file, in sections resp spectrumViewer, tiiViewer and
correlationViewer.
17
• ”-F XXX” specifies a frequency on KiloHerz, works when configured for receiving and transmitting
using an Adalm Pluto device;
18
• tii delay: While the default value for the number of DAB frames that will be skipped before
recomputing the TII value is 5 (basically to reduce the computational load), another value can be
chosen by setting ”tii delay=XXX”;
• font and font size: The default setting for the font resp fontsize for displaying the service names
in the service list is Times resp. 12. Since the choice of fonts is - as e.g. colors on the GUI -
personal, an option is created to set font and font size. Set
theFont=Canterell
fontSize=14
Figure 21: Qt-DAB: The two control widgets for the SDRplay
As figure 21 shows, the control widgets for the two different versions resemble each other, their
implementations differ considerably though. Both have spinboxes for setting the if gain reduction, the
lna state and a ppm offset.
An optimal value for the ppm offset is to be determined experimentally, the RSP II, as used here,
is happy with a ppm offset 0, the oscillator offset is almost zero in the region of Band III.
The spinbox for the if gain reduction is programmed to support the range of values between 20 and
59. The range of values for the lna state depends on the model of the RSP. The software will detect the
model and fill in the range accordingly.
19
If the agc is selected, the if gain reduction spinbox will be hidden, its value is then irrelevant.
The RSP II has two (actually 3) slots for connecting an antenna. If an RSP II is detected, a
combobox will be made visible for antenna selection.
A similar combobox exists for selecting a tuner in the widget for the 2.13 library controller. The
SDRplay duo has two tuners. If the software detects the duo, a combobox will be made visible for
selecting a tuner (note that this feature is not tested, I do not have a duo).
Finally, both versions of the control widget contain a dump button. If touched, the raw input from
the connected device will be stored in a so-called xml formatted file. First a menu is shown for selecting
a filename, a suggestion for the name of the file device name - date is given. Touching the button again
will stop dumping and the file will be closed.
If more than one connected device is detected, a widget appears on which a selection can be made
which device to use.
20
Figure 23: Qt-DAB: Widget for hackrf control
• the ppm correction spinbox can be set to correct the oscillator (on 227 MHz, the Qt-DAB software
reports an offset of somewhat over 3 KHz);
• the Dump push button when pushed, starts dumping the raw input in xml file format. Touching
the button again will halt the dumping and close the file.
On selecting the LimeSDR (if configured), a control widget for the LimeSDR is shown (figure 24).
The widget contains five controls:
• gain control, with predefined values;
• antennas, where Auto is usually the best choice;
• Dump, if touched, the raw input from the connected device will be written to a file in the so-called
xml format.
New is the inclusion of a filter. Note that the limeSDR reads samples with a bandwidth of 204KHz,
while the frequency distance between successive channels is 1712KHz. So, DX-ing in adjacent channels,
where e.g. the first channel contains a strong DAB signal and the next one a weak, is difficult.
Therefore the control widget for the limeSDR has two additional controls,
21
• switching a software FIR filter on-off (the checkbox labeled filter),
• setting the size of the FIR filter (the spinbox below the checkbox).
Note that using the filter is not free, for a filter with a size of N, N * 2048000 complex additions and
multiplications are performed. While on a modern PC that is not an issue, it certainly is on ARM
based micros like the RPI 2.
New is the inclusion of a filter. Note that the DABstick reads samples with a bandwidth of 2048 KHz for
a signal with a bandwidth of app 1.536 MHz, while the frequency distance between successive channels
is 1712KHz. So, DX-ing in adjacent channels, where e.g. the first channel contains a strong DAB signal
and the next one a weak, is difficult.
The controller therefore contains an optional FIR filter, for which the rtlsdr control widget has two
additional controls:
22
• setting the size of the FIR filter (the spinbox below the checkbox).
Note that switching the filter on is not free, for a filter with a size of N, N * 2048000 complex additions
and multiplications per second are performed. While on a modern PC that is not an issue, it certainly
is on ARM based micros like the RPI 2.
If more than one connected RTLSDR based device is detected, a widget appears on which the device
of choice can be selected.
easy to handle
23
Figure 27: Qt-DAB: Widget for soapy
• raw 8 bit files as generated by e.g. Osmocom software (usually files with an extension ”.raw” or
”.iq”);
• PCM (i.e. ”.wav”) files, provided the data is 2 channels and with a samplerate of 2048000,
generated by Qt-DAB and with an extension ”.sdr”;
• xml files. The xml file format was defined by Clemens Schmidt (author of QIRX) and me and aims
at saving files in the original format, so to allow easy exchange between different DAB decoder
implementations. In order to support proper decoding of the contents, the data in the file is
preceded by a detailed description in xml, hence the name xml file format.
When selecting file input ”.raw” or ”.wav”, a simple widget is shown (figure 28), with as indication
the number of seconds the file is being played.
Since processing an xml file implies some interpretation, the widget (figure 29) for control when
reading an xml file is slightly more complex. It contains - next to the progress in reading the data - a
description of the contents of the file. So, the program that generated the file as well as the device used
in that program are displayed, the number of bits of the samples, as well as the number of elements is
displayed as is the samplerate of recording and the frequency of the recording.
Touching the cont button will instruct the software to restart reading at the beginning of the segment
in the file after reaching the end.
24
Figure 29: Qt-DAB: Widget for xml file input
While for tracing and debugging purposes it might be handy to see all the (text) output generated
during execution, for normal use it is not. Including or excluding console in the configuration determines
whether or not a console is present when executing.
25
5.2.3 Configurable common devices
Configuring devices is simple, for devices as mentioned above as well as for rtl tcp the qt-dab.pro file
and the CMakeLists.txt contain a description. File input (all versions, i.e. raw files, sdr files and xml
files) is by default configured in Qt-DAB executables, changing this is possible, but implies changes to
the sources.
Using the qt-dab.pro file For configuring devices in the qt-dab.pro file, comment out or uncomment
the line with the devicename.
CONFIG += airspy
CONFIG += dabstick
CONFIG += sdrplay-v2
CONFIG += sdrplay-v3
CONFIG += lime
CONFIG += hackrf
CONFIG += pluto
CONFIG += soapy
CONFIG += rtl_tcp
Note that for soapy, and for limeSDR there is no support in generating a windows executable, due
to the absence of a suitable dll. Furthermore, for Windows select ”pluto-2” rather than pluto.
Using the CMakeLists.txt file The CMakeLists.txt file contains support for AIRspy, SDRplay,
SDRplay V3, RTLSDR, Hackrf, pluto and LimeSDR. Including a device in the configuration is by
adding ”-DXXX=ON” to the command line, where XXX stands for the device name.
Selecting tiiLib will select program items such that a tiiLib, if available of course, will be loaded and
interpreted. If no such library is available, Qt-DAB will function as if notables is configured.
Selecting preCompiled will require sources that are not part of the source tree, but are available
upon request under a non-disclosure license (contact the author).
Installing the tiiLib The tiiLibrary is - for Linux-x64 and for RPI - available in the source tree.
The library should be placed in e.g. /usr/local/lib. Note that the library itself depends on curl, so the
curl library should have been installed as well.
Using cmake In the CMakeLists.txt file, by default the ”tiiLib” configuration is chosen.
26
CONFIG += PC
#CONFIG += RPI
#CONFIG += NO_SSE
Selecting ”CONFIG += PC” selects SSE instructions, and deselects threading of backends - after
all, a standard PC has more than sufficient power to run the decoding in a single thread.
Selecting ”CONFIG += RPI” selects options suitable for having the software run on an RPI.
However, the precise content depends on the processor architecture and the compiler chain.
Selecting ”CONFIG += NO SSE” is for e.g. Mingw cross compiler for Windows.
When using cmake, pass ”-DVITERBI SSE=ON” as command line parameter for PC’s.
• The default setting is to use portaudio to send the PCM samples to a selected channel of the
soundcard.
The Linux configuration for the Qt-DAB program offers in the qt-dab.pro file the possibility of config-
uring the audio output:
#if you want to listen remote, uncomment
#CONFIG += tcp-streamer # use for remote listening
#otherwise, if you want to use the default qt way of sound out
#CONFIG += qt-audio
#comment both out if you just want to use the "normal" way
If cmake is used, pass ”-DTCP STREAMER=ON” as parameter for configuring the software for
remote listening, use ”-DQT AUDIO=ON” for qt audio, or do not specify anything for using portaudio
in the configuration.
Note that the configuration for Windows is only for ”portaudio”.
In cmake the parameter ”-DDATA STREAMER=ON” can be passed to include handling TPEG as
described in Qt-DAB.
Note that - if not specified in the ini file - defaults are used for ip address and port.
27
5.2.9 Selecting an AAC decoder
By default the faad library is used to decode AAC and generate the resulting PCM samples.
The source tree contains - in the directory specials, the sources for the libfaad-2.8 version. It is quite
simple to create and install an appropriate library if the Linux version supports a faad liubrary that is
somehow incompatible.
An alternative is to use the fdk-aac library to decode AAC (contrary to the libfaad the fdk-aac
library is able to handle newer versions of the AAC format, these newer versions are not used in DAB
(DAB+)).
Selecting the library for the configuration is by commenting out or uncommenting the appropriate
line in the file qt-dab.pro (of course, precisely one of the two should be uncommented).
CONFIG += faad
#CONFIG += fdk-aac
It is recommended to use
CONFIG += PC
in the qt-dab.pro file, when targeting towards a standard x64 based PC running Linux, using this
will set the SSE and the threading.
It is recommended to use
CONFIG += RPI
in the qt-dab.pro file when targeting for an RPI, the threading will be set and the NO SSE option
is set.
28
5.3 Preparing the build: installing libraries
5.3.1 Installing the libraries
Prior to compiling, some libraries have to be available. For Debian based systems (e.g. Ubuntu for PC
and Buster for the RPI) one can load all required libraries with the script given below.
sudo apt-get update
sudo apt-get install git cmake
sudo apt-get install qt5-qmake build-essential g++
sudo apt-get install pkg-config
sudo apt-get install libsndfile1-dev qt5-default
sudo apt-get install libfftw3-dev portaudio19-dev
sudo apt-get install zlib1g-dev rtl-sdr
sudo apt-get install libusb-1.0-0-dev mesa-common-dev
sudo apt-get install libgl1-mesa-dev libqt5opengl5-dev
sudo apt-get install libsamplerate0-dev libqwt-qt5-dev
sudo apt-get install qtbase5-dev
Note that on newer versions of Ubuntu, this list might change, especially w.r.t. Qt5 libraries..
If libfaad is the selected aac decoder, install
sudo apt-get install libfaad-dev
The command will create a directory qt-dab with subdirectories for dab-mini, dab-maxi and the
unsupported dab-2.
and - to allow access for orinary users over the USB - ensure that the user name is member of the
pugdev group, and create a file ”53-adi-plutosdr-usb.rules” is in the ”/etc/udev/rules” directory.
#allow "plugdev" group read/write access to ADI PlutoSDR devices
# DFU Device
SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b674",
MODE="0664", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2fa2", ATTRS{idProduct}=="5a32",
MODE="0664", GROUP="plugdev"
# SDR Device
SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b673",
MODE="0664", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2fa2", ATTRS{idProduct}=="5a02",
MODE="0664", GROUP="plugdev"
# tell the ModemManager (part of the NetworkManager suite) that
# the device is not a modem,
# and don’t send AT commands to it
SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b673",
ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2fa2", ATTRS{idProduct}=="5a02",
ENV{ID_MM_DEVICE_IGNORE}="1"
29
5.3.4 Installing support for the RTLSDR stick
It is advised - when using an RT2832 based ”dab” stick - to create the library for supporting the device
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
make
sudo make install
sudo ldconfig
cd ..
rm -rf build
cd ..
with as content
/usr/local/lib
30
5.4 Finally: building an executable
5.4.1 Using cmake to build the executable
After installing the required libraries, and after editing the configuration (if required), compiling the
sources and generating an executable is simple.
Using cmake, creating an executable with as devices the SDRplay, the AIRspy, and the RTLSDR
based dabsticks, the following script can be used:
cd qt-dab/dab-maxi
mkdir build
cd build
cmake .. -DSDRPLAY=ON -DPLUTO=ON -DAIRSPY=ON -DRTLSDR=ON ... -DRTL_TCP=ON
make
By default in Linux the executable is placed in the ./linux-bin director in the qt-dab directory.
is all that is needed, i.e. unselect regular pluto and select pluto-rxtx.
When configured, and when the device pluto-rxtx is selected, the audio of the selected service,
augmented with the text of the dynamic label encoded as RDS signal.
Transmission frequency is set default to 110 MHz, but can be set as command line parameter using
the ”-F XXX” flag, where XXX stands for the frequency expressed in KHz.
Note that this only applies to configuring for Linux and using qt-dab.pro with qmake for configuring
31
6.1 The Qt-DAB device interface
The Qt-DAB software provides a simple, well-defined interface to ease interfacing a different device.
The interface is defined as a class, where the actual device handler inherit from.
class deviceHandler {
public:
deviceHandler ();
virtual ~deviceHandler ();
virtual bool restartReader (int32_t);
virtual void stopReader ();
virtual int32_t getVFOFrequency ();
virtual int32_t getSamples (std::complex<float> *, int32_t);
virtual int32_t Samples ();
virtual void resetBuffer ();
virtual int16_t bitDepth ();
virtual void show ();
virtual void hide ();
virtual bool isHidden ();
virtual QString deviceName ();
private:
int32_t lastFrequency;
};
A device handler for a - yet unknown - device should implement this interface. A description of the
interface elements follows
• restartReader is supposed to start or restart the generation of samples from the device. Note
that while not specified explicitly the assumed samplerate is 2048000, with the samples filtered
with a bandwidth of 1536000 Hz. The parameter - in Hz - indicates the frequency to be selected.
restartReader when already running should have no effect.
• stopReader will do the opposite of restartReader, collecting samples will stop; stopReader when
not running should have no effect.
• getVFOFrequency returns the current oscillator frequency in Hz;
• getSamples is the interface to the samples. The function should provide a given amount of samples,
the return value is, however, the number of samples actually read.
• Samples tells the amount of samples available for reading. If the Qt-DAB software needs samples,
the function Samples is continuously called (with the delay between the calls) until the required
amount is available, after which getSamples is called.
• resetBuffer will clear all buffers. The function is called on a change of channel.
• bitDepth tells the number of bits of the samples. The value is used to scale the Y axis in the
various scopes and to scale the input values when dumping the input.
• deviceName returns a name for the device. This function is used in the definition of a proposed
filename for dumps.
• The GUI contains a button to hide (or show) the control widget for the device. The implemen-
tation of the control for the device will implement - provided the control has a widget - functions
to show and to hide the widget, and isHidden, to tell the status (visible or not).
32
Modification to the qt-dab.pro file Driver software for a new device, here called newDevice, should
implement a class newDevice, derived from the class deviceHandler.
It is assumed that the header is in a file new-device.h, the implementation in a file new-device.cpp,
both stored in a directory new-device.
A name of the new device e.g. newDevice will be added to the list of devices, i.e.
CONFIG += AIRSPY
...
CONFIG += newDevice
Next, somewhere in the qt-dab.pro file a section describing XXX should be added, with as label the
same name as used in the added line with CONFIG.
newDevice {
DEFINES += HAVE_NEWDEVICE
INCLUDEPATH += ./qt-devices/new-device
HEADERS += ./qt-devices/new-device/new-device.h \
.. add further includes to development files, if any
SOURCES += ./qt-devices/new-device/new-device.cpp \
.. add further implementation files, if any
FORMS += ./qt-devices/new-device/newdevice-widget.ui
LIBS += .. add here libraries to be included
}
#ifdef HAVE_NEWDEVICE
#include new-device.h
#endif
• The names of selectable devices are stored in a combobox. So, in the neighborhood of
#ifdef HAVE_AIRSPY
deviceSelector -> addItem ("airspy");
#endif
#end{verbatim}
}
the text
{]footnotesize
\begin{verbatim}
#ifdef HAVE_NEWDEVICE
deviceSelector -> addItem ("newDevice");
#endif
is added.
• If selected, the class implementing the device handler should be instantiated, so, in the direct
environment of
#ifdef HAVE_AIRSPY
if (s == "airspy") {
try {
inputDevice = new airspyHandler ....
....
#endif
33
#ifdef HAVE_NEWDEVICE__
if (s == "newDevice") {
try {
inputDevice = new newDevice (..parameters..);
showButtons ();
}
catch (int e) {
QMessageBox::warning (this, tr ("Warning"),
tr ("newDevice not found\n"));
return nullptr;
}
}
else
#endif
7 dabMini
7.1 Why a dabMini
I often run a DAB decoder(s) on an RPI2 or 3. Since these RPIs are headless, control (and often the
sound) is from my laptop. Sometimes I find the GUI of Qt-DAB too large, especially when my only
concern is to listen to the audio. In that case I do not need any of the push buttons and the comboboxes
on the main GUI widget, nor the additional widgets.
While I was using dabRadio for that purpose (or sometimes qml-dab), I realised that most of the
corrections and changes that were applied to the sources - quite many - of Qt-DAB were not applied to
the sources of these programs.
So, in order to maintain consistency of sources between Qt-DAB and a version with a small GUI I
designed and implemented dabMini by using the Qt-DAB sources. To ensure consistency, a subdirectory
was made in the Qt-DAB sources containing the (few) files special for use with this dabMini. Interesting
is that - next to changes to device handlers to accomodate for the demise of the device control widgets
- only 2 files needed to be changed.
34
Figure 30: Qt-DAB: dabMini
The Presets behave as the one in Qt-DAB. The selector labeled default is the selector for the audio
channel. Note that - Linux obly - both pulse and pipewire can be configured such that audio is sent
over bluetooth.
The dlText button controls - as with Qt-DAB - writing the text of the dynamic label to a file.
The bottom of the GUI contains the so-called dynamic Label, a large comboboxes labeled Presets,
a stereo indicator and a button labeled mute.
35
sudo apt-get install libgl1-mesa-dev libqt5opengl5-dev
sudo apt-get install libsamplerate0-dev
sudo apt-get install qtbase5-dev
(see section 5.3.6 for some comments on making the device visible).
8 Acknowledgements
Qt-DAB and derived programs are written and maintained by me. The software is provided as is, and
made available under the Gnu GPL V2 license.
Many people contributed (and contribute) by providing feedback, suggestions and code fragments,
in particular:
• Andreas Mikula, for continuous feedback, testing and suggestions;
• Stefan Pöschel, for providing code for and giving suggestions to handling the AAC code;
• Stuart Langland, for its comments, suggestions and code contributions;
36
• probonopd, for its contribution with creating appImages;
Furthermore I am grateful
• to SDRplay ltd (Andy Carpenter), for providing me the possibility to use the Ia and II versions
of the SDRplay RSP devices, all wonderful devices;
• to Benjamin Vernoux, for making an AIRSPY device available;
37