LuaRadio SDR – Goodbye GNURadio?

Since I haven’t gotten my SDR working correctly, one of my colleges recommended LuaRadio SDR as opposed to GNURadio

I had tried GNURadio off and on, but was never even able to get a basic hello world to work. Even tuning to basic FM radio stations in my area led to static or weird errors.

That said, it seemed that LuaRadio might be even easier, and finally let me see what my SDR could do.

Connection

First, I hooked up the device to my Macbook (yay dongles).

LuaRadio SDR - Connected

Installation

Once I had everything connected, it was time to install LuaRadio

Rays-MacBook-Pro:Downloads doyler$ brew install luaradio
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).

...

==> Installing dependencies for luaradio: luajit, fftw
==> Installing luaradio dependency: luajit





Rays-MacBook-Pro:Radio doyler$ luaradio test.lua
Warning: neither libliquid nor libvolk found. LuaRadio will run without acceleration.
luajit: [string "radio.blocks.sinks.gnuplotspectrum"]:0: gnuplot not found. Is gnuplot installed?
stack traceback:
  [C]: in function 'assert'
  [string "radio.blocks.sinks.gnuplotspectrum"]: in function 'initialize'
  [string "radio.core.composite"]: in function '_prepare_to_run'
  [string "radio.core.composite"]: in function 'start'
  [string "radio.core.composite"]: in function 'run'
  test.lua:17: in main chunk
  [C]: in function 'dofile'
  /usr/local/bin/luaradio:105: in main chunk
  [C]: at 0x0100fd7960
Rays-MacBook-Pro:Radio doyler$ brew install gnuplot

...

Errors, errors, errors

After (I thought) I had everything installed, it was time to create an FM receiver and listen to the radio!

Unfortunately, a few more errors occurred.

Rays-MacBook-Pro:Radio doyler$ vi rtlsdr_wbfm_mono.lua
Rays-MacBook-Pro:Radio doyler$ luaradio rtlsdr_wbfm_mono.lua
Warning: neither libliquid nor libvolk found. LuaRadio will run without acceleration.
Usage: rtlsdr_wbfm_mono.lua 
Rays-MacBook-Pro:Radio doyler$ luaradio rtlsdr_wbfm_mono.lua 95.3e6
Warning: neither libliquid nor libvolk found. LuaRadio will run without acceleration.
luajit: [string "radio.blocks.sources.rtlsdr"]:0: RtlSdrSource: librtlsdr not found. Is librtlsdr installed?
stack traceback:
  [C]: in function 'error'
  [string "radio.blocks.sources.rtlsdr"]: in function 'initialize'
  [string "radio.core.composite"]: in function '_prepare_to_run'
  [string "radio.core.composite"]: in function 'start'
  [string "radio.core.composite"]: in function 'run'
  rtlsdr_wbfm_mono.lua:34: in main chunk
  [C]: in function 'dofile'
  /usr/local/bin/luaradio:105: in main chunk
  [C]: at 0x0109407960
Rays-MacBook-Pro:Radio doyler$ brew install librtlsdr

...

After I had all the pre-requisites properly installed, I tuned to a local radio station.

I was still getting some issues with the audio, but the internet recommended installing pulseaudio as well.

Rays-MacBook-Pro:Radio doyler$ luaradio rtlsdr_wbfm_mono.lua 95.3e6
Warning: neither libliquid nor libvolk found. LuaRadio will run without acceleration.
Found Rafael Micro R820T tuner
Exact sample rate is: 1102500.002464 Hz
^C[RtlSdrSource] Block runtime error: [string "radio.blocks.sources.rtlsdr"]:0: rtlsdr_read_async(): -5
stack traceback:
  [C]: in function 'error'
  [string "radio.blocks.sources.rtlsdr"]: in function 'run'
  [string "radio.core.composite"]: in function <[string "radio.core.composite"]:0>
  [C]: in function 'xpcall'
  [string "radio.core.composite"]: in function 'start'
  [string "radio.core.composite"]: in function 'run'
  rtlsdr_wbfm_mono.lua:34: in main chunk
  [C]: in function 'dofile'
  /usr/local/bin/luaradio:105: in main chunk
  [C]: at 0x0107de4960
Rays-MacBook-Pro:Radio doyler$ brew install pulseaudio
==> Installing dependencies for pulseaudio: libtool, json-c, flac, libogg, libvorbis, libsndfile, libsoxr, speexdsp
==> Installing pulseaudio dependency: libtool

Success!

When it was all said and done, I was able to tune to a local radio station, and get an audio file!

Rays-MacBook-Pro:Radio doyler$ luaradio rtlsdr_wbfm_mono.lua 105.1e6
Warning: neither libliquid nor libvolk found. LuaRadio will run without acceleration.
Found Rafael Micro R820T tuner
Exact sample rate is: 1102500.002464 Hz
^C[RtlSdrSource] Block runtime error: [string "radio.blocks.sources.rtlsdr"]:0: rtlsdr_read_async(): -5
stack traceback:
  [C]: in function 'error'
  [string "radio.blocks.sources.rtlsdr"]: in function 'run'
  [string "radio.core.composite"]: in function <[string "radio.core.composite"]:0>
  [C]: in function 'xpcall'
  [string "radio.core.composite"]: in function 'start'
  [string "radio.core.composite"]: in function 'run'
  rtlsdr_wbfm_mono.lua:34: in main chunk
  [C]: in function 'dofile'
  /usr/local/bin/luaradio:105: in main chunk
  [C]: at 0x010410e960

Conclusion

That said, there were still a few issues with this method.

The first was that even though a number of local radio stations in my area, I was only able to get a handful of them clearly.

Additionally, I was unable to get the audio to actually stream, but rather output to a file.

Other than that, it was very exciting to get my SDR actually working.

I believe I may need an antenna of some sort to continue my experimentation, as that could be my issue.

Let me know if you have any other suggestions or ideas for things that I can try!

doyler on Githubdoyler on Twitter
doyler
Ray Doyle is an avid pentester/security enthusiast/beer connoisseur who has worked in IT for almost 16 years now. From building machines and the software on them, to breaking into them and tearing it all down; he's done it all. To show for it, he has obtained an OSCP, eCPPT, eWPT, Security+, ICAgile CP, ITIL v3 Foundation, and even a sabermetrics certification!

He currently serves as a Senior Penetration Testing Consultant for SecureWorks. His previous position was a Senior Penetration Tester for a major financial institution.

When he's not figuring out what cert to get next (OSCE?!) or side project to work on, he enjoys playing video games, traveling, and watching sports.

Leave a Comment

Filed under Security Not Included

Leave a Reply

Your email address will not be published. Required fields are marked *

*