JvanKatwijk / qt-dab

Qt-DAB, a general software DAB (DAB+) decoder with a (slight) focus on showing the signal
http://www.sdr-j.tk
GNU General Public License v2.0
300 stars 62 forks source link
aac-decoding adalm-pluto-sdr airspy dab-decoder dabplus hackrf lime rtlsdr-dongle sdrplay sdrplay-devices sdrplay-rsp-devices signal-processing

Qt-DAB-6.8


6.8



Qt5 to Qt6 Qt5-DAB-6.9 and (Qt6-DAB-6.9)

Since Qt6 is there for quite a while, it is inevitable to move over to Qt6. Unfortunately, AppImages are built with "old" library versions, and AppImages are and will be compiled with Qt5 for a while.

The qwt ibrary version - provided by the Fedora system - is for both the Qt5 and Qt6 versions 6.20, the Qt6 version Qt6.8.

While the Qt6 based version for Linux works fine, there are some issues with the Windows versions, probably caused by problems with some incomaptible dll's. The windows versions for Qt_DAB 6.9 are therefore still compiled with Qt4 (as is the AppImage).

The sourcetree contains the sources for the 6.9 Version, both compilable using Qt5 and Qt6.

6.9

About Qt-DAB-6.8

Qt-DAB is software for Linux, Windows, MacOS and Raspberry Pi for listening to terrestrial Digital Audio Broadcasting (DAB and DAB+). Qt-DAB is continuously under further development, Qt-DAB-6.8 , the stable version of Qt-DAB has - again - some new features, not often seen elsewehere. A good quote indicating what I try to achieve in the continuous development of Qt-DAB software is:

And indeed, it continuously shows that it is fairly easy to add new features.

Of course, as for previous versions, for Qt-DAB-6.8 some predefined versions are available. For Windows three installers are maintained, and for Linux an x64 AppImage is available.

6.8 6.8

What changed in Qt_DAB-6.8

In Qt_DAB-6.8 the "ini" file was reorganized, the old one was a little messy. The "ini" file is named differently, which has has positive effect that running older versions is not affected, as negative effect that it is "empty"

A seemingly minor change from the user's point of view is that now on selecting any channel, the service that was last used on that channel is started.

Table of Contents

Introduction

Qt-DAB is designed to be used with different SDR devices in mind. A simple and clean interface is used and Qt-DAB-6.X has support for a DABsticks, all models of the SDRplay, Airspy, HackRF, LimeSDR, Adalm Pluto etc.

Qt-DAB is being developed under Fedora, and cross compiled - using the excellent Mingw64 toolset - for Windows. For Windows, installers are available, two installers for 32 bit versions and one for a 64 bit version. For Linux, an AppImage, available for x64 Linux, is available, built under an older version of Ubuntu (right now Ubuntu 20, Ubuntu 22 is too new for an AppImage).

Thanks to Richard Huber, Qt-DAB can be compiled on the Mac as well.

Qt-DAB is GUI driven, the full GUI shows 4+ widgets, one of them, the main widget - one with sufficient controls to select channels and service(s) - is always visible. This main widget contains selector for controlling the visibility of (the) other widgets.

Features

Not implemented:

Widgets and scopes

6.8

The full GUI for Qt-DAB-6.8 is built up from 4 (four) larger widgets and - depending on the settings - a few smaller ones.

The mainWidget (see picture) is the one widget that is always visible as long as the program is running, it contains settings for controlling the visibility of other widgets. The main widget shows on the left half a list of services (either from the currently selected channel or from the favourites), and it provides all means for selecting a channel and selecting a service. On the right half of the widget is shows the dynamic label, and the slides - if transmitted as part of the service - or a series of default slides.

(Obviously, the colors of the buttons, as well as the font, the font size and the font color of the service list shown can be set by the user, just click with the right hand mouse button on a button).

Qt-DAB supports Favourites, i.e. a list of (channel, service pairs), the list is maintained between program invocations. The services list is shown in one of two modes, selectable by the button (in the picture labeled favourites). In ensemble view mode, the services in the current ensemble are shown, in the favourites view mode, the favourites are shown. In both views, selecting a service is just by clicking on the service name. Of course, when selecting a service in the list of favourites, it might take some time before the software has switched over to the appropriate channel, and has received sufficient information on the new ensemble carried in that channel before being able to select the service in that channel.

Adding a service to the favourites is by clicking on the field in the right hand column, shown in the services list. If - in ensemble mode view - a service is also part of the favourites, the field in the right hand column is marked. Clicking on such a mark removes the service from the list, as does clicking on the field in the favourites view.

