/rpi-dab-tx

Setup a Raspberry PI as a DAB transmitter

Primary LanguageShellGNU General Public License v3.0GPL-3.0

Edits by Christoph

Setting the odr-mmbTools software up

  1. I strongly suggest you change the password with the command passwd (vagrant's password is vagrant)
  2. Set the proper timezone on the raspberry. You can identify the timezone values with the command timedatectl list-timezones
sudo timedatectl set-timezone "your_timezone" (without "")
  1. Clone the production branch of the repository
cd
sudo apt-get install -y git
git clone https://github.com/MaxDeepCoder/rpi-dab-tx.git
  1. Run the installation script:
bash rpi-dab-tx/install.sh

Then wait.

and wait..

and wait...

Table of contents

Introduction

The goal of the rpi-dab-tx project is to run a Digital Audio Broadcasting, software-defined-radio transmitter on a raspberry-pi device. For this, you will need:

  • 1 raspberry pi running the latest version of raspi os (a debian-derived linux operating system) or a computer capable of running a virtual host
  • 1 soapy-sdr compatible transceiver device, such as the Hackrf One or the LimeSDR cards

Compatibility

alt text

  • Raspberry Pi 1 ❌ Too Slow (Untested)
  • Raspberry Pi 2 ❓❌ Slow? (Untested)
  • Raspberry Pi 3 ✅ Max 4 streams or it crashes (Tested)
  • Raspberry Pi 4 ✅ (Untested)
  • Raspberry Pi 0 ❌ (Untested)
  • Raspberry Pi 0w ❌ (Untested)
  • Raspberry Pi 2w ❓ (Untested)

This project:

Manual setup

This project was initially designed with the model 3B of the Raspberry pi. As of version 1.2.0, it can also run on a virtual Debian system.

Setting the Operating system up

Since some software components, like the modulator, are CPU-intensive, it is preferable to configure the system with a clean Debian-lite system.

Raspberry PI

  1. Download rpi-imager onto your computer (Windows, MacOS or linux). This software will allow you to initialize the SD-card with the operating system
  2. Run rpi-imager on your computer. Click on "Choose OS", then on "Raspberry Pi OS (other)" and select "Raspberry Pi OS Lite (32-bit or 64-bits)"
  3. Click on "Choose storage" and select your SD-card device
  4. Click on the setup button to set specific parameters (like a ssh access, user profile/password)
  5. Finally click on the write button to install the operating system on your SD-card
  6. Remove the SD-card from your computer and insert it into your raspberry pi. Then switch it on
  7. Log into the raspberry pi (default user profile pi and password raspberry)

Virtual host

  1. Install VirtualBox on your physical host (WIndows, MacOs, non-debian Linux, *BSD*)
  2. Install VirtualBox Extension Pack on your physical host
  3. Install Vagrant on your physical host
  4. Start Virtualbox
  5. Open a command prompt on your physical host
  6. Copy the Vagrantfile from this repository
  7. Create and start the Debian virtual session: vagrant up
  8. Log into the Debian virtual session as user vagrant: vagrant ssh
  9. Update the Debian system by running: sudo apt-get update; sudo apt-get upgrade -y
  10. Log off and quit the virtual session: exit
  11. Stop the virtual session: vagrant halt
  12. Connect the SoapySDR-compatible transceiver card to the host system
  13. Add a USB filter to your VirtualBox session (named dab_tx) for your SoapySDR-compatible card
  14. Restart the virtual session: vagrant up
  15. Login again into your virtual session: vagrant ssh

Setting the odr-mmbTools software up

  1. I strongly suggest you change the password with the command passwd (vagrant's password is vagrant)
  2. Set the proper timezone on the raspberry. You can identify the timezone values with the command timedatectl list-timezones
sudo timedatectl set-timezone your_timezone
  1. Clone the production branch of the repository
cd
sudo apt-get install -y git
git clone https://github.com/MaxDeepCoder/rpi-dab-tx.git
  1. Or clone the dev branch of the repository if you want to test the latest features (but expect possible bugs)
git clone https://github.com/MaxDeepCoder/rpi-dab-tx.git --branch dev
  1. Run the installation script:
bash rpi-dab-tx/install.sh

Then wait.

and wait..

and wait...

Operations

Point your web browser to the Supervisor web interface on the RaspberryPI or on the Virtual host (default user profile odr and password odr) to start and stop each components of the DAB/DAB+ transmitter: modulator, multiplexer, encoders (audio & data), encoder-manager and multiplex-manager.

Role of each components

  • Encoder-manager: allows you to manage audio streams and related PAD
  • Audio encoder: one per radio station being broadcasted. Packs the radio web stream and the data from the PAD encoder and shares it with the multiplexer
  • PAD encoder: one per radio station being broadcasted. Gathers data (artist, song, radio slogan and radio logo) and shares it with the related audio encoder
  • Multiplexer: packs the data from the audio encoders into a DAB/DAB+ ensemble, called Micro DAB
  • Multiplex-manager: allows you to view and modify some multiplex parameters
  • Modulator: creates a modulation data from the multiplexer and sends it to the SDR transceiver card
  • SDR transceiver card: broadcast the DAB ensemble. The initial radio channel is 5A and can be changed, should this channel already be used in your area

Running the DAB service

  • To start all services, I recommend you start the encoders (audio & pad) first, then the multiplexer and finally the modulator
  • To stop all services, I recommend that you do not use the STOP ALL button but that you stop the multiplexer first (this will trigger a clean stop of the modulator). Once the modulator is off, you can use use the STOP ALL button to close the remaining jobs.
  • To start a component, click on that component start action link
  • You can monitor each component output by clicking on the component action Tail -f stdout or Tail -f stderr

Configuration

User access

Supervisor web interface

If you want to change the default user profile and/or user password authorized to access Supervisor, then apply the following command:

sudo sed -e 's/^username = odr/^username = whatever_user/' -e 's/^password = odr/^password = whatever_password/' -i /etc/supervisor/supervisord.conf

Please note that whatever_user is not related to any linux profiles

Encoder-manager web interface

If you want to change the default user profile and/or user password authorized to access Encoder-manager, then apply the following command:

sed -e 's/"username": "odr"/"username": "whatever_user"/' -e 's/"password": "odr"/"password": "whatever_password"/' -i $HOME/dab/conf-em.json

Please note that whatever_user is not related to any linux profiles

Modulator

Improve the RF spectrum

If your hardware/virtual host is powerful enough, then you should set the following 2 parameters in the $HOME/dab/mod.ini file to more stringent value:

  • [modulator] rate=4096000
  • [firfilter] enabled=1

Change the transmission channel

If channel 5A is being used in your area, you can easily switch to a new transmission channel by applying the following command: sed -e 's/^channel=5A/^channel=a_free_channel_in_your_area/' -i $HOME/dab/mod.ini

Change the SOAPYSDR-compatible device

This project is configured for the HackRF One SDR transceiver card.

If you are using another SoapySDR-compatible transceiver card, then apply one of the following commands:

  • LimeSDR: sed -e 's/^device=driver=hackrf/^device=driver=lime/' -i $HOME/dab/mod.ini
  • PlutoSDR: sed -e 's/^device=driver=hackrf/^device=driver=plutosdr/' -i $HOME/dab/mod.ini

Also, check the SoapySDR documentation for your card to set the proper values for other SoapySDR fields, like txgain.

Multiplex

Change the name of the multiplex

If you want to change the name of the multiplex (by default Micro DAB), then change the label and shortlabel values within the ensemble block in file $HOME/dab/conf.mux

View and change some parameters

  1. Start job 21-Multiplex-Manager
  2. Point your web browser to the Multiplex Manager web interface on RaspberryPi or on Virtual host

Encoders (audio & data)

Audio and data

If your Raspberry PI or your virtual host is powerful enough, then you can add more services/sub-channels/components

Encoders

  1. Start job 10-EncoderManager from the Supervisor web access
  2. Point your web browser to the Encoder Manager web interface on RaspberryPi or on Virtual host (default user profile odr and password odr) to manage your audio streams and related PAD.
  3. You can use the excellent radio browser directory to identify the url of the radio audio stream
  4. Test the radio audio stream url with vlc on your computer (not the raspberry) and check the bit rate

Multiplex

  1. Open file $HOME/dab/conf.mux and decide wich service you want to modify (srv-01 or srv-02) and change all parameters (id, ecc, label, shortlabel, pty, language) accordingly. I recommend you use the values mentionned in the official ETSI TS 101 756 document.
  2. If you added more channels, then make sure that the new sub-channels match the new encoders you added previously