Digital radio is transmitted in most Australian cities using the DAB+ standard. Off the shelf DAB+ radios are a bit expensive, but it’s possible to listen to DAB+ broadcasts using a computer and an inexpensive Software Defined Radio (SDR) dongle. A desktop or a laptop computer can be used, but something as basic as a Raspberry Pi works just fine. To find a dongle, search eBay or the like for ‘r820t’ and you’ll find a range of devices costing anywhere from about AUD$10 to as much as AUD$50. A ten dollar dongle is just fine for DAB.
This setup will work on a Raspberry Pi 2, but the new Raspberry Pi 3 is faster and has built-in wifi which makes setting it up a lot easier.
Things you need
- SDR dongle and its antenna
- Raspberry Pi 3
- Power supply for the Pi
- HDMI cable
- Keyboard and mouse
- 8GB or bigger micro SD card
- Laptop or desktop computer to set up the SD card
- TV or monitor with HDMI input
If you’re using a monitor rather than a TV, you may need headphones because many monitors will have a headphone socket but no speakers. Also, a short USB extension cable can be useful if you can’t get the keyboard, mouse and dongle to play nice with the closely spaced USB sockets on the Pi.
In summary, here’s what needs to be done. On a computer with access to the Internet and a micro SD card slot, download an Operating System for the Raspberry Pi and copy it to the micro SD card. Plug the card into the Raspberry Pi, configure the Pi, update its Operating System, install a bunch of software that the DAB+ receiver software needs, then download and build the DAB+ software.
Start by downloading the latest full version of the Raspbian Desktop from the raspberrypi.org web site. It’s a zip file, so once it’s downloaded, unzip it. I’m using my laptop running Korora 24 linux for this.
This results in a file of about 4 gigabytes called 2016-05-27-raspbian-jessie.img which needs to be copied to the micro SD card.
Before you plug the micro SD card into your computer, run the df command to see what block devices are mounted. Then plug the card in and run df again. The extra device that’s listed is your card, possibly something like /dev/sdb1. Unmount the card if it auto-mounted.
Use the dd command to copy the image file to the card. Recent versions of dd support the handy status=progress option which lets you easily keep tabs on how it’s going. It will take a few minutes to do and don’t forget to let the sync finish before you unplug the card.
sudo dd if=2016-05-27-raspbian-jessie.img of=/dev/sdb bs=4M status=progress && sync
Now the fun stuff begins. Plug the micro SD card into its slot on the Raspberry Pi, Connect the HDMI, keyboard, mouse and finally connect the power. With any luck, you’ll see the Pi booting up and it should go straight to a desktop. Click on the network icon at the top right of the screen, select your network and give it your network password to get connected. Open a terminal and:
sudo su - raspi-config
Out of the box the raspbian OS is set up for a UK locale and keyboard, so I use the raspi-config tool to set my AU locale and US keyboard layout. Then select the ‘resize root file system’ option to maximise the use of the SD card, exit the tool and reboot.
Once it’s rebooted, update the Operating System.
sudo su - apt-get update && apt-get dist-upgrade -y
Now install the stack of dependencies that the DAB+ software needs in order to build:
apt-get install -y vim qt5-default qt5-qmake libusb-1.0-0 libusb-1.0-0-dev \ portaudio19-dev faad libfaad-dev libsndfile1-dev \ sndfile-tools librtlsdr0 librtlsdr-dev libfftw3-3 libfftw3-dev
The SDR-J software
The DAB+ receiver software is the Open Source SDR-J project. It’s author, Jan van Katwijk, has a range of interesting software tools that you can read about on his site. We want the Raspberry Pi version of his DAB+ software.
git clone https://github.com/JvanKatwijk/dab-rpi cd dab-rpi
There are quite a few README files. It may be useful to read a few of them.
The last piece of config is done by editing the dab-rpi.pro file.
Just comment out the lines for sdrplay and airspy because they’re other (more expensive) SDR devices that we’re not setting up here.
Finally, it’s time to build the software.
Watch a great deal of compiler output streaming past for a few minutes. Once it’s finished (hopefully without major errors)…
cd linux-bin ./dab-rpi-0.997
You should see a bunch of text stream past in the console, then a GUI should open that you can navigate with a mouse.
Select dabstick as your input source, select your audio device, select your channel group and click Start. I used the Wikipedia DAB+ page to work out that the channel group I need for Canberra is 10B. If you exit the app via the Quit button, it will write a config file to ~/.dab-rpi.ini with your settings so that the next time you run it you won’t need to set it up again.
Tip: To route the audio to the Raspberry Pi’s 3.5mm headphone socket instead of HDMI, do this before you start dab-rpi.
amixer cset numid=3 1