New (Work In Progress) WebRadio Software for the RTL-SDR Released

Mike Stirling has just released a still in-development version of his Linux based WebRadio software, which supports the RTL-SDR. WebRadio allows someone to connect to a remote RTL-SDR device via a web interface over the internet, much like WebSDR.

There is an installation guide here.

WebRadio

I was able to compile, install and run the software, but there were a few issues that required resolving.

First, after installing all the prerequisite packages via my package manager, and running the configuration as mentioned in the installation guide, I ran ‘make’ and received this error, due to my virtual Linux test machine being 32-bits.

web/httpserver.cxx:116:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned_int}'

I was able to get around this error simply by opening httpserver.cxx, and commenting out line 116, which was just debugging log code.

Next, I ran ‘lsusb -v’ at the terminal, and recorded my RTL-SDRs serial number, under ‘iSerial’, which for me was ‘00000013’.

I then went into the src directory and ran ‘./webradio 00000013’, and tried to connect to 127.0.0.1:8080 in my browser, but the ui.html file could not be found. I discovered I needed to copy the html folder into the src directory. Now the ui.html file showed in the browser, but it did not work. Reading the readme file inside of the html folder showed me that I needed to download JQuery and JQuery UI into the html folder. The Readme file shows exactly how to do this.

After doing that everything works fine and I was able to tune to stations easily. Sound quality is still quite poor, and half the controls don’t seem to do anything yet, but it’s looking great for software still in development.

Subscribe
Notify of
guest

15 Comments
Inline Feedbacks
View all comments
Denis

web/redirecthandler.cxx(55): Redirecting to: /static/ui.html
web/httpserver.cxx(176): status = 302
web/httpserver.cxx(197): Handler supplied location: /static/ui.html
web/httpserver.cxx(201): Full URL for redirect: http://172.16.1.5:8080/static/ui.html
web/httpserver.cxx(134): GET /static/ui.html
web/filehandler.cxx(72): path: html/ui.html, content-type: text/html
web/filehandler.cxx(82): Error opening file: basic_ios::clear
web/httpserver.cxx(176): status = 404

Page in browser:

Error 404

Not found

alex

