SDR Banner
Softrock Ensemble II

Softrock SDR on Linux


Installing Softrock on Linux like Ubuntu or Raspian

BUY AMERICAN!

 

Two years ago , I built the Tony Parks Softrock Ensemble II Software Defined Radio. My first installation was on a Windows XP system using the HDSDR Software. I later progressed to use the SDR-Radio server software to allow users on the internet to access my tuner. This software was relatively bullet proof and the installation was pretty simple. I was up and running in no time. One of my goals is to create a web applet for my website, www.n8mdp.com , which controls the SDR and includes the one feature that I am very impressed with, the waterfall display.

I have been searching for a good applet that I can embed in my website or could use with a software appliation or even on a tablet that is simple to install. I am not a professional programmer but I am not afraid to dive into coding. From what I have read so far on-line, there is a lot of activity in the Linux world for the development of SDR applications, including servers and client software. I read quite a bit of the work by John Melton, G0ORX, not only with Linux applications but also his attempt to program an SDR application using the Raspberry Pi Single board computer a few years ago.

Unfortunately, and I was not the only one thinking the same way, there was a definite lack of good instructions for installing SDR software on a Linux system. As a newbie to using Linux, I wanted to experiment with running an SDR on Linux. It is for that reason that I created this webpage to document my trials and tribulations for getting my Softrock Ensemble II running on Ubuntu. I will explore the different tools that I plan to use and how worked to install the programs. I documented my work completely. Even when I ran into trouble, I documented the problems with the hope that you can learn from my mistakes and successes.

This article originally assumed that Ubuntu 12.04 is installed. My installation at the time was a fresh install of Ubuntu 12.04. It is suggested that you install the latest updates for your Ubuntu just to be on the safe side.The instructions should work with the latest version of Ubuntu but I have not installed it yet.

Installing the initial software and attempting initial communication with the Softrock Ensemble

One of the first steps that I believe that must be accomplished is to establish basic control of the Softrock. My research found that the first step in order to achieve frequency control and for Ubuntu to recognize the Softrock plugged into a USB port is to download a software program called USBSOFTROCK and to create the proper permissions.

usbsoftrock

usbsoftrock is a simple-to-use program by Andrew Nilsson which accepts convenient command line options (e.g., frequencies in MHz), speaks the DG8SAQ USB protocol, understands the Si570, and can act as a daemon listening over UDP for control messages.

The usbsoftrock sources are available for download in a Google Code repository. Don�t download the file just yet.

The usbsoftrock is simple to build and install, so I have read online. The software has dependencies on other software libraries. The dependencies are ncurses and libusb, which, on Ubuntu systems, are provided by the libncurses5-dev and libusb-dev packages, respectively. Note that there is also a libusb-1.0-0-dev package, but it provides a slightly different API, and you'll need the older version for usbsoftrock.

So where do you get the dependencies? The best way to get these dependency libraries installed is using the Synaptic Package Manager. Something before I go on. If you are using Ubuntu 12.04 LTS , Synaptic is not installed by default. If you are running an older version, you might need to install synaptic using the Ubuntu software center. To open Synaptic Package Manager, go to the System Settings (control Center) option and select the Synaptic Package Manager as shown below:




Once the Synaptic Package Manager is open, the quickest way to find the dependencies is to do a Quick Search as shown below:



Note in the picture I performed a search on 'libncurses5-dev'. Once you have found the file, select and mark the package for installation. You can then hit the 'Apply' button to start the installation. The system will then download the package and begin the installation.

Perform the same step for 'libusb-dev'. It is possible when you do the search, you may get multiple packages to select from such as what is shown in the image below. I selected the actual 'libusb-dev' option, not the 'libusb-1.0.0-dev' option.



If everything installed correctly, let's go get the 'usbsoftrock' software from the Google Code Repository. Feel free to click on the link here or the link above. The webpage will look like this:



I chose the usbsoftrock-1.0.2.tar.gz file for download. In my case, the file was saved in my /home/n8mdp/Downloads file folder. So I can keep track of where all of the SDR files are going, I created a new file folder in my n8mdp folder called 'SDR'. I copied the usbsoftrock-1.0.2.tar.gz into my new SDR file folder. I need to extract this file in order to use it. In the SDR file folder, I right clicked on the .gz file and selected the 'Open with Archive Manager' option as shown below:



