PLL lock problem with compiled rtl_sdr.exe

Need help installing or figuring out something about your SDR? Ask here.
Post Reply
otter
Posts: 2
Joined: Sat Mar 07, 2020 1:37 pm

PLL lock problem with compiled rtl_sdr.exe

Post by otter » Sat Mar 07, 2020 2:07 pm

I've newly acquired an RTL-SDR dongle and installed the SDR# software and drivers on a Windows 10 machine following the directions in the Quick Start Guide. I've been able to successfully obtain I/Q samples at the GPS L1 frequency (1575.42 MHz) using the rtl_sdr.exe executable that is created by the driver installation .bat (install_rtlsdr.bat within the sdrsharp-x86.zip download). Running this executable results in:

C:\SDR>rtl_sdr -f 1575420000 -g 50 test.dat
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Sampling at 2048000 S/s.
Tuned to 1575420000 Hz.
Tuner gain set to 49.60 dB.
Reading samples in async mode...
Signal caught, exiting!

I next downloaded the rtl_sdr sourcecode from https://github.com/osmocom/rtl-sdr and compiled it myself. Had to find libusb.dll to successfully build the executable. I was able to get rtl_sdr.exe to run but I get an error message:

C:\C_CODE\rtl_sdr\bin\Release>rtl_sdr -f 1575420000 -g 50 test.dat
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Sampling at 2048000 S/s.
Tuned to 1575420000 Hz.
Tuner gain set to 49.60 dB.
Reading samples in async mode...
Signal caught, exiting!

Questions:
(1) Does anyone have any ideas why I am seeing a "PLL not locked" error when I build my own rtl_sdr.exe, but not when I use the rtl_sdr.exe executable downloaded per the Quick Start Guide?
(2) Has anyone successfully built rtl_sdr.exe on a Windows 10 machine and can point to the version of the source code they used on GitHub?

In case it matters, I compiled the code using Codeblocks/mingw. Thanks for any help you can provide!

tim_rtd
Posts: 115
Joined: Fri Jun 30, 2017 11:34 am

Re: PLL lock problem with compiled rtl_sdr.exe

Post by tim_rtd » Sat Mar 07, 2020 9:25 pm

The PLL not locked is normal for all of us.

otter
Posts: 2
Joined: Sat Mar 07, 2020 1:37 pm

Re: PLL lock problem with compiled rtl_sdr.exe

Post by otter » Fri Mar 20, 2020 1:18 pm

Problem solved. In case anyone else is OCD and would prefer not to see the "PLL not locked" warning, the solution was found at:

https://github.com/roger-/pyrtlsdr/issues/72

Simply swapping the order of the calls to verbose_set_sample_rate and verbose_set_frequency in rtl_sdr.c fixes the problem.

Post Reply