Skip to content

Repository files navigation

T 2 Digitalreceiver

T 2 is a DAB+ radio receiver for Band III. An RTL-SDR dongle gives it the signal. The window is a small, frameless panel with a frequency dial, a station list and four controls.

T 2 decodes DAB+ only. It does not decode classic DAB, which uses MPEG-1 Layer II audio. T 2 shows classic DAB stations, but it does not play them.


Terms

Term Meaning
Band III The radio band from 174 MHz to 240 MHz. DAB uses it.
channel One named frequency in Band III, for example 7A.
ensemble The group of stations that one channel carries.
station One audio service in an ensemble.
dongle The RTL-SDR USB device that receives the signal.
I/Q file A file of recorded radio samples.
SNR Signal-to-noise ratio, in dB.
click Push and release the left button of the mouse.

Part 1 — How to use T 2

1.1 What you need

  • An RTL-SDR dongle. T 2 was tested with an RTL-SDR Blog V4.
  • An antenna for Band III.
  • A computer with Windows 11.

1.2 Get T 2

Download the file for your system from the releases page of the repository.

System File Notes
Windows t2-<version>-windows-x86_64-setup.exe Installs T 2 and adds it to the Start menu.
Windows t2-<version>-windows-x86_64-portable.zip No installation. Extract the ZIP file. Then start t2.exe.
Linux t2-<version>-linux-x86_64.AppImage No installation. Make the file executable. Then start it.
Linux t2-<version>-linux-x86_64.deb For Debian and Ubuntu. Install it with apt install ./<file>.
macOS t2-<version>-macos-universal.dmg One file for Apple Silicon and for Intel.

The files have the name t2, but the program is called T 2. Only the file name is different, because a space in a file name is difficult in a terminal.

These files are not signed. Thus your system shows a warning the first time you start the program.

  • On Windows, Microsoft Defender SmartScreen shows a message. Click More info. Then click Run anyway.
  • On macOS, Gatekeeper refuses the first start. Open the Applications folder. Hold the CTRL key and click T 2. Then click Open.

1.3 Prepare the dongle

T 2 reads the dongle through the WinUSB driver. Windows must use this driver for the dongle, and not the TV tuner driver.

CAUTION: Zadig replaces the driver of the device that you select. Select the correct device. If you select the wrong device, that device will not operate.

  1. Connect the dongle to a USB port.
  2. Connect the antenna to the dongle.
  3. Download Zadig from https://zadig.akeo.ie.
  4. Start Zadig.
  5. Select Options > List All Devices.
  6. Select the dongle in the list. Its name contains RTL or Bulk-In.
  7. Select the WinUSB driver.
  8. Click Replace Driver.
  9. Wait for the message that tells you the installation is complete.

1.4 Start T 2

Start T 2 from the Start menu. The window opens. It shows no stations, because T 2 knows no stations yet.

1.5 The parts of the window

Part Position Function
Header Top Shows the mark T 2, the channel and the frequency.
Dial Below the header Shows Band III. A tall orange line shows the tuned channel.
Hero row Middle Shows the station that plays now, its text and its signal quality.
Artwork window Below the hero row Shows the image that the station sends.
Station list Below the artwork Shows all stations that T 2 found.
Bottom bar Bottom Holds the settings button, the volume line and the play button.

The header is also the title bar. Hold the left button of the mouse on the header to move the window.

T 2 remembers the position and the height of the window. It puts the window back when you start it again. If the monitor is no longer connected, T 2 uses the default position.

1.6 Find the stations

T 2 does not find stations without a command. Do a scan first.

  1. Click the settings button at the bottom left of the window.
  2. Click Scan Band III.
  3. Wait. The button shows the channel that T 2 examines now, and the number of ensembles that it found.
  4. Click the cross at the top right of the sheet to close the sheet.

The station list now shows the stations. The dial shows a tall white line at each channel that has an ensemble.

The scan examines all 38 channels of Band III. It can take some minutes, because T 2 must tune the dongle again for each channel.

The scan adds stations. It does not delete stations. Thus a short scan cannot remove the stations that a long listen found.

1.7 Play a station

Click the name of a station in the list.

If the station is on a different channel, T 2 tunes to that channel first. The orange lines on the dial move to the new channel. This takes some seconds, because T 2 must open the dongle again for each new channel.

The station moves to the hero row. The hero row is taller than the rows in the list. This difference tells you which station plays.

You can also click a tall white line on the dial. T 2 then tunes to that channel.

1.8 Stop and start the audio

Click the button at the bottom right of the window. It stops the audio, or it starts the audio again. The station stays tuned.

1.9 Make a station a favourite

Click the circle to the left of a station name.

  • An empty circle shows that the station is not a favourite.
  • A filled grey circle shows that the station is a favourite.

Favourites come first in the list. Inside each group, the stations are in alphabetical order.

1.10 Read the signal quality

The hero row shows a word, a dot and a number. The number is the SNR in dB.

