About Me Banner

BUY AMERICAN!

pcDuino3: Installing ghpsdr3-alex

 

to run the Softrock Ensemble II

 


 

This page describes installing the USBSOFTROCK driver and

 

ghpsdr3-alex software to run the Softrock Ensemble II on the

 

pcDuino3.

 

 

Table of Contents

 

    ==>What is the pcDuino3?

 

    ==>Installing prerequisite software

 

    ==>Cloning the Repository

 

    ==>Pulseaudio Setup

 

    ==>Starting Softrock Server and DSPserver

 

 

 

What is the pcDuino3?

 

    

 

pcDuino3 is a high performance, cost effective single board computer. It runs operation systems such as Ubuntu Linux and Android. pcDuino3 has HDMI interface to output its graphic desktop screen. It could support multi-format 1080p 60fps video decoder and 1080p 30fps H.264 and MPEG4 video encoder with its built-in hardware video processing engine. It targets specially the fast growing demands from the open source community. pcDuino3 provides easy-to-use tool chains and is compatible with the popular Arduino ecosystem such as Arduino Shields.

 

On this page, I am going to install the USBSOFTROCK driver and the Softrock Server and DSPSERVER software from the ghpsdr3-alex code to serve one of my Softrock Ensemble II SDR Tuners. I don't plan to run QTRadio with the pcDuino. So I am only going to install and run the server tools.

 

Back to Top

 

Installing prerequisite software files

 

The most recent set of instructions is at: http://napan.ca/ghpsdr3/index.php/QtRadio_Installation. I highly recommend that you read this and follow the instructions on that page as closely as possible, with possible clarifications or modifications as will be noted below. We are not going to install Qt5 since I have no plans to use QtRadio on this SBC.

 

1. Make sure the OS has all of the lastest updates:

 

sudo apt-get update

 

2. Install the necessary compiler and tools needed:

 

sudo apt-get install make gcc g++
sudo apt-get install autoconf automake autotools-dev libtool git subversion

 

2. From the instructions on the above site, I am using the installation instructions for Ubuntu 12.04 and newer instructions:

 

sudo apt-get install \ libqt4-opengl-dev \ qtmobility-dev \ libusb-0.1-4 \ libusb-dev \ libfftw3-dev \ portaudio19-dev \ libpulse-dev \ libsamplerate0-dev \ libusb-1.0-0-dev \ libconfig8-dev \ xdg-utils \ libortp-dev \ gcc-multilib \ libssl-dev \ libevent-dev \ libglu1-mesa-dev \ freeglut3-dev \ cmake \ libspeexdsp-dev

 

Make sure that you are using the proper command line syntax for the above installs. I ended up installing each file individually. If youc choose to use the entire line at once, do not use the '\' character between the filenames.

 

3. One additional file to install is the following:

 

sudo apt-get install libncurses5-dev

 

This file is required for installing the USBSOFTROCK USB driver.

 

Back to Top

 

Cloning the Respository

 

There are a couple of steps required to clone the repository and get the right software installed.

 

Step 1: Confirming the latest libevent-dev version is installed.

 

1. Obtain the up-level libevent library as called out in the QtRadio Installation instructions. Interesting that in the previous set of instructions, you actually installed libevent-dev. Let's quickly check which version was installed to make sure that you get a version newer than 2.0.5. Open Synaptic.

 

2. Do a search for libevent-dev.

 

3. When Synaptic locates the file, it should indicate that it is installed. Look under the "Installed Version" column to identify the version. Mine was 2.0.16-stable-1. This is the latest version. If you do not have the latest version, follow the instructions on the QtRadio_Installation page to install the latest version.

 

Step 2: Installing codec2

 

We are adding a low bit rate audio codec called codec 2. You need to download and build the codec2 library.

 

Before you do this, I highly recommend that you check the version of cmake that you previously installed on your pcDuino3. You can do this at a Terminal prompt and typing: cmake --version

 

I had version 2.8.7. This version does not include a specific cmake file called CMakePackageConfigHeaders.cmake. It too me quite a while to find out that this file is needed to complete the build of codec2. I kept getting errors that this was missing, resulting in an incomplete build. I found out that version 2.8.8 or higher has this file. I STRONGLY RECOMMEND that you download the latest version of cmake and install it. You can find the latest version of cmake at http://www.cmake.org/. Here are some basic instructions that I used to install the lastest version:

 