6.8

The technical widget shows - as the name suggests - some technical details of the selected audio service. If the audio of the service is also transmitted on FM, the FM frequency - derived from additional data in the DAB data - is shown as well.

The buttons at the top of the widget control dumping the audio (".wav" file) resp. the AAC frames into a file. The latter can be processed by e.g. VLC. The three progress bars (quality indicators) for DAB+ give success rates of resp. detecting a DAB+ frame, the RS error repair and the AAC decoding. (For "old" DAB transmissions only a single quality indicator appears).

The - in the picture red - label with text "mot available" turns green if in the selected service mot data (usually slides or text) is detected.

6.8

The widget for the spectrum scope is equipped with a tab for selecting one of 6 views on the input signal. In the view shown in the picture above, the spectrum of the incoming DAB signal is shown. One clearly sees that the bandwidth of the signal is app 1.5 MHz (1536 KHz to be precise). To the right of this spectrum, one sees the signal constellation, i.e. the mapping from the complex signals onto their real and imaginary components. If the selector labeled "ncp" is set - as in the picture - the centerpoints of the 4 lobs is shown.

On the right hand side the widget shows some quality indicators of the DAB signal, such as applied frequency correction, remaining frequency error, SNR, some clock offsets and an estimate of the signal quality (for the latter, higher is better).

6.8

The ideal form of the spectrum and the signal constellation as shown in the picture above is not often seen with real inputs.

6.8

The correlation scope shows the correlation between the incoming signal and predefined data, i.e. the data as they should be. Correlation is used in identifying the precise start of the (relevant) data of the frame in the input sample stream. The picture shows more more peaks, i.e. the signal from more than one transmitter is received.

6.8

A DAB signal is received as a sequence of samples, and can be thought to be built up from frames, each frame consisting of 199608 consecutive samples. The first app. 2500 samples of a frame do not carry a signal, the NULL period. The NULL scope shows the samples in the transition from the NULL period to the first samples with data of a DAB frame.

6.8

In reality the NULL period is not completely without signal, it contains an encoding of the TII data. The TII scope shows the spectrum of the data in the NULL period. This TII data - when decoded leads to 2 2 digit numbers - is used to identify the transmitter of the signal received, these numbers can be mapped upon a name and location of the transmitter.

6.8

The channel scope shows the channel response on the transmitted data, i.e. the deformation of the transmitted signal on the way from transmitter to receiver. The picture shows the cyan colored line, i.e. the channel response on the amplitude, and the red line, i.e. the channel effects on the phase of the samples.

6.8

The deviation scope shows the mean deviation of the carriers in the decoded signal, ideally their phase is (a multiple of) 90 degrees. The phases are mapped upon (soft) bits, the larger the deviations, the less reliable these bits are. The Y-axis is in Hz.

8.8

The configuration and control widget contains checkboxes, spinboxes and buttons with which the configuration of the decoding process can be influenced.

At starting up Qt-DAB-6.8 for the (very) first time, no device is selected yet, amd the widget is made visible to allow selection of an input device (the combobox at the bottom line right).

For a detailed description of all selectors, see the manual (or read the tooltips).

A Note on using an RTLSDR device

RTLSDR devices are - because of their price - rather popular. In Qt-DAB different versions for the support library are provided, The windows and Linux versions differ in their implementation, it turns out that under Windows, killing and restarting the "worker" thread on changing a channel might cause a crash, so a different model for implementing the start stop sequences was implemented.

Furthermore, it turns out that for support of the V4 version of the sticks a new version of the library (".dll") is required. Unfortunately, using that library for "older" models (i.e. V3) models of the stick seems the device to make rather "deaf".

So when implementing Qt-DAB for Windows, one chooses between the library support for the V3 or V4 version. Two precompiled versions are available, one with support for the V3 and one with support for the V4 version of the stick.

Scan control

6.8

A separate widget - visible under control of the scan button on the main widget - provides full control on scanning. Qt-DAB provides different scanning modes, with single scannning and continuous scanning.