The number changes one time each 10 seconds. Thus you can read it. The word changes at the same time.

Two conditions change the readout immediately:

  • You select a station on a different channel.
  • The receiver finds the signal, or loses it.
Word SNR
STRONG More than 14 dB
GOOD 11 dB to 14 dB
WEAK Less than 11 dB

If the word is WEAK, move the antenna. A better antenna position gives a higher number.

1.11 Change the volume

The volume is the horizontal line in the middle of the bottom bar. The white part of the line shows the current volume. The grey part shows what is left.

You can change the volume in three ways:

  • Hold the left button of the mouse on the line. Move the pointer left or right.
  • Put the pointer on the line. Turn the wheel of the mouse.
  • Push the TAB key until the line has the focus. Then push the arrow keys.

1.12 Show or hide the station artwork

Some stations send images. T 2 hides these images, because they change the height of the window.

  1. Click the settings button.
  2. Under Station artwork, click On or Off.

1.13 Change the gain and the frequency correction

Change these settings only if the signal is weak.

  1. Click the settings button.
  2. Under Gain, click Auto to let the dongle control the gain.
  3. Or click dB and type a value. Approximately 28 dB is a good first value.
  4. Under ppm, type the frequency error of the crystal of your dongle.

1.14 Play from a file

T 2 can read an I/Q file instead of the dongle. The file must contain unsigned 8-bit samples (cu8) at 2.048 MS/s. The fixtures\ensemble.cu8 file in the source is an example.

  1. Click the settings button.
  2. Under Source, click File.
  3. Type the full path of the file.
  4. Click a different field. T 2 opens the file.

To use the dongle again, click Antenna.

1.15 Change the size of the window

The width of the window is constant. You can change only the height.

  1. Move the pointer to the bottom edge of the window. The pointer changes.
  2. Hold the left button of the mouse.
  3. Move the pointer up or down.

The station list becomes taller or shorter. The other parts keep their size.

1.16 Close or minimise the window

The window has no buttons until you move the pointer to the header.

  1. Move the pointer to the header.
  2. The frequency label disappears, and two buttons appear at the right.
  3. Click the first button to minimise the window.
  4. Click the second button to close T 2.

You can also use the TAB key to move to these buttons.

1.17 Where T 2 keeps its settings

T 2 writes its settings, its window position and its station list to this file:

%APPDATA%\T 2\settings.toml

Delete this file to remove all stations and all favourites.

1.18 Messages

Message Cause What to do
No signal on <channel> No ensemble on this channel. Do a scan. Or move the antenna.
DAB (MP2) — not supported The station uses classic DAB. Select a different station.
<name> carries data, not audio The service is not a radio station. Select a different station.
Reconnecting… T 2 lost the dongle and looks for it again. Wait. T 2 continues without your help. See below.
Receiver disconnected A file source stopped. Examine the file. Select a different source.
Cannot open receiver: <text> T 2 cannot open the dongle. Make sure that no other program uses the dongle. Examine the driver.
No source selected T 2 has no dongle and no file. Open the settings sheet. Select a source.

About Reconnecting…

A USB receiver goes away for many reasons. The computer went to sleep. A hub removed the power. Somebody moved the cable. T 2 does not stop when this occurs.

T 2 looks for the dongle again after 0.5 seconds. If it does not find the dongle, T 2 waits two times as long before each new attempt, to a maximum of 5 seconds. It continues for as long as necessary.

When T 2 finds the dongle, it tunes to the same channel and plays the same station. You do not have to do anything. You do not have to start T 2 again.


1.19 The command-line program

The t2 program does the same work without a window. It is not part of the installer. Build it with cargo build --release -p t2-cli.

Command Function
t2 channels Print the Band III channel table.
t2 list Print the stations in one ensemble.
t2 scan Examine all channels of Band III.
t2 decode Write one station to a WAV file.

Examples:

t2 list --rtl --channel 7A
t2 list --in fixtures/ensemble.cu8 --json
t2 scan --gain 28
t2 decode --rtl --channel 7A --sid 0x4F40 --out station.wav
Option Function
--rtl Read from the dongle.
--in <file> Read from an I/Q file.
--channel <name> The Band III channel. Necessary with --rtl.
--gain <dB> The gain of the tuner. Omit it for automatic gain.
--ppm <number> The frequency correction of the crystal.
--timeout <seconds> Stop after this time. The default value is 20.
--json Print the result as JSON.
--with-cu Add the capacity-unit spans to the list output.
--sid <id> The station, as hexadecimal or decimal.
--out <file> The WAV file to write.

To see more messages, set the T2_LOG variable:

set T2_LOG=info

Part 2 — How to build T 2 and its installer on Windows

2.1 What you must install first

Install these programs before you build. The versions in the table are the versions that this document was tested with.

