To set up the DAB transmission on the Pi with a HackRF One, I did the following -
1) Build and install SoapySDR -
pothosware/SoapySDR
Some dependencies are required for this -
Code:
sudo apt install cmake g++ libpython-dev python-numpy swig
2) Build and install the SoapySDR HackRF modules -
pothosware/SoapyHackRF
For this you need to have the HackRF drivers -
Code:
sudo apt install hackrf libhackrf-dev
It took a reboot at this stage for SoapySDR to see the HackRF, but after that it picked it up fine.
3) Build and install the OpenDigitalRadio DAB modulation software (ODR-DabMod) -
Opendigitalradio/ODR-DabMod
This had some dependencies too, namely ZeroMQ and FFTW -
Code:
sudo apt install libzmq3-dev fftw3-dev
I disabled UHD output in the config before building as that would have required building more software that I didn't need - I only needed ODR-DabMod to interface with the HackRF via SoapySDR.
Code:
./configure --disable-output-uhd
4) Build and install ETI Tools, to demux the encapsulated DAB streams from satellite -
piratfm/eti-tools
5) Build and install TSNIV2NI -
newspaperman/tsniv2ni - This is another satellite DAB demuxer, it decodes satellite DAB that uses a slightly different format to the ones supported by ETI tools, as explained in the ETI Tools README.
At this point we're ready to modulate a DAB signal from satellite, using ETI Tools/tsniv2ni to get the DAB ensemble in ETI format, and ODR-DabMod to modulate it and transmit it via the HackRF.
6) We need a DAB.ini config file to give ODR-DabMod the configuration of what to transmit (e.g. what DAB frequency, and how much RF amplification to use) and where the input data is coming from.
There's an example.ini file in the doc part of the GIT repository, which I used to create my own, removing the bits I wasn't interested in at this stage. I selected 6C as the channel, purely at random as one that doesn't have anything else on it here. I set the RF power level as pretty low (10) as it's cabled into the receiver so it doesn't need to be very strong. For the input data, I was going to use ZeroMQ, but it turns out that you can just pipe in ETI data directly by setting the input to FIFO. eti_tools/tsniv2ni happily write ETI to STDOUT which makes it nice and simple to link them up.
I left some of the defaults from the sample file.
Code:
[input]
transport=file
source=/dev/stdin
loop=0
[modulator]
gainmode=var
digital_gain=0.8
rate=2048000
[cfr]
enable=0
clip=50.0
error_clip=0.1
[firfilter]
enabled=1
[poly]
enabled=0
[output]
output=soapysdr
[soapyoutput]
device=
master_clock_rate=32768000
txgain=10
channel=6C
7) Finally, I made a shell script to run to pull in a DAB multiplex and transmit it using that config. I use TVHeadend with my PC satellite card, but you can equally stream a transponder carrying a DAB multiplex PID from an Enigma2 box.
An example for the RAI DAB+ multiplex on 5W, the config and tools needed for this are on the eti_tools README documentation.
I use CURL to stream the filtered PID 1000 carrying the DAB data from the transponder (11013V MIS), then the eti_tools tool
ts2na to demux the DAB data from the MPEG-TS packets (with an offset of 0, as shown in the README for this DAB multiplex), then the eti_tools tool
na2ni to output as ETI-NI, which is the correct input format for ODR-DabMod. This then just gets piped into
odr-dabmod which reads the config file, and transmits the multiplex on DAB channel 6C.
Code:
curl -s http://192.168.0.224:9981/stream/mux/f1daa0412bd28c9e108d3fc804ecd2d4?pids=1000 | ts2na -p 1000 -s 0 | na2ni | odr-dabmod dab.ini
For the commercial Italians on 12690V on 5W, this is even more straightforward, as
ts2na and
na2ni can be replaced with just
tsniv2ni and the PID, as this converts them straight to the correct ETI-NI format.
Code:
curl -s http://192.168.0.224:9981/stream/mux/446ab798d96cc90b4f2f1976e7f3e050?pids=4105 | tsniv2ni 4105 | odr-dabmod dab.ini
Provided everything is working, if you attach a cable from the HackRF to a DAB tuner at this point, you should be able to tune in the DAB+ ensemble on 6C.