1. Check the version of your Cmake using cmake --version
2. If 2.8.7, Download the latest CMake version from the CMake web site
3. Uncompress it in a new folder
4. Create a _build directory in the folder: mkdir _build
5. From the _build directory, run the following commands to build and install CMake from sources:

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
sudo ldconfig

 

Once the install is complete, again, you can check the version by typing into a Terminal windows: cmake --version.

 

You can now start the codec2 installation.

 

1. Make sure you follow the following commands per the instructions on the QtRadio Installation page.

 

svn co https://svn.code.sf.net/p/freetel/code/codec2 codec2
cd codec2
mkdir build
cd build
cmake ../
sudo make
sudo make install
sudo ldconfig

 

I also recommend that you perform these additional steps. According to the QtRadio Installation instructions, on some variations, codec2 files will not be detected as installed correctly. There is mentione that there might be build errors citing codec2 are encountered during the later ./configure steps. My friend, W8NFT, Doug, recommended that you do this since he had to do this on his pcDuino3 setup.

 

cd /usr/local/include/codec2
sudo cp * ..

 

Step 3. Clone and build the master branch of ghpsdr3-alex.

 

1. Get the latest code. In a Terminal window, type at the prompt:

 

git clone git://github.com/alexlee188/ghpsdr3-alex

 

2. Depending on your Internet connection throughput, it will take several minutes to download. cd into the new directory ghpsdr3-alex. Enter these commands at the prompt:

 

cd ghpsdr3-alex
git checkout master

 

3. Since I am not doing anything with Qt5, I did not set any paths. At this point, I typed at the Terminal prompt:

 