With the usbsoftrock-1.0.2.tar.gz file selected, I hit the Extract button. You will have the chose to create a new file folder if you wish. I chose not to do this and extracted the file in my SDR folder. Once the process is completed, you will see a standard file folder created called 'usbsoftrock-1.0.2'. If you have gotten this far, then so far so good! Feel free to explore the contents of the file folder. What you will not find is any kind of executable file that you can immediately run. The next step is to 'make' the application.

Open the README file in the usbsoftrock-1.0.2 file folder. As you read through the file, you will notice a section on 'Prerequisites'. We have already installed the 'libusb' and 'ncurses' libraries and dependencies. This is why we did this ahead of downloading the usbsoftrock-1.0.2.tar.gz file. However, you will see an additional prerequisite called 'gcc'. 'gcc' is the GNU C compiler. To verify that you have this installed, open the Synaptic Package Manager and perform a quick search for 'gcc'. Hopefully, you will get the screen that I am showing below. If the software is installed, the square to the left of the package name should be shaded green. This means the package is already installed and you don�t have to do anything else. If the box is not shaded green, select this package and install it the same way you installed the two previous libraries. Close Synaptic when you are done.



The procedure to create the application is as follows:

./configure
make
make install

At first glance, if you are newbie, what the heck does this mean and how do I do it. The procedure is quite simple as I will explain (I learned by doing!!).

You will need to open a Terminal window. The Terminal application is located in the Applications menu -> Accessories -> Terminal. I found that the fastest way to open the Terminal application is the shortcut: Ctrl + Alt + T. Pretty simple and quick. Open the Terminal application. You should see a screen like this:



In order to create the application, we have to change to the file folder directory for the SDR file folder. In your Terminal window, type:
cd SDR/usbsoftrock-1.0.2 . The result should look like the screen below:



If you type '
dir' at the prompt, the Terminal application will display all of the files in the SDR folder as shown below:



Now that you are in the SDR file folder, it is time to perform the above procedure.
Step 1: At the prompt, type:
./configure

Hopefully, you should not get any errors. I didn�t!

Step 2: At the prompt, type: make

Again, if you don�t get any errors, so far so good.

Step 3: At the prompt, type: make install

If you don�t get any errors, congratulations. Unfortunately, I got an error as show in screen below:



The key in this error to observe is the 'Permission denied' message. Usually this is brought on by not having the proper permission, not to make the application, but to write the new file to the /usr/local/bin. The way to get around this is to use the Linux Command: sudo.

sudo allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file. The real and effective uid and gid are set to match those of the target user as specified in the passwd file (the group vector is also initialized when the target user is not root). By default, sudo requires that users authenticate themselves with a password (NOTE: by default this is the user's password, not the root password). Once a user has been authenticated, a timestamp is updated and the user may then use sudo without a password for a short period of time (5 minutes unless overridden in sudo'ers).

So let's use the sudo command as follows. At the Terminal prompt, type: sudo make install. If all goes well and there are now no error messages or anything further related to 'Permission denied', you should get the following in your Terminal screen:



You can verify that the executable file was created by going back to your main screen, open your Home folder from the desktop, select your 'file system', select the 'usr' folder, then the 'local' folder, then the 'bin' folder. You should see an executable file called 'usbsoftrock'. If you see this like I show below, you were successful to create the application.



Now that usbsoftrock is installed, there is one last thing you have to do so that Ubuntu recognizes the Softrock board via USB so you can send commands. You have to give non-root users access to the Softrock. You'll want to do this whether you use usbsoftrock or direct access, and whether you use a simple controller or something more sophisticated. This is accomplished via the udevdevice manager. To accomplish this, you will need to create a �rules� file to give you the permissions. The tricky part about this is that you need to have �root� permission to write this file since the file needs to be written to the /etc/udev/rules.d folder.

To get started, press Ctrl + Alt + T on your keyboard to open Terminal. Next, type the command below to create a new password for the root user.

sudo passwd root



You may need to enter your normal user password to move on. After that, you may get asked to enter a new UNIX password. I chose 'root' in my case. After that, type the command below to unlock the root account.

sudo passwd -u root



Next, Log Out.



Then select 'Other' and type the username 'root' and the password you created for the root user.



Once you have re-logged in, open any text editor. In the text editor, type the following line:

SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="05dc", MODE="0666", GROUP="dialout"

Note that case, precise characters, and spacing (it all has to be on one line) are important here. This recipe will allow access to the softrock device to all users who are in the 'dialout' group. If you have a different group that you are using, please type that particular group. The popular recipe flying around the Internet uses MODE="0666", which allows access to all users; take your pick. Save this file in the main File System in the /etc/udev/rules.d file folder. I named my file 99-softrock.rules. I show the window below:



You will have to reboot for this change to take effect.

We are now ready to try to communicate with the Softrock Ensemble. Plug in the power and the USB cable to your Softrock.

Open a Terminal window (use Ctrl+Alt+T shortcut). At the prompt, type: usbsoftrock status. This command will connect to the Softrock and return status information. If all goes well, you should see the following in the Terminal window:



To prove to myself that I did have connection and the usbsoftrock software was communicating to the hardware, I unplugged the USB cable from the Softrock. Then I typed usbsoftrock status again at the terminal prompt. I immediately began to see message that the software could not open the USB device 'DG8SAQ-I2X'. I reinstalled the USB cable, typed usbsoftrock status, hit enter, and indeed could see that the software was communicating with the hardware.

This completes this first section.

Testing the Softrock Ensemble. Time to see if it really is working

Now that you know that you can communicate with the Softrock, it might be a good idea to see if it is really working and you can pick up signals. Before we attempt this, I would like to provide some background information on using the usbsoftrock software in more detail.

Using usbsoftrock to change the frequency of your radio directly is very easy. Simply issue the command usbsoftrock set freq [frequency], where frequency is in MHz. For example, to set the center frequency to 7.030 MHz so that you can copy PSK31 at 7.035 MHz, you would type:

usbsoftrock set freq 7.030