To allow skipping over given channels when scanning, Qt-DAB supports the notion of a skiptable, in which channels to be skipped can be marked. The show button controls the visibility of the skiptable, skiptables can be loaded and stored in either the ".ini" file (use the "...default" buttons, or can be kept as xml file on a user defined place (the other load/store buttons).

The small table at the bottom of the widget is just for convenience, on scanning it displays the channel name, the ensemble name encountered and the number of services detected in the ensemble.

Displaying TII data

As mentioned, transmitters (usually) transmit some identifying data, the TII (Transmitter Identification Information) data. Qt-DAB uses a database to map the decoded TII data to name and location of the transmitter.

DAB transmissions are usually transmitted by an SFN (Single Frequency Network), where all transmitters transmit the same content on the same frequency (each with unique TII data). If the DX selector on the configuration and control widget is set, Qt-DAB tries to identify as much as possible transmitters from the SFN and shows them.

6.8

The picture shows that in my environment, on channel 12C, the national network, I can identify a couple of different transmitters in the received signal. The left column in the widget shows the transmitter whose data is the data being processed. New is the addition of a "compass" to show the direction from which the signal comes from the selected transmitter.

If the DX mode is set, Qt-DAB-6.8 will save the transmitters that are identified in a text file, in Windows the file in the Qt-DAB-files folder in the home folder, in Linux the file is stored in the Qt-DAB-files folder in the "/tmp" directory. Name of the file is tii-files.txt.

6.8

As seen in the table above, distances to the transmitters can be computed. In Qt-DAB the transmitters can be made visible on a map.

Qt-DAB has - on the main widget - a button labeled http, when touched, a small webserver starts that shows the position(s) of the transmitter(s) received on the map. Note that two preconditions have to be met:

The webbrowser listens to port 8080. By default, the "standard" browser on the system is activated. The configuration and control widget contains a selector for switching this off, so that one might choose one's own browser.

See the manual for entering the home position to Qt-DAB.

Documentation

An extensive user's guide - in PDF format - for Qt-DAB-6.8 can be found in the "docs" directory in the repository. The manual contains a fairly complete description of the widgets and on configuring for creating an executable (Linux).

Qt-DAB documentation

Installation on Windows

For Windows installers can be found in the releases section of this repository

:information_source: The releases section contains 3 Windows installers. One for a 64 bit version, and 2 for a 32 bit version. The 2 versions for 32 bit differ in theit support for RTLSDR type devices. It seems that the support library for the V4 versions of the RTLSDR dongle makes Qt-DAB rather deaf when used with a V3 dongle. The V3 version therefore is equipped with an older version of the support library, and the other version with the library for the V4 version of the dongle. The 64 bit version has support for the V4 stick.

:information_source: Note that the device libraries for the SDRplay devices and the Adalm Pluto device library are NOT included in the installer, they require - if used - a separate installation. See below for details.

Installation on Linux-x64

For Linux-x64 systems, an appImage can be found in the releases section of this repository

:information_source: The appImage contains next to the executable Qt-DAB program, the required libraries but not the support libraries for the configured devices. If you want to use a physical device - e.g. a DABstick, an SDRplay, or an AIRspy you need to install the driver libraries for the device as well.

For using an SDRplay device one should download the - proprietary - driver software from the SDRplay site. Note that the "old" 2.13 library does not support the newer SDRPlay device model such as the SDRPlay 1B. the SDRplayDx and the SDRPlay Dx-II. Use the 3.XX library instead. The libraries can be found on the website of SDRplay

For using an AIRspy or a Hackrf device, the Ubuntu repository as well as the bullseye repository (for the RPI) provide a working library.

For using an RTLSDR device (a DABstick), the Ubuntu (and bullseye) repositories provide a package. However, using that package one needs the kernel module to be blacklisted, see e.g.

Personally, I prefer to build a version of the library myself, installation is easy, see:

For using the LimeSDR device I went back to the sources and compiled the support library myself, see:

For installing the support software for the Adalm Pluto I followed the instructions on

Building an executable for Qt-DAB: a few notes

It is strongly advised to use qmake/make for the compilation process, the qt-dab-RC.pro file contains (much) more configuration options than the CMakeLists.txt file that is used with cmake.

Note that the scheme presented below is applied when building the AppImage on Ubuntu 20, and was tested on the "bullseye" system on the RPI. For other distributions (or later Ubuntu versions), names of library packages may be different. Note that in all cases, the development versions (i.e. the versions with the include (".h") files) are required.

For Windows the easiest approach is to install msys/mingw and follow the process as sketched (I use Mingw64 packages on Fedora to cross-compile). Using an MS toolchain on Windows was for me not (yet?) successfull.

Step 1

For building the AppImage on Ubuntu 20, I load the required libraries as given below:

Installing cmake is optional, I used it for compiling fdk-aac and the rtlsdr library.

Note that different versions of Ubuntu use a different name for packages, esp. the qwt library

A note on libfdk-aac and libfaad

Since - esp. for lower bitrates - libfdk-aac is believed to outperform libfaad in HeAAC decoding, the default in the configuration file is set to fdk-aac. Installing the libfdk-aac library from the repository is

The sources contain a CMakeLists.txt file, building and installing is straightforward.

Alternatively, one could configure for libfaad, change the configuration to

and install the libfaad package

A note on Qt_Audio

Qt_DAB-6.8 allows selection between two audio subsystems, i.e. portaudio and Qt_Audio. It turns out that Qt_Audio does not work well on Ubuntu 20 (it does on Fedora and Ubuntu 24 though). Since the AppImage is built on Ubuntu 20, selecting the Qt_Audio subsystem is ignored.

Step 2

While there are dozens of configuration options, take note of the following ones:

Step 3

Run qmake (variants of the name are qt5-qmake, qmake-qt5) which generates a Makefile and then run make. Compiling may take some time. Use make -j XX for speeding up the build process, with XX the amount of parallel threads used. Of course, qmake will complain if not all required libraries can be found.

Step 4

The repository contains in the subdirectory library a shared library libtii-lib.so for use on an x86_64 PC, that - when installed in e.g. /usr/local/lib - supports loading fresh instances of the database.

Otherwise, unpack the file tiiFile.zip, and copy the resulting file .txdata.tii to the home directory (home folder). (The unpacked file contains a copy of the database for finding the transmitter's name and location.) Identifying transmitters using TII data will work, but no database update can be performed.

If Qt-DAB does not see the database, it will just function without mapping TII data onto names and locations.

:information_source: Building a version on a fresh install of "bullseye" on the RPI gave a version that wouldn't run: The Qt_PLUGIN_PATH was not set. Setting it as given below solved - for me - the problem:

    Qt_5= /usr/lib/arm-linux-gnueabihf/qt5
    export QT_PLUGIN_PATH=$Qt_5/plugins

Using user specified bands

While it is known that the DAB transmissions are now all in Band III, there might be situations where it is desirable to use other frequencies. Qt-DAB provides (Unix/Linux builds only) the opportunity to specify one's own band. Specify in a file a list of channels, e.g.

one 227360
two 220352
three   1294000
four    252650

and pass the file on program start-up with the -A command line switch. The channel name is just any identifier, the channel frequency is given in kHz. Your SDR device obviously has to support the frequencies for these channels.

xml-files and support

Clemens Schmidt, author of the QiRX program (https://qirx.softsyst.com/) and me defined a format for storing and exchanging "raw" data: .xml-files for easier echange of recordings. Such an xml file contains in the first bytes - up to 5000 - a description in xml - as source - of the data contents. This xml description describes in detail the coding of the elements.

As an example, a description of data obtained by dumping Airspy input:

    <?xml version="1.0" encoding="utf-8"?>
    <SDR>
      <Recorder Name="Qt-DAB" Version="6.X"/>
      <Device Name="AIRspy" Model="I"/>
      <Time Value="Wed Dec 18 12:39:34 2019" Unit="UTC"/>
      <!--The Sample information holds for the whole recording-->
      <Sample>
        <Samplerate Value="2500000" Unit="Hz"/>
        <Channels Bits="12" Container="int16" Ordering="LSB">
          <Channel Value="I"/>
          <Channel Value="Q"/>
        </Channels>
      </Sample>
      <!--Here follow one or more data blocks-->
      <Datablocks>
        <Datablock Number="1" Count="375783424" Unit="Channel">
          <Frequency Value="227360" Unit="KHz"/>
          <Modulation Value="DAB"/>
        </Datablock>
      </Datablocks>
    </SDR>

The device handlers in Qt-DAB support both generating and reading such an .xml file.

While the current implementation for reading such files is limited to a single data block, the reader contains a cont button that, when touched while playing the data, will cause continuous playing of the data in the data block.

6.8

The picture shows the reader when reading a file, generated from raw data emitted by an AIRspy device.

Copyright

Copyright (C)  2016 .. 2024
Jan van Katwijk (J.vanKatwijk@gmail.com)
Lazy Chair Computing

Copyright of libraries used - Qt-DAB, qwt, fftw, portaudio,
libsndfile. libsamplerate, ;ibusb-1, libfaad, libfdk-aac,
- is gratefully acknowledged.

Qt-DAB is distributed under e GPL V2 library,  in the hope that
it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for
more details.