Mictronics - DIY Electronic projects and more.

DAB/DAB+ Radio broadcast - DIY

How to broadcast DAB/DAB+ digital radio via LimeSDR and Raspberry Pi. A nice project for my new LimeSDR Mini. I followed basically the tutorial Digital Radio Broadcasting Using LimeSDR and ODR Tools written Godfrey L. Some fine tuning was necessary during installation and configuration of ODR tools.

Please read the above linked tutorial before you start as it provides some fundamentals and additional insides on DAB/DAB+ not covered here.

The ODR tools configuration has been improved for running the tool chain with EDI connection (instead of ZeroMQ) and includes the ODR padding encoder with DLS text and slides transmission. The full running image is available for download below and was tested on Raspberry Pi 3 and 4 running dietpi Debian Buster.

ODR tool chain broadcasting the DAB stream
ODR tool chain broadcasting the DAB stream

welle.io with simple RTL-SDR on a Windows environment was used for test reception.

welle.io receiving on a Windows environment
welle.io receiving on a Windows environment

The SD card image and example configuration stream famous CRIK FM - The Lynx via DAB. The Raspberry Pi needs an internet connection for that.

Build ODR tool chain #

#
# Build on Raspberry Pi OS armv6 32-bit
#
# ODR-audioenc fails with SEGFAULT in libasound.so when build on Raspberry Pi OS armv8 64-bit
#

cd /home/dietpi/
mkdir DAB
cd DAB

# Build dependencies

sudo apt-get -y --no-install-recommends --no-install-suggests install build-essential git wget automake cmake
sudo apt-get -y --no-install-recommends --no-install-suggests install libtool libzmq3-dev libzmq5 libcurl4-openssl-dev
sudo apt-get -y --no-install-recommends --no-install-suggests install alsa-tools alsa-utils libasound2 libasound2-dev libjack-jackd2-dev jackd2
sudo apt-get -y --no-install-recommends --no-install-suggests install libvlc-dev vlc-data vlc-plugin-base
sudo apt-get -y --no-install-recommends --no-install-suggests install libboost-all-dev

# ODR-mmbTools

git clone https://github.com/Opendigitalradio/fdk-aac.git
cd fdk-aac
git checkout dabplus
./bootstrap
./configure
make -j4
sudo make install
sudo ldconfig

git checkout dabplus2
./bootstrap
./configure
make
sudo make install
sudo ldconfig

cd ~/DAB
git clone https://github.com/Opendigitalradio/ODR-AudioEnc.git
cd ODR-AudioEnc
git checkout next
./bootstrap
./configure --enable-alsa --enable-jack --enable-vlc
make -j4
sudo make install
sudo ldconfig

cd ~/DAB
git clone https://github.com/Opendigitalradio/ODR-DabMux.git
cd ODR-DabMux
git checkout next
./bootstrap.sh

# On Raspberry Pi OS armv6:
./configure --with-boost-libdir=/lib/arm-linux-gnueabihf/

# On Raspberry Pi OS armv8
./configure

make
sudo make install
sudo ldconfig

# HackRF support (optional)

cd ~/DAB
sudo apt-get install libusb-1.0-0-dev libfftw3-dev
git clone https://github.com/mossmann/hackrf.git
cd hackrf/host
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig

# SoapySDR

cd ~/DAB
sudo apt-get -y install libpython-dev python-numpy swig
git clone https://github.com/pothosware/SoapySDR.git
cd SoapySDR
mkdir build
cd build
cmake ..
make -j4
sudo make install
sudo ldconfig

# SoapySDR HackRF support (optional)

cd ~/DAB
git clone https://github.com/pothosware/SoapyHackRF.git
cd SoapyHackRF
mkdir build
cd build
cmake ..
make
sudo make install

# SoapySDR LimeSDR support

cd ~/DAB
sudo apt-get install libsqlite3-dev libi2c-dev
git clone https://github.com/myriadrf/LimeSuite.git
cd LimeSuite
git checkout master
mkdir builddir
cd builddir
cmake ../
make -j4
sudo make install
sudo make config
cd ..
cd udev-rules
sudo ./install.sh

# ODR-DABMOD

cd ~/DAB
git clone https://github.com/Opendigitalradio/ODR-DabMod.git
cd ODR-DabMod
git checkout next
./bootstrap.sh

# On Raspberry Pi OS armv6
./configure --disable-output-uhd --enable-limesdr --with-boost-libdir=/lib/arm-linux-gnueabihf/

# On Raspberry Pi OS armv8
./configure --disable-output-uhd --enable-limesdr

make
sudo make install
sudo ldconfig

# ODR-PADENC