The Softrock Ensemble uses a Si570 Oscillator. The Si570 is described by its manufacturer, Silicon Labs, as an "ANY-RATE I2C PROGRAMMABLE XO/VCXO." What this means in normal amateur radio language is that the Si570 is a frequency synthesizer, complete on one very small (7mm x 5mm) integrated circuit chip. (That's the any-rate, programmable part of the name.) The XO/VCXO part means that the synthesizer is crystal controlled (XO = crystal oscillator) and that one variant of the chip accepts an analog input voltage that will shift the programmed frequency (voltage controlled crystal oscillator. That version is not used in the kit.) The final perhaps unfamiliar term in the part description is "I2C" which refers to the method by which frequency commands and other data is communicated between the rest of the circuit and the Si570. I2C is a specific serial communications protocol using separate clock and data ports and for the purpose of this review, it isn't necessary to delve further into the specifics of I2C. For our amateur radio activities, the Si570 is used as the local oscillator in a superheterodyne receiver, or it can be the local oscillator in a direct conversion quadrature receiver such as the Softrock.

A detailed datasheet for the Si570 can be downloaded at https://www.silabs.com/products/clocksoscillators/xo/Pages/default.aspx by selecting the Si570/571 in the "Resources" tab. I've extracted the summary description and block diagram below.

Note that while Si570 oscillators are accurate, they are not necessarily precise without some footwork. The reference in a Si570 is a crystal vibrator with a nominal frequency of 114.285 MHz, and all of its output frequencies are computed from this frequency. The actual crystal can vary by many kHz from this nominal frequency, however; my SoftRock Si570 oscillates at 114.211833MHz, a deviation of more than 150kHz! In order to achieve precision, controlling software must use this crystal frequency in its configuration calculations. You can retrieve the frequency at which your Si570's crystal oscillates with the command usbsoftrock calibrate. You can then provide it back to usbsoftrock with the -x argument. To achieve a more precise tuning, the above 7.030MHz example for my SoftRock would be:

usbsoftrock -x 114.211833 set freq 7.030

You may need this crystal frequency for configuring other applications, as well.

Here is a list of options and commands for the usbsoftrock

./usbsoftrock [OPTION] COMMAND

OPTION is one or more of:

-a
Advanced firmware present i.e. let the firmware calculate registers
-d
Enter a mode that listens for commands via UDP.
-h
PTT status by reading hardware port Mobo only.
-i <address>
I2C address in DECIMAL (DEFAULT = 85 (0x55))
-m <multiplier>
Multiplication factor for frequency (DEFAULT = 4)
-p <port num>
Port to listen for UDP datagrams (DEFAULT = 19004)
-s <startup Frequency MHz>
Factory programmed startup frequency (DEFAULT = 56.32)
-u <serial number>
Serial Number of Device
-v
Verbose output (fairly useful)
-vv
Even more verbose output (debugging)
-x <calibrated xtall freq MHz>
Corrected XTALL frequency of Si570 device calculated
through the use of the calibrate command immediately
after startup.


COMMAND is one of:
calibrate (may require -s option)
getfreq  
getregisters  
interactive  
getptt (-h option for Mobo only)
getkeys (PE0FKO+TF3LJ+Mobo)
ptt {on|off}  
set bpf {on|off} (PE0FKO+TF3LJ+Mobo)
set bpf_addr <band> <filter> (PE0FKO >= 15.12+Mobo)
set bpf_point <crossover> <f in MHz> (PE0FKO+TF3LJ+Mobo)
set lpf {on|off} (TF3LJ+Mobo only)
set lpf_addr <band> <filter> (TF3LJ+Mobo only)
set lpf_point <crossover> <f in MHz> (TF3LJ+Mobo only)
set freq <frequency in MHz>  
set si570_addr <i2c address in decimal>  
set si570_multiplier [band] <decimal factor> (PE0FKO>=15.12+Mobo)
set startup <frequency in MHz> (PE0FKO+TF3LJ+Mobo)
set xtall <frequency in MHz> (PE0FKO+TF3LJ+Mobo)
status  

Examples
Original DG8SAQ Firmware

Turn on softrock, plug in usb-i2c interface. Type:
usbsoftrock calibrate

Or if you have a different startup freq than 56.32. Type:
usbsoftrock -s 40.000 calibrate

It will return something like: fXTALL = 114.182074

Then take the value from that and use the following:
usbsoftrock -x 114.182074 getfreq
usbsoftrock -x 114.182074 setfreq 14.040


By default the program will calculate the Si570 register values locally when setting the frequency. If you specify option -a (advanced firmware) then it will use the set frequency by value command and let the interface calculate the registers. This enables features such as automatic BPF selection and smooth tuning in Fred PE0FKO's firmware.

PE0FKO Usage
Additional Support with v15.10:

set startup freq Sets the frequency of the si570 on startup
set si570_multiplier <decimal factor> Sets the oscillator multiplier value in the attiny firmware.
set xtall freq Set the calibrated oscillator value
set bpf {on|off} Enable or disable the BPF filter. Needs to be disabled for RXTX 6.3 otherwise changing frequency will sometimes key the transmitter (by default).
set bpf_point (index> <freq MHz> Set the crossover frequency for index. 4 BPF means 3 cross over points 0, 1, 2; e.g. the following would set it up as the default for the electronically switched

Now that we have this behind us, let's test the Softrock to tune in a 40 Meter signal. Since we have not yet loaded a true Softrock SDR application program like Quisk, SDR-Shell, or QtRadio, I am going to use a program called HDSDR running on my Windows 7 System. I will use usbsoftrock to control the Softrock Ensemble. I will also take the Softrock audio output and input that into the audio input on my Windows 7 computer. The only thing that matters is the I and Q signals from the Softrock. HDSDR will take the audio input from the Softrock and do its thing!

For my test, I am setting the local oscillator frequency on the softrock to 7.160MHz as follows:

usbsoftrock set freq 7.160

Below is a screen shot of the HDSDR software. Since I do not have control over the Softrock, I manually changed the LO frequency to 7.160 so the spectrum bar would show the same frequency.




This test proved that the Softrock is truly working. If you were also able to get yours working, congratulations.

So what next? It's time to get an SDR application that runs in Ubuntu.

Installing a Ubuntu supported SDR Application program

As I previously mentioned, there are two SDR application programs that you can install, Quisk and QTRadio. I plan to install both so we can try them out and get used to the various installation procedures. I am going to install QtRadio last since I want to use that as part of the SDR Server application I want to create. I will explain all this in a later section.

The first application that I'm going to install is Quisk. QUISK is software that can control a Softrock. QUISK rhymes with "brisk", and is QSK plus a few letters to make it easier to pronounce. QUISK is written in Python and C. The source code is included with .gz file so you can change it yourself. It currently runs under Linux using ALSA sound drivers (Ubuntu does not use ALSA) or PortAudio and offers these capabilities:

• Quisk can control the HiQSDR.
• As a receiver it can use the SDR-IQ by RfSpace as a sample source. There are several decimation rates available. The screen shots below were taken using the SDR-IQ. The QUISK receiver will read the sample data, tune it, filter it, demodulate it, and send the audio to the sound card for output to external headphones or speakers.
• As a receiver it can use your soundcard as a sample source. You supply a complex (I/Q) mixer to convert radio spectrum to a low IF, and send that IF to the left and right inputs of the sound card in your computer. The demodulated audio goes to the same soundcard for output.
• Quisk can control SoftRock hardware for both receive and transmit.

If you have the SDR-IQ or the Softrock hardware, then QUISK is ready for you to use as a receiver. If you have other receive hardware, then you will need to change the file quisk_hardware.py to connect your receiver to QUISK. For example, if you change your VFO frequency with a serial port, then you need to change quisk_hardware.py to send characters to the serial port. The file quisk_hardware.py is written in the Python programming language, a very easy language to learn and use.

I have tried to make QUISK easy to modify so it can be used for hardware other than my own. See the packages by Leigh L. Klotz, Jr. WA5ZNU on http://pypi.python.org.

To install QUISK, download it from http://pypi.python.org (search for quisk). Then read the documentation and the help.html file for further instructions. Quisk can be installed with distutils, easy_install, or you can just use the tarball. Just unpacking the tarball is best if you plan to add files or modify Quisk. The list of recent changes is in CHANGELOG.txt.

Here are some screen shots of QUISK. The usual graph and waterfall display are available. QUISK was designed without menus and with lots of buttons. Hopefully QUISK looks like a radio and it is obvious how to use it. The red/yellow/blue bars at the bottom of the graph are the band plan. They mark the CW/SSB parts of the band, and show the ARRL additions. The yellow is the data part of the CW segment. The band plan and colors are in the configuration file quisk_conf.py so you can change it.

Here are some screen shots of QUISK:









The following text is the installation details from James Ahlstrom�s website.

I recommend that you just uncompress and un-tar the tar.gz file somewhere under your home directory. In my case, I performed this action in my SDR folder.

gunzip quisk-3.4.4.tar.gz
tar xf quisk-3.4.4.tar

# Check directory quisk-3.4.4 before removing the tar file
rm quisk-3.4.4.tar
# Perhaps change to a shorter name unless you want multiple versions
mv quisk-3.4.4 quisk
That way all the source for Quisk is available so you can change or add to Quisk.

There are some 'dev' packages that must be installed. I recommend that you install the packages first to cut down on the number of errors during compilation.

All should be available as packages or RPM's so you don't have to compile the source. Generally you would get the most recent versions rather than the versions I show below. You should also be able to get these packages using Synaptic Package Manager. Needed packages are:

python2.7, the Python programming language. See http://www.python.org. This almost certainly is already installed on your Linux. Use the version you have, or get the most recent version.
python-wxgtk2.8, the wxPython package used for the GUI. Get the most recent version available for your Python version.
fftw3, the Fastest Fourier Transform in the West. See fftw.org. This is a great FFT package and is also used by GNU radio. (NOTE: Synaptic may not actually show this as fftw3 in the package list. It may display as libfftw3-3. This is the one that I had to choose. I also selected the libfftw3-dev just in case. I think this file replaces the fftw3-dev package in the next bullet point.)
python2.7-dev, fftw3-dev, libasound2-dev, portaudio19-dev. These are development packages that you need so you can change and recompile the Quisk C-language files. Get the version that corresponds to the software you have. If you get compiler errors, check for missing "-dev" packages.

If you already have the packages installed, then there is no need to reinstall them.

It's now time to begin the installation. Recompile the source using the 'make' command in the quisk directory. If there are compile errors or missing *.h files, go back and make sure that the 'dev' packages are indeed installed. Even after running 'make' in my case, I did get errors. See the screen shot below:



I performed a search in my File System and I could not find 'python.h'. After a little bit of a search on line, I installed through Synaptic the package 'python-dev'. After the installation of the package, I tried 'make' again in the Terminal window. This time I was successful.

Another way to install Quisk is to change to the superuser (root) and run 'easy_install quisk' or 'python setup.py install'. If you don't have easy_install, install the python-setuptools package (for Debian/Ubuntu). This method installs Quisk as a package. But you need to be root, and the source is not in a convenient place; it is in /usr/lib/python2.6/site-packages. And there is no uninstall feature.

Run Quisk using a terminal with the command 'python quisk.py'. If there is any error output, it will appear on the terminal. I got a lot of errors as shown below. It looks like most of the errors have to do with Audio. Not sure what is going on just yet, so I decided to continue anyway. The software does load and I do get the panel.



After testing, you can create a panel launcher with the same command but a full path, for example 'python /home/jim/quisk-3.4.4/quisk.py' or 'python /home/jim/quisk/quisk.py' if you used the shorter name . Then just click the button to run Quisk.

I was able to get my audio solved an my SDR running successfully on Quisk.

I hope this beginners guide will be helpful to you.
Good Luck!
 

© 2023, Jonathan Tucker N8MDP. All Rights Reserved. Powered by cPanel.