./webradio 00000001
io/rtlsdrtuner.cxx(47): Found 1 devices
io/rtlsdrtuner.cxx(54): Device 0: 77771111153705700
dsp/dspblock.cxx(75): Added block SpectrumSink:0000 as consumer of RtlSdrTuner:0000
radio.cxx(132): Created front-end 0000
dsp/dspblock.cxx(219): Setting RtlSdrTuner:0000 input sample rate to 2400000
dsp/dspblock.cxx(247): Setting RtlSdrTuner:0000 source block size to 204800
dsp/dspblock.cxx(75): Added block LowPass:0000 as consumer of DownConverter:0000
dsp/dspblock.cxx(75): Added block AMDemod:0000 as consumer of LowPass:0000
dsp/dspblock.cxx(75): Added block LowPass:0000 as consumer of AMDemod:0000
dsp/dspblock.cxx(75): Added block AudioStreamManager:0000 as consumer of LowPass:0000
radio.cxx(89): Created receiver 0000
dsp/dspblock.cxx(75): Added block DownConverter:0000 as consumer of RtlSdrTuner:0000
radio.cxx(155): Added rx 0000 to front-end 0000
web/httpserver.cxx(288): Registered handler for URL:
web/httpserver.cxx(288): Registered handler for URL: static/**
web/httpserver.cxx(288): Registered handler for URL: audio/*
web/httpserver.cxx(288): Registered handler for URL: config
web/httpserver.cxx(288): Registered handler for URL: tuners
web/httpserver.cxx(288): Registered handler for URL: tuners/*
web/httpserver.cxx(288): Registered handler for URL: tuners/*/control
web/httpserver.cxx(288): Registered handler for URL: tuners/*/waterfall
web/httpserver.cxx(288): Registered handler for URL: tuners/*/receivers
web/httpserver.cxx(288): Registered handler for URL: receivers
web/httpserver.cxx(288): Registered handler for URL: receivers/*
web/httpserver.cxx(288): Registered handler for URL: receivers/*/audio.mp3
web/httpserver.cxx(288): Registered handler for URL: receivers/*/audio.ogg
web/httpserver.cxx(274): HTTP interface started on port 8080
dsp/dspblock.cxx(113): Starting block RtlSdrTuner:0000
io/rtlsdrtuner.cxx(195): Subdevice 00000001 not found
dsp/dspblock.cxx(115): Block RtlSdrTuner:0000 failed to initialise
main.cxx(110): Pipeline failed to start
web/httpserver.cxx(249): Stopping HTTP server
dsp/dspblock.cxx(90): Removed block DownConverter:0000 as consumer of RtlSdrTuner:0000
radio.cxx(162): Removed rx 0000 from front-end 0000
radio.cxx(107): Destroyed receiver 0000
radio.cxx(148): Destroyed front-end 0000
main.cxx(129): bye bye!
root@ubuntu:/home/alex/Downloads/webradio/src#

alex

# ./webradio
io/rtlsdrtuner.cxx(47): Found 1 devices
io/rtlsdrtuner.cxx(54): Device 0: 77771111153705700
dsp/dspblock.cxx(75): Added block SpectrumSink:0000 as consumer of RtlSdrTuner:0000
radio.cxx(132): Created front-end 0000
dsp/dspblock.cxx(219): Setting RtlSdrTuner:0000 input sample rate to 2400000
dsp/dspblock.cxx(247): Setting RtlSdrTuner:0000 source block size to 204800
dsp/dspblock.cxx(75): Added block LowPass:0000 as consumer of DownConverter:0000
dsp/dspblock.cxx(75): Added block AMDemod:0000 as consumer of LowPass:0000
dsp/dspblock.cxx(75): Added block LowPass:0000 as consumer of AMDemod:0000
dsp/dspblock.cxx(75): Added block AudioStreamManager:0000 as consumer of LowPass:0000
radio.cxx(89): Created receiver 0000
dsp/dspblock.cxx(75): Added block DownConverter:0000 as consumer of RtlSdrTuner:0000
radio.cxx(155): Added rx 0000 to front-end 0000
web/httpserver.cxx(288): Registered handler for URL:
web/httpserver.cxx(288): Registered handler for URL: static/**
web/httpserver.cxx(288): Registered handler for URL: audio/*
web/httpserver.cxx(288): Registered handler for URL: config
web/httpserver.cxx(288): Registered handler for URL: tuners
web/httpserver.cxx(288): Registered handler for URL: tuners/*
web/httpserver.cxx(288): Registered handler for URL: tuners/*/control
web/httpserver.cxx(288): Registered handler for URL: tuners/*/waterfall
web/httpserver.cxx(288): Registered handler for URL: tuners/*/receivers
web/httpserver.cxx(288): Registered handler for URL: receivers
web/httpserver.cxx(288): Registered handler for URL: receivers/*
web/httpserver.cxx(288): Registered handler for URL: receivers/*/audio.mp3
web/httpserver.cxx(288): Registered handler for URL: receivers/*/audio.ogg
web/httpserver.cxx(274): HTTP interface started on port 8080
dsp/dspblock.cxx(113): Starting block RtlSdrTuner:0000
io/rtlsdrtuner.cxx(195): Subdevice 00000001 not found
dsp/dspblock.cxx(115): Block RtlSdrTuner:0000 failed to initialise
main.cxx(110): Pipeline failed to start
web/httpserver.cxx(249): Stopping HTTP server
dsp/dspblock.cxx(90): Removed block DownConverter:0000 as consumer of RtlSdrTuner:0000
radio.cxx(162): Removed rx 0000 from front-end 0000
radio.cxx(107): Destroyed receiver 0000
radio.cxx(148): Destroyed front-end 0000
main.cxx(129): bye bye!
root@ubuntu:/home/alex/Downloads/webradio/src#

dimitris

i get lost bytes.how i can fix this?
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes

dimitris

dsp/dspblock.cxx(219): Setting AudioStreamManager:0000 input sample rate to 48000
dsp/dspblock.cxx(228): Setting AudioStreamManager:0000 input channel count to 1
dsp/dspblock.cxx(113): Starting block AudioStreamManager:0000
web/mp3encoder.cxx(33): Configuring for 48000 Hz 1 channels
dsp/dspblock.cxx(182): Resizing RtlSdrTuner:0000 buffer to 102400 frames (2 channels)
io/rtlsdrtuner.cxx(73): starting async capture
dsp/dspblock.cxx(182): Resizing SpectrumSink:0000 buffer to 102400 frames (2 channels)
dsp/dspblock.cxx(182): Resizing DownConverter:0000 buffer to 102400 frames (2 channels)
dsp/dspblock.cxx(182): Resizing LowPass:0000 buffer to 10240 frames (2 channels)
dsp/dspblock.cxx(182): Resizing AMDemod:0000 buffer to 10240 frames (1 channels)
io/rtlsdrtuner.cxx(100): Lost 24576 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
dsp/dspblock.cxx(182): Resizing LowPass:0000 buffer to 2048 frames (1 channels)
dsp/dspblock.cxx(182): Resizing AudioStreamManager:0000 buffer to 2048 frames (1 channels)
dsp/dspblock.cxx(99): RtlSdrTuner:0000 344 ns/frame
dsp/dspblock.cxx(99): SpectrumSink:0000 699 ns/frame
dsp/dspblock.cxx(99): DownConverter:0000 141 ns/frame
dsp/dspblock.cxx(99): LowPass:0000 1055 ns/frame
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
dsp/dspblock.cxx(99): AMDemod:0000 146 ns/frame
dsp/dspblock.cxx(99): LowPass:0000 593 ns/frame
dsp/dspblock.cxx(99): AudioStreamManager:0000 198 ns/frame
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 57344 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes
io/rtlsdrtuner.cxx(100): Lost 262144 bytes

Craig

Being that the software is written in HTML5 – As far as i am aware only Chrome supports HTML5 audio.
This could be half the battle for those of you with setup issues, I could be wrong but just throwing it out there.

peter

having a few issues with compliling 12.04 ubuntu 64 bit…
have used the latest version of libmicrohttpd
any ideas …

vk4khp@vk4khp-Aspire-5542:~/webradio$ ./configure
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking for style of include used by make… GNU
checking dependency style of gcc… gcc3
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking dependency style of g++… gcc3
checking for sinf in -lm… yes
checking for lame_init in -lmp3lame… yes
checking for pkg-config… /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking for libmicrohttpd… yes
checking for libfftw3… yes
checking for librtlsdr… yes
checking for libpulsesimple… yes
checking for libjsoncpp… yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
vk4khp@vk4khp-Aspire-5542:~/webradio$ make
make all-recursive
make[1]: Entering directory `/home/vk4khp/webradio’
Making all in src
make[2]: Entering directory `/home/vk4khp/webradio/src’
depbase=`echo main.o | sed ‘s|[^/]*$|.deps/&|;s|\.o$||’`;\
g++ -DHAVE_CONFIG_H -I. -I.. -Wall -Werror -I. -Idsp -Iio -Iweb -Idecoders -I/usr/local/include/ -I/usr/include/libusb-1.0 -D_REENTRANT -I/usr/include/jsoncpp -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.cxx &&\
mv -f $depbase.Tpo $depbase.Po
In file included from web/httpserver.h:34:0,
from main.cxx:32:
/usr/include/microhttpd.h:830:5: error: ‘uint64_t’ has not been declared
/usr/include/microhttpd.h:868:46: error: ‘uint64_t’ has not been declared
/usr/include/microhttpd.h:1085:57: error: ‘uint64_t’ was not declared in this scope
/usr/include/microhttpd.h:1086:64: error: expected primary-expression before ‘block_size’
/usr/include/microhttpd.h:1088:57: error: expected primary-expression before ‘crc’
/usr/include/microhttpd.h:1088:62: error: expected primary-expression before ‘void’
/usr/include/microhttpd.h:1090:57: error: expected primary-expression before ‘crfc’
/usr/include/microhttpd.h:1090:61: error: expression list treated as compound expression in initialiser [-fpermissive]
In file included from main.cxx:32:0:
web/httpserver.h:117:51: error: ‘uint64_t’ has not been declared
web/httpserver.h:140:32: error: ‘uint64_t’ has not been declared
make[2]: *** [main.o] Error 1
make[2]: Leaving directory `/home/vk4khp/webradio/src’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vk4khp/webradio’
make: *** [all] Error 2

Der Thom

Hi. I build the package on Raspberr Pi yesterday. If I call the web interface from another computer I get this as result: http://www.pictureupload.de/originals/pictures/120414224934_crap.png

No sound. No waterfall. Nothing happens. I didn’t build libmicrohttpd myself, yet. Should this be the problem? Or is webradio only able to run local on the RPi? Not via LAN/WLAN?

Somer

@mars, you need to install libmicrohttpd-dev

apt-get install libmicrohttpd-dev

but i recommend you compile the microhttpd from the source since microhttpd.h that comes with ubuntu is old and does not play good with this WebRadio software.

Here is the package, ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.20.tar.gz

as usual, ./configure;make

Cheers

mars

Thanks. I did install libmicrohttpd but the build must have failed somewhere. I’ve got it working but there is no sound. Very cool!

Somer

I got sound with google chrome only, no sound with firefox, maybe you should try it with chrome too.

And thanks for adding this and other great information here rtl-sdr.com. Keep it up, this software looks very promising.

mars

I am using Chrome and an android phone. The streaming box doesnt do anything when I click play and the speaker wont un-mute. I must be missing something to do with lame or the stream server.

mars

I am having trouble getting this to run. It can’t find libmicrohttpd.so.10. Do I need to create a symbolic link? I am on 32 bit Ubuntu 12.04 LTS. I also get a 64bit errror. Not the same one posted in the article tho. I am very excited to get this working!