cd ~/DAB
git clone https://github.com/Opendigitalradio/ODR-PadEnc.git
cd ODR-PadEnc
git checkout next
./bootstrap
./configure
make
sudo make install
sudo ldconfig

# Configuration

cd ~/DAB/configs

Configuration #

odr-dabmux #

DAB service names and labels can be changed in ~/DAB/configs/dabmux.mux. See ODR-DabMux wiki and Github for details.

general {
    dabmode 1
    nbframes 0
    tist true
    tist_offset 0
}
remotecontrol { telnetport 0 }
ensemble {
    id 0x4fff
    ecc 0xec
    local-time-offset auto
    international-table 1
    label "DAB+ Radio Test"
    shortlabel "DAB+Test"
}
services {
    srv-p1 {
       label "CRIK FM-The Lynx"
       shortlabel "The Lynx"
       pty_sd static
       pty 27
    }
}
subchannels {
    sub-p1 {
        ;  MPEG
        type dabplus
        bitrate 64
        id 1
        protection 3

	inputuri "tcp://*:9001"
        inputproto edi
        buffer-management prebuffering
        buffer 40
        prebuffering 20
    }
}
components {
    comp-p1 {
        service srv-p1
        subchannel sub-p1
    }
}
outputs {
    edi {
       destinations {
           output_tcp {
              protocol tcp
              listenport 9201
           }
       }
       enable_pft false
       fec 0
    }
    throttle "simul://"
}
odr-dabmod #

Configuration for the DAB modulator is stored in file ~/DAB/configs/dabmod.ini. See ODR-DabMod wiki and Github for details.

The DAB channel, hence the transmission frequency can be changed by modifying channel=5C in ~/DAB/configs/dabmod.ini.

[remotecontrol]
telnet=0
telnetport=2121
zmqctrl=0
zmqctrlendpoint=tcp://127.0.0.1:9400

[log]
syslog=0
filelog=0
filename=odr-dabmod.log

[input]
transport=edi
source=tcp://localhost:9201
edi_max_delay=240

[modulator]
gainmode=var
digital_gain=0.8
rate=2048000

[cfr]
enable=0
clip=50.0
error_clip=0.1

[firfilter]
; Disable on Raspberry Pi 3, CPU overload
; Use hardware FIR in LimeSDR below
enabled=0

[poly]
enabled=0
polycoeffile=polyCoefs

[output]
;output=soapysdr
output=limesdr

[soapyoutput]
device=
master_clock_rate=32768000
txgain=90
channel=5C

[delaymanagement]
synchronous=0
mutenotimestamps=0
offset=0.002

[limeoutput]
; Lime output directly runs against the LMS device driver. It does not support SFN nor predistortion.
device=
master_clock_rate= 32768000

; txgain range: 0 .. 100
txgain=90
tx_antenna=BAND1
channel=5C

; The LimeSDR contains a FIR filter in FPGA that can be used to filter the IQ signal.
; This is useful because it allows us to upsample in a very cheap way in software instead
; of using the FFT-based resampler.
upsample=1

[tii]
enable=0
comb=1
pattern=11
old_variant=0
odr-padenc #

The DLS text for padding encoder is stored in file ~/DAB/configs/dls.txt. Change and add lines as desired. All images, logo etc. shall be stored in ~/DAB/configs/slide. Accepted format is JPEG or PNG with a recommended size of 320x240 pixel. Images are send in raw format. See ODR-PadEnc wiki and Github for details.

odr-audioenc #

The -v "http://fusion.shoutca.st:8086" option defines the audio stream source. Modify to stream something else than CRIK FM.

Changing the audio bitrate requires modification of -b 64 option and in addition the bitrate of the sub-channel in ~/DAB/configs/dabmux.mux needs to be modified for an equal value.

Run #

Open 4 terminals to run the ODR tool chain in the following order:

1. dietpi@dabbox:~/DAB/configs $ sudo odr-dabmux dabmux.mux
2. dietpi@dabbox:~/DAB/configs $ odr-padenc -R -o thelynx -t dls.txt -d ./slides
3. dietpi@dabbox:~/DAB/configs $ odr-audioenc -v "http://fusion.shoutca.st:8086" -r 48000 -c 2 -e "tcp://localhost:9001" -l -b 64 -p 128 -P thelynx
4. dietpi@dabbox:~/DAB/configs $ sudo odr-dabmod -C dabmod.ini

Download #

A full running image is available for download and includes all the installations described above. Runs on Raspberry Pi 3 and 4 and requires a LimeSDR (Mini) for DAB/DAB+ streaming.

=> Click to download image <=

Based on DietPi v7.3.2, Debian Buster armv6 32-bit

root user credentials:
username = root
password = dietpi

non-root user credentials:
username = dietpi
password = dietpi

All installation repositories are saved in ~/DAB.

👈 Home