Skip to content

Instantly share code, notes, and snippets.

@ajmas
Last active September 22, 2023 07:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajmas/144719991f54931b99de43efae13389f to your computer and use it in GitHub Desktop.
Save ajmas/144719991f54931b99de43efae13389f to your computer and use it in GitHub Desktop.
Instructions on how to build RTL-SDR using MacPorts based dependencies

rtl-sdr build notes for OSX

Building

sudo port install cmake
sudo port install libusb
sudo port install pkgconfig
sudo port install sox # for easy audio
git clone git://git.osmocom.org/rtl-sdr.git

export LIBRARY_PATH=/opt/local/lib
cd rtl-sdr/
mkdir build
cd build/
cmake ../

make
sudo make install

Search Path

By default this will install into /usr/local. If you don't have /usr/local/bin in your PATH environment variable:

export PATH=$PATH:/usr/local/bin

If you don't want /usr/local used, then you can specify the alternativae based path prior to running the cmake command by setting the CMAKE_INSTALL_PREFIX environment variable. Be sure the build folder is empty prior to running the cmake command.

Testing

Now we will test, but first ensure your RTL-SDR device is connected:

rtl_test -t

On my Mac (2019 16" MacBook Pro, running macOS 10.15.3, aka Catalina) this gave me:

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Terratec T Stick PLUS
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0 
Sampling at 2048000 S/s.
Benchmarking E4000 PLL...
[E4K] PLL not locked for 52000000 Hz!
^CSignal caught, exiting!
[E4K] PLL not locked for 2211000000 Hz!
[E4K] PLL not locked for 1106000000 Hz!
[E4K] PLL not locked for 1247000000 Hz!
E4K range: 53 to 2210 MHz
E4K L-band gap: 1106 to 1247 MHz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment