Want to add DAB+ radio receiver

Dutch radio has recently opened DAB+ channels on a large scale. This would of course save the data traffic and probably offer a better audio quality, compared to the web-radio system we currently run. A USB donge for this system is rather cheap, like

RTL2832U + R820T Mini DVB-T + DAB + + FM USB digitale TV Dongle - zwart

http://www.dx.com/nl/p/rtl2832u-r820t-mini-dvb-t-dab-fm-usb-digital-tv-dongle-black-170541#.VsB23xiIM4o

The linux kernel has support for it… what a coincidence. Now all we’d need is the Volumio interface to tweak a little to support this little friend. Anyone a clue?

1 Like

Hi,
“a little” is not the correct phrase for this. :slight_smile:

First you have to think about the GUI structure:

  • Do you want to be able to control the whole DAB+ thing over volumio?
  • Do you want to display the DAB+ side information like texts, images, etc on the web interface?
  • How do you want to implement channel scanning?

Then there are several technical things to consider:

  • How does the kernel module provide DAB+ radio?
  • Can this audio output be connected with mpd?
  • If not, will concurrent playback be possible? (play DAB, then switch to MP3 or sth. else)

I think the main problem here is that DAB+ radio is implemented via separate audio devices. Volumio’s webinterface currently controls mpd only and if you want to add DAB to the webinterface you have to do a big rework. Also you have to handle the concurrency problem: If MPD plays audio, it uses the ALSA module to playback. If you switch to DAB+ you have to ensure that the playback is stopped and that MPD releases the ALSA connection or you will not be able to playback any sound via DAB+. Maybe there is a way to configure MPD for pulse audio but that will be additional effort.

Switching between DAB+ and MPD shouldn’t be to much of a challenge, this is already done for Spotify playback and MPD.
Spotify itself claims ALSA as does MPD, there just forced to release ASLA before the other starts.

should be a very great option…

1 Like

You might want to check out this thread:

github.com/Opendigitalradio/dablin/issues/4

With a small python wrapper script, you could make all your DAB+ radio stations available via http streaming urls.
You then just add those urls to your favorite streams.

the following is just a mockup and not tested

import BaseHTTPServer
import time
import sys

HOST_NAME = '192.168.1.11' 
PORT_NUMBER = 8000
CHANNELS = {"/station1/": " -c 7D -s 0xD332 ",
                "/station2/": " -c 7D -s 0xD332 "}

class RedirectHandler(BaseHTTPServer.BaseHTTPRequestHandler):
    def do_HEAD(s):
        s.send_response(301)
        subprocess.run(["killall", "dablin"])
        subprocess.run(["dablin"],CHANNELS.get(s.path)+"  -d /path/to/dabtools/src/dab2eti  -p | cvlc --file-caching=5000 --network-caching=5000 --sout-keep --demux=rawaud --rawaud-channels 2 --rawaud-samplerate 48000 --rawaud-fourcc fl32 stream:///dev/stdin --no-sout-video --sout '#transcode{acodec=mp3,ab=196,channels=2,samplerate=44100}:std{access=http,mux=mp3,dst=:8080/stream.mp3}' :no-sout-rtp-sap :no-sout-standard"
        s.send_header("Location", "http://192.168.1.11:8080/stream.mp3")
        s.end_headers()
    def do_GET(s):
        s.do_HEAD()
2 Likes