Program Version Why
Visual Studio Build Tools 2022, with Desktop development with C++ Gives the MSVC linker and the C compiler. The AAC audio library is C code.
Rust stable, 1.96.1 Builds all four crates. Install it with rustup.
Node.js 20 or later, tested with 24.16.0 Builds the user interface.
Tauri CLI 2.11.2 Makes the application and the installers.
WebView2 runtime Current Shows the user interface. Windows 11 already has it.

Install the Tauri CLI with this command:

cargo install tauri-cli --version "^2" --locked

The rust-toolchain.toml file selects the stable toolchain. It also selects the rustfmt and clippy components. rustup installs them automatically.

NOTE: The bundler downloads NSIS and WiX at the first build. The computer must have an internet connection for that build.

2.2 Get the source and the dependencies

git clone <repository-url> t2
cd t2\ui
npm ci

2.3 Test the source

All four tests must be clean. Do not commit code that fails one of them.

Type these commands in the top directory:

cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --workspace

Then type these commands in the ui directory:

npm run typecheck
npm test

NOTE: Windows PowerShell 5.1 does not know the && operator. Type each command on its own line.

2.4 Start T 2 in development mode

cd app
cargo tauri dev

This command starts the Vite server and the application. It builds the application again when you change a file.

2.5 Build the installers

cd app
cargo tauri build

The command does this work:

  1. It builds the user interface into ui/dist.
  2. It builds the application in release mode.
  3. It makes the two Windows installers.

The first build takes some time, because the release profile uses link-time optimisation. Later builds are faster.

The configuration file names five bundle targets. Three of them are for Linux and macOS. On Windows the bundler makes only the MSI and the NSIS installers, and ignores the other three.

2.6 Where the results are

File Path Size
Application target\release\t2-app.exe 12.7 MB
MSI installer target\release\bundle\msi\T 2_0.1.0_x64_en-US.msi 5.2 MB
NSIS installer target\release\bundle\nsis\T 2_0.1.0_x64-setup.exe 3.5 MB

The name of the application file is t2-app.exe, because that is the name of the Rust crate. The two installers use the product name. They put the application in the Start menu as T 2.

Use the MSI installer for a company that installs software with Group Policy. Use the NSIS installer for one computer.

Both installers use the identifier de.t2.radio. Both add the licence file and the NOTICE file.

2.7 To change the version

Change the version field in app/tauri.conf.json. The names of the installers contain this number.

2.8 Notes for the person who changes the build

  • The stack must be larger than the default. The OFDM front-end keeps large arrays on the stack, and the MSVC default of 1 MB is too small. Each binary crate has a build.rs file that sets /stack:8388608. Link arguments apply to the final binary only. Thus t2-cli, app and t2-dab each need their own file. If you add a new binary crate, copy this file.
  • The workspace patches the rs-rtl crate. The patch is one function. It identifies an RTL-SDR Blog V4 correctly on Windows. Without the patch, the dongle receives noise at each frequency. Read third-party/rs-rtl/README.md.
  • The code under crates/t2-dab/src/vendor/ is not ours. It is Xavier Olive's dabradio, at release 0.4.2. Mark each local change with // T2:. Read CLAUDE.md before you change one of these files.
  • SPEC.md is the specification. If this document and SPEC.md disagree, SPEC.md is correct.

2.9 The release workflow

.github/workflows/release.yml makes all the files in section 1.2. It starts in two conditions:

  • You push a tag with the format v<version>, for example v0.1.0. The workflow then makes a GitHub release and adds the files to it.
  • You start it manually from the Actions page. The workflow then makes the files, but it does not make a release. Use this to test a change to the workflow.

The version in the tag must agree with the version field in app/tauri.conf.json. If the two do not agree, the workflow stops with an error.

Runner Makes
windows-latest The NSIS installer and the portable ZIP file. x64 only.
ubuntu-22.04 The AppImage file and the DEB package.
macos-latest The DMG file, for Apple Silicon and Intel together.

The Linux runner is Ubuntu 22.04 and not a later version. A program uses the system C library of the computer that made it. Thus a program made on Ubuntu 24.04 does not start on an older system.

.github/workflows/ci.yml does not make these files. It tests the source on each push and each pull request, and that must stay quick.

Licences

T 2 is MIT licensed. It contains code with other licences:

  • dabradio and desperado by Xavier Olive, both MIT.
  • The Fraunhofer FDK AAC Codec Library, which is not MIT. Its licence is in the installed application.
  • The Inter and IBM Plex Mono fonts, under the SIL Open Font License.

The NOTICE file holds the full text.


About this document

This document follows the rules of ASD-STE100 Simplified Technical English. Sentences are short. Each instruction is one sentence. The word click is used as a technical verb for the mouse.

The name of the product is T 2: two characters, one space, one digit.

About

T 2 is a DAB+ radio receiver for Band III. An RTL-SDR dongle gives it the signal. The design is inspied by the Braun radios. The user interface is simple and clear. The program is small: 2.5 MB compressed. The code is Rust.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages