Main Content

Common Problems and Fixes

sdrinfo returns empty message after calling step

Problem

Function sdrinfo returns an empty cell array

Possible Solution

The radio may not be connected or configured correctly. Follow these steps to reconfigure the port and radio:

  1. Connect the radio

  2. Install the USB driver.

    On the MATLAB® Home tab, in the Environment section, click Add-Ons > Manage Add-Ons.

  3. The Hardware Setup dialog will open at the Connect Hardware step. Follow the on screen setup steps to install drivers and test the radio connection. After successful test of the radio connection, close the setup dialog.

  4. At the MATLAB command prompt, run sdrsetup.

sdrinfo returns only three radio settings

Problem

Function sdrinfo does not return all radio settings for the specified device.

Possible Solution

sdrinfo returns all valid radio fields that are applicable, as long as the System object™ or block is not open (unlocked). If the block or System object is currently running, sdrinfo returns only the top three fields: RadioName, RadioAddress, and RadioIsOpen.

If this is the case, you can do one of the following actions:

  • Release the System object

  • Stop the model simulation

  • Close the block mask

sdrinfo returns radio ID as “vm”

Problem

In the Zadig software window, the USB driver is reported as RTL2838UHIDIR. When you hover your mouse over vendor ID field (“USB ID” row first text field), it reports the vendor as “VM”.

Possible Solution

This issue can happen sometimes when the VMPlayer is running on Windows®. Turn off the VMplayer and try again. You can start the VMPlayer after your computer recognizes the RTL-SDR radio correctly.

Cannot find radio

Problem

The RTL-SDR radio is attached to your computer but when you run sdrinfo, it returns empty or the info method of an RTL-SDR System object returns "Cannot find radio".

Possible Solution

Unplug the radio and then plug the radio back in again. Be sure to use the same USB slot.

Simulink hangs when radio is removed during simulation

Problem

Simulink hangs if the RTL radio is removed while running a simulation.

Possible Solution

You must terminate the MATLAB session and restart.

In the future, do not remove an RTL radio while it is in use.

Kernel driver is active, or device is claimed by second instance of librtlsdr

Problem

Sometimes the digital TV (DVB) driver takes over. If this is the case, you may see this message in the command shell:

Kernel driver is active, or device is claimed by second instance of librtlsdr.
In the first case, please either detach or blacklist the kernel module
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time.

usb_claim_interface error -6

Possible Solution

Unload the kernel module or prevent it from loading. The listed steps are for manual unloading and to prevent the kernel module from loading.

  • To unload the kernel module:

    sudo rmmod dvb_usb_rtl28xxu rtl2832

    This is a temporary solution, as the system will load the driver again the next time you remove and then replace the USB device.

  • To prevent the kernel module from loading, create a file in /etc/modprobe.d, with a .conf extension (for example, "no-rtl.conf") and include this content:

    blacklist dvb_usb_rtl28xxu
    blacklist rtl2832
    blacklist rtl2830

    The exact method depends on your Linux® distribution. The example shown is for Arch Linux.

    This solution is more convenient if you never plan to use the device for TV reception (though you can always choose to remove the blacklist in the future). If you choose this method, you may have to unload the driver first if it is already in use.

  • To remove the blacklist file:

    • Delete the blacklisting file: sudo rm -f /etc/modprobe.d/no-rtl.conf.

    • Unplug and plug in the radio.

Note

You can also unload and prevent the kernel module from loading by using RTL-SDR support package installer.

On the MATLAB Home tab, in the Environment section, click Add-Ons > Manage Add-Ons. Select the support package then click the Setup button, ().

Package Manager in Use

Problem

This error occurs when another package manager, such as Synaptic, is in use. The message you see might be similar to the following:

Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? 

Possible Solution

To install the support package, close all other package manager software running on your system.

Setup Warns "Xcode not Found" or "Xcode Command Line Tools not Found"

Problem