autoreconf -i
./configure (This is different than what the instructions show. I did not see any configure.sh file, only configure.)
make -j4 all (This step make take a few minutes)
sudo make install (This creates the executable files for softrock server and dspserver.

At this point, we need to setup Pulseaudio.

 

Back to Top

 

Pulseaudio Setup

 

There is one more critical piece of software that you need to install. And that is the Pulseaudio. PulseAudio is a sound server, a background process accepting sound input from one or more sources (processes or capture devices) and redirecting it to one or more sinks (sound cards, remote network PulseAudio servers, or other processes). Without this Pulseaudio setup, the Softrock will not get the audio out to the Internet. Believe, I found this out the hard way!!

 

To configure the softrock server with your soundcard for IQ processing use: pavucontrol

 

In order to install it, submit the following command in a Terminal window:

 

sudo apt-get install pavucontrol

 

If you try to run this, you might get errors that it can't access pavucontrol. This is because you need to install paprefs. You can come back to set up pavucontrol after paprefs has been installed and configured. Then you can choose your Soundcard for IQ processing. For the Softrock Ensemble, your settings should at least look like the following pictures.

 

pavucontrol1

 

pavucontrol2

 

pavucontrol3

 

For the pcDuino3, I have to use a USB Audio sound system.

 

Lastly, we need to enable the network mode. To do that, we need to run pulse in network mode. Use: paprefs

 

In order to install it, submit the following command (since I use Ubuntu) in a Terminal window:

 

sudo apt-get install paprefs

 

From a terminal window, type 'paprefs' to launch the application. When the application opens, make sure the check boxes are checked as shown in the two pictures for Network Access and Network Server:

 

paprefs1

 

paprefs2

 

If everything has installed to this point without any errors, congratulations. Trust me, this was a learning process for me and I had errors. So I hope this helps in getting you to this point.

 

Back to Top

 

Starting Softrock Server and DSPserver

 

If the entire installation process worked for you, then we need to launch the Softrock server first. The Softrock server accepts a number of command line arguements:

 


	  
--samplerate 48000 | 96000 | 19200
--input Input device (see below)
--output Output device (see below)
--iq Samples in I/Q order
--qi Samples in Q/I order
--si570 Use si570 to set frequency (default off)
--verbose Enable verbose output for si570 (default 0ff)
--startupfreq si570 startupFrequency (default 56.32)
--multiplier si570 frequency multiplier (default 4)
--correctedfreq si570 corrected xtal frequency (default 114.285)

 

In my case, I launch my Softrock with this command line in a Terminal window:

 

softrock --si570 --qi --samplerate 48000

 

Make sure that you use two -- hypen characters, or you will get errors. If you typed this correctly, you should see the following:

 

softrockserver

 

If this is what you got, so far so good. One other important point that I shoulds stress is that in order to use 96000 or 192000 sample rtes, you will need to configure pulse audio by editing the /etc/pulse/daemon.conf file. Open the file and search for a line in the code that looks like the following:

 

dspserver1

 

Your code may show the line:

 

default-sample-rate = 48000

 

Make sure you change this to the sample rate that your sound card supports. Mine was 48000. Save the file when you complete the edit. You may need to restart the computer for the change to take affect.

 

The next step is to launch the dspserver. dspserver also has a number of command line arguments:

 

dspserver --lo 0|9000|12000|... --share

 

The LO offset can be set by the --lo argument. For fixed crystal Softrocks and DDC rigs, use --lo 0. For si570 controlled Softrocks, like the Ensemble II, the usual offset should be set with --lo 9000. Of course, you can set other offset values depending on your rig.

 

You need to launch the dspserver for the first time so that dspserver.conf file is created. dspserver now has the ability to "register" it's status in a web database. This data will be used by QtRadio in the future to assist selecting dspservers. Another advantage is dspserver will no longer need any form of dyndns service as the current IP for the dspserver is registered at the same time. I still use my dyndns service because I have other applications that require it. You can view the current registered dspservers: http://qtradio.napan.ca/qtradio/qtradio.pl or in map format at: http://www.montefusco.com/ghpsdr3

 

To use this feature, start dspserver with the "--share" option. This will look for dspserver.conf for settings. If no dsdpserver.conf file is found one will be created on startup and is ready for editing. Editing notes are included in the conf file. My dspserver.conf looks like the following:

 

dspserver2

 

Upon trying to start the dspserver for the first time, I had a problem starting dspserver because I didn't create the SSL key pairs. This is what I got:

 

$ dspserver
Reading conf file /home/frohro/dspserver.conf
Country Lookup is On
gHPSDR rx 0 (Version 0.7)
dspserver string: 20130609;-master
getSoundcardId: HPSDR id=8
setSoundcard: 8
setSoundcard -41.000000 -48.000000 etup
sdr thread 0: done
setup sdr thread 1: done
setup sdr thread 2: done
client_thread
[2013-08-26 10:15:12] client_thread: listening on port 8000
Couldn't read 'pkey' or 'cert' file. To generate a key
and self-signed certificate, run:
   openssl genrsa -out pkey 2048
   openssl req -new -key pkey -out cert.req
   openssl x509 -req -days 365 -in cert.req -signkey pkey -out cert
client ctx init failed: No such file or directory

 

Note the message about the SSL keys ("Couldn't read 'pkey' or 'cert' file.") not being set up. This is a process you do once. The three commands to set up the SSL keys are just what the dspserver response above told you to do. The second of these commands will ask you to personalize your keys. Just answer the questions as they are presented. The three commands in the proper order, are here below for you to paste into your terminal window to execute.

 

openssl genrsa -out pkey 2048

 

openssl req -new -key pkey -out cert.req

 

openssl x509 -req -days 365 -in cert.req -signkey pkey -out cert

 

Follow the instructions for each of these setups when you are running each command line. The prompts should be self explanatory. Lastly, If you are behind a firewall/NAT-router and want to be able to connect to your dspserver over the Internet you have to open up port tcp/8000.

 

You will need to restart the dspserver for changes in the dspserver.conf file to take affect.

 

When I open a Terminal window and type:

 

dspserver --lo 9000 --share

 

I see something like the following:

 

dspserver3

 

If you have followed these steps to this point, and have launched the Softrock server and dspserver, then your Softrock should now be on the air. You can verify that it is operational by opening QtRadio. You will need to select Receiver ==> Configure. In the following window, enter the local IP address of your Softrock server in the "Host:" window.

 

dspserver4

 

Hit close when you are done. Then go to Receiver ==> Connect to connect to your server locally. If you begin hearing your Softrock and can control it with QtRadio, congratulations! You have successfully installed the necessary elements. If not, go back through the steps and make sure that you did not miss anything.

 

Other concerns

 

1. Audio: I ran into some problems with the audio. Do make sure that you have AlsaMixer installed properly and you are using the correct sound system. That threw me for a small loop when I wasn't getting any audio.

 

Back to Top

 



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