SOLUTION-Installation of Direct Frequency Control Drivers

Need help installing or figuring out something about your SDR? Ask here.
Post Reply
N4HCI
Posts: 10
Joined: Mon Jan 28, 2019 10:44 am

SOLUTION-Installation of Direct Frequency Control Drivers

Post by N4HCI » Sun Feb 10, 2019 1:34 pm

This posting provides the consolidated solution to installing modified RTL-SDR V3 drivers that provide the ability to implement direct frequency control from the terminal command line. There are several other postings by me seeking help with this installation. This is the summary lesson learned from those other postings.

Background:
The normal Osmocom RTL-SDR V3 drivers, downloaded when using the following command and then installed via the following terminal commands, provide command line control of the RTL-SDR V3 dongle but it DOES NOT provide direct frequency control from the command line. NOTE: Various programs like CubicSDR can effect direct frequency control of the dongle at this point.]

Initial Successful Installation (No direct frequency control command line capability provided) Steps:
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/

Then blacklist the default driver that is automatically loaded for using the dongle as a TV device as it does not work for for SDR purposes and clashes with the Osmocom drivers just installed
a. open your /etc/modprobe.d folder as an administrator
b. create a new file 'blacklist-rtl.conf' and add this one line:
blacklist dvb_usb_rtl28xxu
c. Save the file, close the editor, and restart the machine.

At this point, the original osmocom drivers should work but without the Direct Frequency control from the command line. This can be tested with the command
rtl_test -t

Modified Osmocom drivers (DOES PROVIDE direct frequency control command line capability):
A modified set of drivers is available at https://www.rtl-sdr.com/rtl-sdr-blog-v- ... ser-guide/. Look for section titled "Modified rtl_tcp for direct sampling", which is the last topic in the 'Feature 1' discussion.

These driver files are provided in a zip file format. When downloaded, and unzipped, the files and directories are located under a top level directory titled 'pkg-rtl-sdr'.

How to Install the Modified Osmocom drivers from the unzipped files.
Assumptions:
a. you are logged in as a user named - user
b. the unzipped directory and its subdirectories are listed in the user default directory (/home/user/) with a top level directory name of 'pkg-rtl-sdr'
c. the user may, or may not, have previously installed the standard osmocom drivers as described in the Background section above. If these drivers were installed, there will be a directory named 'rtl-sdr' in the user default directory (/home/user/)

Steps to install drivers from unzipped 'pkg-rtl-sdr'
1. if there is a directory named 'rtl-sdr' (without single quotes) in the user default directory, remove it with the following command [NOTE: you will need to confirm the deletion of various write protected files during the process.]
rm -r rtl-sdr
2. copy the directory named 'pkg-rtl-sdr' to a new directory named 'rtl-sdr' using the command [Note: this retains a copy of the original 'pkg-rtl-sdr' directory and creates a new copy of it.]
cp -r pkg-rtl-sdr rtl-sdr
3. change directory to the new rtl-sdr and confirm that there is a 'build' directory in the listing.
cd rtl-sdr
4. remove the existing 'build' directory using the command
rm -r build
[NOTE: This is necessary because when the author posted the modified drivers, he apparently did it from his root directory and when you try to make and install these files, you will get errors to an expected set of 'root' conditions. By the way, these modified drivers are attributed to Pieter-Tjerk (PA3FWM) but he denies that he created or provided these modified drivers. He was, however, the one who figured out how to install them from the zip files and with the problematic references to various /root/ conditions.]
5. create a new 'build' directory
mkdir build
6. change directory to the new 'build' directory
cd build
7. from here, everything works as expected. Perform the following steps from the original installation steps.
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/

Then blacklist the default driver that is automatically loaded for using the dongle as a TV device as it does not work for SDR purposes and clashes with the Osmocom drivers just installed
a. open your /etc/modprobe.d folder as an administrator
b. create a new file 'blacklist-rtl.conf' and add this one line:
blacklist dvb_usb_rtl28xxu
c. Save the file, close the editor, and restart the machine.
8. test the driver installation with 'rtl_test -t' The test will report that PLL is not locked and that no E4000 tuner was found, and then that it is aborting the test. This is normal.
9. confirm that the drivers include a direct frequency control option
rtl_tcp -h

This will give you the following output:
rtl_tcp, an I/Q spectrum server for RTL2832 based DVB-T receivers

Usage: [-a listen address]
[-p listen port (default: 1234)]
[-I infrared sensor listen port (default: 0=none)]
[-W infrared sensor query wait interval usec (default: 10000)]
[-f frequency to tune to [Hz]]
[-g gain in dB (default: 0 for auto)]
[-s samplerate in Hz (default: 2048000 Hz)]
[-b number of buffers (default: 15, set by library)]
[-l length of single buffer in units of 512 samples (default: 32 was 256)]
[-n max number of linked list buffers to keep (default: 500)]
[-w rtlsdr tuner bandwidth [Hz] (for R820T and E4000 tuners)]
[-d device index (default: 0)]
[-P ppm_error (default: 0)]
[-T enable bias-T on GPIO PIN 0 (works for rtl-sdr.com v3 dongles)]
[-D direct_sampling_mode (default: 0, 1 = I, 2 = Q, 3 = I below threshold, 4 = Q below threshold)]
[-D direct_sampling_threshold_frequency (default: 0 use tuner specific frequency threshold for 3 and 4)]
[-v increase verbosity (default: 0)]

Note the command option '-D' which provides the command line direct frequency control mode (e.g. rtl_tcp -D2)

Bob Goodwin, N4HCI

Post Reply