Xcode software and Command Line Tools are required for setup and installation on Mac OS X systems. If the installer cannot find the Xcode Command Line Tools, you will see the "Xcode Command Line Tools not Found" warning.

Possible Solution

Follow these steps to install the Xcode software and Command Line Tools.

  1. Click Cancel to exit the installation process.

  2. Install the Xcode software.

     Install Xcode Software

  3. Install the Xcode Command Line Tools.

     Install Command Line Tools (OS X version 10.8 and earlier)

  4. Restart the hardware setup.

    On the MATLAB Home tab, in the Environment section, click Add-Ons > Manage Add-Ons. Select the support package then click the Setup button, ().

Note

If you install the Command Line Tools and you still get the "Xcode Command Line Tools not Found" warning, and you have more than one version of Xcode installed, you need to make sure that you select the path to the Xcode version you intend to use with the support package when you install the Command Line Tools.

  1. In a terminal window, enter the following:

    xcode-select --print-path

    This command displays the path to the Xcode version in use.

  2. To change the path to the Xcode version you want to use, enter the following:

    xcode-select --switch xcode_path

    where xcode_path is the path to the Xcode version you want to use.

    When you install the Command Line Tools, make sure that you start the version of Xcode that you specified in this step.

  3. Install Command Line Tools (OS X version 10.8 and earlier)

    When you install the Command Line Tools, first make sure that you start the version of Xcode that you specified in the previous step.

    1. Start Xcode.

    2. Select Xcode > Preferences.

    3. Select Downloads tab.

    4. Click install next to Command Line Tools.

  4. Restart the installer.

    On the MATLAB Home tab, in the Environment section, click Add-Ons > Manage Add-Ons. Select the support package then click the Setup button, ().

No Radios Found

Problem

After installation or when calling the sdrinfo function, no radios can be found. This may be because some USB 3 controllers are not compatible with RTL-SDR radio.

Possible Solution

Try a different port. Your hardware configuration may require you to plug the RTL-SDR device into a USB 2 port.

Invalid MEX-file error

Problem

When attempting to use a MEX-file you created, an error message indicates you are missing the libmwsdrrdriver.dll library. For example, you get a message similar to this one when attempting to run foo:

>> foo
Invalid MEX-file 'foo.mex': Missing dependent shared 
libraries: 
'libmwsdrrdriver.dll' required by 'foo.mex'.

Possible Solution

At the MATLAB command prompt run:

sdrsetup
Found and setup Communications Toolbox™ Support Package for RTL-SDR Radio.

For more information, see sdrsetup.

Test connection fails and displays 'Error Code -12' message

Problem

This error occurs when a test connection fails during the hardware setup process. You might also see this error message after using the sdrinfo command.

Error Code -12

Possible Solution

This error occurs due to a USB connectivity issue. Possible solutions include:

  • If you are using Windows and are using Zadig software to install the driver, try selecting either the RTL283UHIDIR or RTL2832U interfaces (if they are available) instead of "Bulk-In, Interface (Interface 0)". When you select the WinUSB option on the right pane, you might get a warning that a System File is going to be changed while installing the driver. By installing the SDR drivers using Zadig software, you overwrite the default drivers for the device. Depending on how your operating system is set up, you might receive this warning before the start of the installation.

  • If you do not find RTL283UHIDIR or RTL2832U interfaces in the list, navigate to 'Options' and make sure that you select 'List all Devices' and clear 'Ignore Hubs or Composite Parents' check box.

  • If you are using a USB 3.0 port, try plugging the RTL-SDR radio into a USB 2.0 port or try testing the connection on another computer if possible.

  • Unplug the RTL-SDR radio and verify that it disappears from the list. Replug and verify that it again appears in the list.

  • Enter these commands at the MATLAB command prompt:

    rehash toolbox
    rehash toolboxcache

Note

If the hardware setup process does not start the Zadig software, you can start it manually by using this command at the command prompt:

C:\ProgramData\MATLAB\SupportPackages\<version>\3P.instrset\zadig.instrset\...
... zadig\zadig-<version>.exe