A Brief Getting Started with dttsp for Linux Helper Page
by
w3sz 8/3/2006 [revised 3/26/07]

This page is devoted to describing how to get the DttSP DSP and SDR-1000 control software and associated GUIs running on Linux. The steps 1-16 in the hyperlinks below take you through the process of getting things up and running, starting with downloading and installing Ubuntu. The easiest route to take is to go to #3 and download the .deb file that installs ready-to-run versions of dttsp, the SDR-1000 hardware control software, and GUIs for both the dttsp-receive and hardware control software. If you do #3, you can ignore steps 2 and 4-8. If you are interested in this stuff you really need to join the dttsp-linux group on Yahoo. A general bit of advice: ALWAYS, ALWAYS, ALWAYS follow the 'official' installation instructions first. My suggestions are to be considered ONLY in the event that the 'official' instructions fail to produce a working installation.
1. Download Ubuntu and Install it on the Hard Drive
2. Add pre-requisites and useful files to Ubuntu
3. Install the software and associated GUIs
as a Debian archive ( .deb ) file
This is the easiest way to get dttsp, the SDR-1000 hardware
control software, and the great GUIs for both up and running. If you do this you can ignore steps
2 above and 4-8 and 16
below!! Let me know if you try this and have problems! This has been
extensively tested for Ubuntu only. I can't offer advice for Kubuntu or
any other non-Ubuntu distributions.
4. Install Sun-Java 1.5 if you are going to use John Melton's Java-based GUI
5. Download Edson Pereira PU1JTE/N1VTN's GUI
and associated files including current DttSP source [ not necessary if you
did #3 above].
6. If you want to get DttSP source manually
instead of via the technique described in #3 above, or as a part of Ed's package
as described in #5 above, then look here. If you are going to
install the SDR-1000 hardware control software from source, that will include the dttsp
software as well. So if that is the case, skip to
7. Compile sdr-core, if needed
8. Compile sdr-shell, Edson's GUI, if needed [if you didn't do #3 above]
9. Start sdr-core with Edson's script
10. How to use separate soundcards for input and output
11. How to use OSS instead of alsa
12. Use Edson's script for starting jack and sdr-core. No link needed. Just do it!
13. Download and install John Melton's Java-based GUI
14. Download and install John Melton's GTK-based GUI
15. How to get Presonus Firebox working under Ubuntu Linux [Dapper]
16. How to get SDR-1000 Hardware Control working under Ubuntu Linux [Dapper]
17. How to get DttSP PortAudio version working under Ubuntu Linux [Dapper]
1. Download Ubuntu and Install it on the Hard Drive
Download the Ubuntu desktop iso from:
http://www.ubuntu.com/
Make a CD from the iso file.
Boot using the CD.
Install Ubuntu on your hard drive by clicking on "Install". DO NOT expect to be
able to login as root. Ubuntu will NOT allow this, by default. Make sure you pick a user name that is not
'root' and make sure you give yourself a password. Otherwise you won't be
able to log on to your new operating system!
Boot into your new hard disk version of Ubuntu.
Open a terminal window. If some of the commands don't work due to permission
problems because you are not root, then type 'sudo' before the command. It’s easiest
to get things set up if you are operating as root. That is what I did. If
you don't operate as root, you will likely need to 'sudo' before each apt-get
command.
Back to top
If you are installing dttsp, etc. using the Debian archive file as I describe below, you DO NOT need to do any of this. Installing the file will take care of all of it!
If you are told that Ubuntu can't find some of the files below,
then
type "apt-get update" [don't forget, you might need to add 'sudo' at
the beginning of the command].
use Synaptic to get and install each of the files below, or install them
manually using apt-get by typing:
apt-get update
apt-get install
make
apt-get install gcc
apt-get install g++
apt-get install libqt3-mt
apt-get install libqt3-mt-dev
apt-get install subversion
apt-get install fftw3
apt-get install fftw3-dev
apt-get install jackd
apt-get install xmms-jack
apt-get install libjack0.100.0-0
apt-get install libjack0.100.0-dev
3. Install dttsp, SDR-1000 control software,and GUIs as a Debian archive ( .deb ) file
THIS is the best way to get started if you have a Debian system that is reasonably current, and have X-Windows and sound running. If you don't already have this, I recommend installing Ubuntu, using the "Desktop" version that you can download as above. That will give you the Ubuntu offshoot of Debian Linux, with X-Windows and sound ready to go. Then you can proceed as described below. I have created versions of the .deb file for both i386 [standard Intel x86] and amd64 [64 bit version for amd64 and intel 86_64] processors. Your system should automatically choose the correct version for your processor, although you can override this choice by changing /etc/apt/apt.conf to reflect your choice of architecture.
I have created a Debian archive file "dttsp.deb" that can be used with systems with alsa sound, oss, and freebob sound drivers. It will automatically install dttsp, the sdr-1000 hardware control software, and the GUI shells sdr-shell written by Edson Pereira and gbeppe and gsdr written by John Melton, as well as the sdr.sh script written by Edson and slightly modified by me, and the SDR-1000 hardware control GUI written by me, W3SZ. Depending on your hardware, the sdr.sh script in the /dttsp/sdr directory may need to be modified slightly for things to work on your system. But chances are, if you have a 'stock' Ubuntu system, it will run right off the bat. If you want to run OSS instead of alsa, then you will have to modify the file /usr/sdr/setup_env or the script sdr.sh to set the variable SND_DRIV to "oss" for this script to work properly with OSS. If you want to run alsa, the standard sound that comes with Ubuntu Desktop, you can leave the setup_env file alone. To run at 96000 Hz sampling rate [assuming that your soundcard is capable of this], you need to change the file setup_env [or the sdr.sh file] so that SDR_DEFRATE is 96000 instead of 48000. One of my machines has two Delta44 cards and onboard sound, and the OSS parameters given in the script are those that work with this hardware. The alsa parameters are those originally supplied by Edson . They work right out of the box with my Laptop and its stock sound. I generally run freebob and the PreSonus Firebox with the laptop, and how to do that is described in 15 below.
Here is the procedure to get things running via this route:
To install the software contained in the dttsp.deb file you need to update your Apt sources list, which is at /etc/apt/sources.list. Edit your /etc/apt/sources.list file by adding this line at the end:
"deb http://www.nitehawk.com/w3sz/debs etch main non-free contrib". Then type "apt-get update" so apt has the new information.
If you have already installed my dttsp.deb file, type "apt-get remove dttsp" before you do "apt-get update".
Then, to install the dttsp.deb file just type "apt-get install dttsp" and apt-get will go to the internet and get the dttsp.deb file and dttsp, the SDR-1000 hardware control software, and the GUIs mentioned above should then be installed on your computer. Apt-get will at the same time get the necessary files to satisfy the dependencies of dttsp.deb. The files will be placed into the directories /usr/sdr and /usr/local/bin.
You may need to set SDR_DEFRATE outside the shell the first time you run things [unless it is already set on your computer]. To do this, type at the command prompt:
"export SDR_DEFRATE=48000" (without the quotes). You can get your computer to remember this on subsequent reboots [if you installed one of the dttsp-xxx.deb packages above] by putting the following lines in your /etc/profile file, near the end:
SDR_DEFRATE=48000
export SDR_DEFRATE
and then save the file with the changes. If you have a 96000 Hz soundcard you can set it to 96000 Hz if you want after you have shown that it works at 48000 Hz. You will then also need to change the file setup_env as noted above. Also, to get 96000 Hz to work here with OSS, I had to change the jackd parameter p2014 to p128 [or 256].
THAT'S IT, THE INSTALLATION IS COMPLETE! NOW YOU CAN START TO PLAY:
To run dttsp, etc. just type from any directory:
"sdr start" ["sudo sdr start" if you are not root], and then jack and sdr-core will start and the necessary jack connections will be made.
You can then type "sdr-shell &" or "gsdr" or "gbeppe" and the appropriate shell will start. I have confirmed that this works properly with Edson's sdr-shell with alsa sound on my laptop, and with oss sound and this shell on my main system. On the main system I have also confirmed that gsdr and dbeppe work properly at both 48000 Hz and 96000 Hz [with oss and the Delta44 for input and onboard sound for output].
To start the SDR-1000 hardware control GUI, just type "sdr1000". More info on this GUI is given in 16 below.
If you need help using two sound cards, or with using OSS instead of alsa, check the links for each by clicking appropriately.
If you have trouble after upgrading/installing the dttsp.deb file with an
error of the type: "/usr/local/bin/sdr-core: error while loading shared
libraries: libjack.so.0: cannot open shared object file: No such file or
directory", the problem is likely a 'lost' link to libjack.so.0, I think.
This is what I recommend to solve this problem:
updatedb
locate libjack.so
Look at your libjack choices from the locate statement. Mine were:
/usr/lib/libjack.so
/usr/lib/libjack.so.0.0.23
/usr/local/lib/libjack.so.0.0.23
/usr/local/lib/libjack.so
/download/jack/libjack/.libs/libjack.so.0.0.23
/download/jack/libjack/.libs/libjack.so.0
/download/jack/libjack/.libs/libjack.so
so I just did
ln -s /usr/lib/libjack.so.0.0.23 /usr/lib/libjack.so.0
and then everything worked fine.
Let me know if that does/does not work for you.
Let me know whether or not this works easily for you. Thanks!
---------------
Making the Repository
[Ignore this unless you want to make your own .deb files for distribution]The text below describes how I made the .deb files and the repository, and gives some details on how I made the packages. You can ignore it unless you want to do the same.
dttsp.deb is the Debian archive file I created in order to take care of the dependencies that crop up when trying to install the dttsp series files. It was created by creating the directory /dttsp-dev with the subdirectories:
DEBIAN which contains the control. preinst, postinst, prerm, and postrm files. You can examine these files and the archive as a whole by looking at it with the command "ar tv dttsp.deb" to see the file structure or "ar x dttsp.deb" to extract the files.
/usr which contains the subdirectories /usr/sdr and /usr/share/doc/dttsp to contain the copyright and changelog.gz files
/usr/sdr which contains the subdirectory sdr. The sdr directory contains executable [binary] files as well as various scripts, 'ini' files, and several GUIs.
In order to make the .deb file follow the Debian Policy closely enough to attain zero errors on checking with 'linda', I needed to make the base directory /usr/sdr [rather than just /sdr] and I needed to remove the .svn directories that had come along with the download of code via subversion. I also needed to strip all of the binaries using 'strip xxxxxx' for binary xxxxxx. I also needed to get rid of unneeded binary comments using 'strip -R .comment xxxxxx' for binary xxxxxx, for example. I also needed to add a changelog.gz file and a copyright file, both placed in the directory /usr/share/doc/dttsp . Once I had all of this syntactical stuff correct, I created these Debian archive files by first populating the directory /dttsp-dev/ with these files and directories and then going to the directory "/" and typing:
"dpkg -b dttsp-dev dttsp.deb" to create the file dttsp.deb .
In order to create a repository that apt-get could use, I then made a Package.gz file by putting the dttsp.deb file into the directory "/debs" and typing from the "/" directory: "dpkg-scanpackages debs /dev/null | gzip > debs/Packages.gz". This created the Package.gz file [an 'index' of the /debs directory] for apt-get. I then made the directory /debs on the www.nitehawk.com/w3sz/ website. A subdirectory /debs within the directory /debs there holds the .deb file, and the directory /debs/dists/main/contrib/binary-i386 holds the file Packages.gz. This structure allows this website to function as a Debian Repository so you can seamlessly use apt-get with it.
More recently, because my repository now has both i386 and amd64 versions of some packages, and several different deb files [dttsp, xlinrad, xlinrad-1000 for example], the directory structure has become more complex. The 'root' repository directory is the ../dists directory, and it contains a directory structure created using several scripts that I wrote, with the entire path ../debs/dists/etch/contrib/binary-amd64|binary-i386|source/.
On my computer the repository directory structure is created in the folder /packages. Dttsp.deb is created from the directory /dev-dttsp, dttsp i64 version from the directory /dev-dttsp64, xlinrad from /dev-xlinrad, and xlinrad-1000 [xlinrad with FT1000 control] from /dev/xlinrad-1000. The script debmaker is run from the / directory and first creates .deb files for each of these applications, then copies them to the appropriate directories in the /packages repository directory, and then runs the script update-archive.sh which generates the Packages and Contents and Release files required by the Debian Repository system. This file uses the apt-ftparchive.conf and apt-dapper-realease.conf files for configuration. Once all of this is done, the contents of the /packages directory are uploaded to the Debian repository, maintaining the appropriate directory structure.
What the .deb file does on your system
When this file is installed using apt-get it will:
Create a directory /usr/sdr. It will also create some symbolic links and fifos as will be noted below. It will create the directory /usr/share/doc/dttsp and put the copyright and changefile.gz files there as well.
The directory "sdr" and its subdirectories contain the source and executable files for:
sdr-core by Bob McGwier, N4HY, and Frank Brickle, AB2KT
sdr-shell by Edson Pereira PU1JTE/N1VTN
gsdr by John Melton G0ORX/N6LYT
gbeppe also by John, G0ORX/N6LYT
the SDR-1000 hardware control software by Eric, Bob, and Frank
the SDR-1000 hardware control GUI by Roger Rehr, W3SZ
and the script sdr.sh by Edson Pereira that starts the sdr-core software, slightly modified.
Installing the .deb file will also establish symbolic links so that you can run:
sdr.sh by typing sdr ["sudo sdr" if you are not root]
sdr-shell by typing sdr-shell
gsdr by typing gsdr
gbeppe by typing gbeppe
sdr1000, the SDR-1000 hardware control GUI, by typing sdr1000 from any directory.
It will also set up the necessary fifos in /dev/shm.
You may wish to create the file /etc/X11/Xsession.d/75local-profile so that IF you add the lines:
SDR_DEFRATE=48000
export SDR_DEFRATE
to /etc/profile
your system will save the SDR_DEFRATE parameter when you shut down so that you don't need to retype it each time you start sdr-shell after rebooting. Note that your system may already save this variable at shutdown. Whether or not it does so is dependent upon your exact xdm/gdm X11 configuration.
To keep the system clean, I set up the .deb file so that before installing it attempts to remove the above-named links and fifos so that there are no conflicts with pre-existing files or links. It also attempts to remove all of the installed files and links except for the file /etc/X11/Xsession.d/73local-profile if you uninstall this package, again to keep things clean.
4. Get JAVA if you are going to use John Melton's Java-based GUI.
If you are going to use John Melton's Java-based GUI, then Install Sun-Java 1.5 [JDK
or JRE 5.0] and make it the ‘default’ Java on your machine. John is also developing a GTK-based GUI, and Ed's GUI doesn't require this, so you can skip this if you like.
It might be smart to hold off on this until after you have either John's or
Edson's non-Java GUI running. Once you have accomplished that, you can
tackle Java.
You need to have Java 5.0 Runtime installed to run the java gui by John
Melton G0ORX/N6LYT. If you want to compile java, you need the JDK. You can
get either the JRE or the JDK [which includes the JRE] from
http://java.sun.com/j2se/1.5.0/download.jsp
If you had a different version of Java on your computer prior to downloading
this version, after you install Sun-Java you need to tell Ubuntu to use the new
Java version. You can
read the documents at /usr/share/doc/sun-java5-bin/README.alternatives to learn
how to do this.
Basically you type update-java-alternatives -l to see what your available
versions were and then type
"update-java-alternatives –s java-1.5.0-sun" [or whatever the alternative you want
is called in the list generated as above].
If you are using 'regular Debian' there is no "update-java-alternatives". But
there is "update-alternatives". So if you installed Sun-Java 1.5 Runtime as a Debian
package, you can do "update-alternatives --list java" to see your alternatives,
and then do "update-alternatives --set java
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java" for example. If you didn't
install Java as a Debian [or Ubuntu[ package, but instead used a tarball, the
Debian [or Ubuntu] installer won't know that the new Java is installed, and
these programs won't help you.
Back to top
5. Download Edson Pereira PU1JTE/N1VTN's sdr-shell GUI and associated files including a version [as of 2-23-07, an old version from 8-06] of the DttSP source from:
http://ewp.homelinux.net/sdr-shell/
Put the tar.gz file in the directory /usr/local and type:
tar zxvf sdr.20060815.tar.gz or whatever the current filename is.
This will create the directory:
usr/local/sdr and its subdirectories:
...dttsp
...dttsp-r38
...sdr-shell
...sdr-shell-v2a
Doing this will obviate the need for several of the steps below, as noted. Note that if you opt to do this, your directory structure will not be what is discussed elsewhere on this page.
6. If you want to get the latest DttSP sources manually instead of as a part of Ed's package, then follow the steps below. Note that in this section I am using a different directory structure than was used for the .deb file download of precompiled ready-to-run code in #3 above. This is to so that you can keep both types of installations on your hardd drive. For example, I routinely use the 'canned' .deb download for operating on a day-to-day basis, but experiment with the source code version that is installed according to the instructions in this section. To do the installation, type:
apt-get update
apt-get install subversion
mkdir /usr/local/sdrhw
cd /usr/local/sdrhw
Then get the download via svn by typing : svn co svn://206.216.146.154/svn/repos_sdr_linux/trunk . This will create a directory /usr/local/sdrhw/trunk that contains dttsp, hardware control software, libraries, test code, and swig for linux, cygwin, and visual studio 2005. Current svn version as I type this is 90.
Copy the trunk directory to a directory for the current repository by typing: cp -r trunk sdrhw-r90 [or whatever the version number is].
Then create a symbolic link by typing: 'rm sdrhw' and then 'ln -s sdrhw-r90 [or whatever your version number is] sdrhw'. This way you can set up all of your scripts so that they use the directory /usr/local/sdrhw/sdrhw and you won't need to change them when you get new versions of the software; you will just need to delete and re-create the link by typing from the directory /usr/local/sdrhw 'rm sdrhw' and then 'ln -s sdrhw-r91 [or whatever] sdrhw' after you do the svn download and copy the trunk directory to a new directory sdrhw-r91 [or whatever] as above.
Note that there are certain pre-requisite files or 'dependencies' that you will need to compile dttsp and the SDR-1000 control software. I listed what is necessary for dttsp in section 2, above. Make sure you have gotten all of these. You will of course also need python, python2.4-dev, swig, the libusb packages and possibly some other files [like doxygen] in addition. To get these files do the following:
To get python: 'apt-get install python' [add sudo at the beginning if not root]
To get python2.4-dev: 'apt-get install python2.4-dev' [add sudo at the beginning if not root]
To get swig: 'apt-get install swig' [add sudo at the beginning if not root]
To get doxygen: 'apt-get install doxygen' [add sudo at the beginning if not root]
To get libusb:
You can run Synaptic and search on 'libusb' and install what you find. I have installed here
on the laptop libusb++0.1-4, libusb++-dev, libusb-0.1-4, libusb-dev. Or, you can do 'dpkg -l libusb*' and see what pops up and install what seems appropriate. When I do this it shows that I have the files just mentioned installed, and that I don't have 'libusb0' installed.
On my x64 system, instead of libusb++0.1-4 I have libusb++0.1-4c2 installed.
This process also installs the the SDR-1000 hardware control software Go to section
16 for more information on that subject. Much of the above instructions will be repeated there. See sections also sections 7-10 for more information on setting everything up.7. To compile all of the software you have downloaded from the svn repository, make sure you are in the /usr/local/sdrhw/sdrhw/dttsp/src directory and type './configure' without the quotes, and then type 'make' without the quotes and then 'make install' without the quotes [this last one may be unnecessary]. To compile the SDR-1000 hardware control software go to /usr/local/sdrhw/sdrhw/hardware/sdr1000/build/linux and type 'make' and 'make -f swig.mk' and the hardware control software will be installed. You also need to copy the file setup_env to the directory /usr/local/bin. Do 'updatedb' and then 'locate setup_env' to find out where it is on your system. If you have it, it is likely in either /usr/dttsp/sdr/dttsp/bin/setup_env or /usr/dttsp/sdr/dttsp-r38/bin/setup_env. If you don't have it on your system, download it from here . Note that you may need to modify it to work with your system. You will need to set the sound-driver [ export "SND_DRIV" ] to either "alsa" or "oss" or "freebob", for example.
8. To compile sdr-shell [IF NEEDED; check usr/sdr/ to see if the file sdr-shell is already there and if so skip this step].
cd /usr/local/sdr/sdr-shell/src
qmake sdr-shell.pro -o Makefile
make
cp sdr-shell usr/local/bin/sdr-shell
9. To start sdr-core using Edson's script, type:
/usr/local/sdr/sdr.sh start
# To stop sdr-core [again using the script], type:
/usr/local/sdr/sdr.sh stop
# To run sdr-shell, type:
/usr/local/sdr/sdr-shell/bin/sdr-shell or simply
sdr-shell
# type export SDR_DEFRATE=48000 to set this environmental variable if sdr-shell doesn't want to start because this environmental variable is missing.
You can add starting the shell to the script sdr.sh if you wish by adding the following line to the script just before the 'stop' section:
./sdr-shell -m -s &
If you installed the software using the .deb file in #3 above, then symbolic links were created so that you only need to type 'sdr' [without the quotes] to start sdr.sh, for example. You can add these links yourself:
ln -s /usr/local/sdr/sdr.sh /usr/local/bin/sdr . Then you just need to type sdr from any command prompt to start the script sdr.sh.
10.
If you want to use separate soundcards for input and output like I
do, then you need to figure out the alsa assignments for your devices and
soundcards. These can change when you reboot, as I discovered [as others had
before me]. Typing:
cat /proc/asound/cards will show you how alsa numbers the soundcards
cat /proc/asound/devices will show you how alsa numbers the devices.
Note that [1- 0] becomes hw:1,0 when you are giving parameters to jackd, and you
can shorten this to hw:1.
You will need to change the line that invokes jackd to something like:
"$JACKD -d alsa -P hw:2 -C hw:0 -p1024
-n2 &"
the –d alsa says that alsa is the sound driver
-P hw:2,0 means that I am using the second soundcard, subdevice 0 as playback
device
-C hs:0,0 means that I am using the zeroth soundcard, subdevice 0 as capture
device
If you are sampling at 96000 Hz, you may need to change p1024 to something less; I have to use p128. If you make p too low, you may start getting xrun errors.
You should be able to prevent Alsa from reordering the soundcards when you reboot by altering the file /etc/modprobe.d/alsa-base. At the end of that file are some lines of the form:
options snd-xxxxxx index=x. If you set these up for your cards using the names for your sound modules it will set the ordering of the soundcards. One example would be:
options snd-intel8x0 index=0
options snd-ice1712 index=2
which will set the onboard sound to index=0 and the Delta44 to index=2. You need to do this for EVERY driver module that gets loaded. If you don't, the one you 'miss' may get loaded as index=0 and thwart your efforts. This page gives you more information on this subject: http://alsa.opensrc.org/MultipleCards .
11. If you use OSS instead of Alsa,
several script modifications are needed:
"$JACKD -d alsa -P hw:2 -C hw:0 -r$SDR_DEFRATE -p1024
-n2 &"
becomes
"$JACKD -d oss -P /dev/dsp -C /dev/dsp4 -r$SDR_DEFRATE -p1024
-n2 &".
If you are sampling at 96000 Hz, you may need to change p1024 to something less;
I have to use p128. If you make p too low, you may start getting xrun
errors.
change:
echo " sdr-$DTTSP_PID:ol -> alsa_pcm:playback_1"
$JACKC sdr-$DTTSP_PID:ol alsa_pcm:playback_1
echo " sdr-$DTTSP_PID:or -> alsa_pcm:playback_2"
$JACKC sdr-$DTTSP_PID:or alsa_pcm:playback_2
echo " alsa_pcm:capture_1 -> sdr-$DTTSP_PID:il"
$JACKC alsa_pcm:capture_1 sdr-$DTTSP_PID:il
echo " alsa_pcm:capture_2 -> sdr-$DTTSP_PID:ir"
$JACKC alsa_pcm:capture_2 sdr-$DTTSP_PID:ir
to:
echo " sdr-$DTTSP_PID:ol -> oss:playback_1"
$JACKC sdr-$DTTSP_PID:ol oss:playback_1
echo " sdr-$DTTSP_PID:or -> oss:playback_2"
$JACKC sdr-$DTTSP_PID:or oss:playback_2
echo " oss:capture_1 -> sdr-$DTTSP_PID:il"
$JACKC oss:capture_1 sdr-$DTTSP_PID:il
echo " oss:capture_2 -> sdr-$DTTSP_PID:ir"
$JACKC oss:capture_2 sdr-$DTTSP_PID:ir
The /dev/dsp numbers depend on how you have OSS configured. Unlike the stock alsa
configuration, OSS will NOT change the order of the soundcards when you reboot.
This eliminates a major annoyance. The easiest way to determine what devices are
available on your system is to type "/lib/oss/bin/./ossinfo" which will give you
a list of all of the devices. The output from this looks like this on my
computer which has 2 delta44's and onboard sound as well:
----------
debian:/lib/oss/bin# ./ossinfo
Version info: OSS/Linux 3.99.4b (0x00040000)
Number of audio devices: 24
Number of MIDI devices: 0
Number of mixer devices: 4
MIDI devices (/dev/midi*)
Mixer devices (/dev/mixer*)
0: AC97 Mixer (AD1980) (Mixer 0 of card 0)
1: M Audio Delta 44 (Mixer 0 of card 1)
2: M Audio Delta 44 (Mixer 0 of card 2)
3: Virtual Mixer (Mixer 0 of card 3)
Audio devices (/dev/dsp*)
0: Intel ICH6 (266E) (audio port 0 of card 0)
1: Intel ICH6 (266E) (shadow) (audio port 1 of card 0)
2: M Audio Delta 44 out1/2 (audio port 0 of card 1)
3: M Audio Delta 44 out3/4 (audio port 2 of card 1)
4: M Audio Delta 44 in1/2 (audio port 10 of card 1)
5: M Audio Delta 44 in3/4 (audio port 12 of card 1)
6: M Audio Delta 44 input from mon. mixer (audio port 20 of card 1)
7: M Audio Delta 44 (all outputs) (audio port 0 of card 1)
8: M Audio Delta 44 (all inputs) (audio port 10 of card 1)
9: M Audio Delta 44 out1/2 (audio port 0 of card 2)
10: M Audio Delta 44 out3/4 (audio port 2 of card 2)
11: M Audio Delta 44 in1/2 (audio port 10 of card 2)
12: M Audio Delta 44 in3/4 (audio port 12 of card 2)
13: M Audio Delta 44 input from mon. mixer (audio port 20 of card 2)
14: M Audio Delta 44 (all outputs) (audio port 0 of card 2)
15: M Audio Delta 44 (all inputs) (audio port 10 of card 2)
16: OSS Virtual Mixer v2.5 Playback CH #0 (audio port 0 of card 3)
17: OSS Virtual Mixer v2.5 Playback CH #1 (audio port 1 of card 3)
18: OSS Virtual Mixer v2.5 Playback CH #2 (audio port 2 of card 3)
19: OSS Virtual Mixer v2.5 Playback CH #3 (audio port 3 of card 3)
20: OSS Virtual Mixer v2.5 Playback CH #4 (audio port 4 of card 3)
21: OSS Virtual Mixer v2.5 Playback CH #5 (audio port 5 of card 3)
22: OSS Virtual Mixer v2.5 Playback CH #6 (audio port 6 of card 3)
23: OSS Virtual Mixer v2.5 Playback CH #7 (audio port 7 of card 3)
----------
When you look at this, you can see why my playback device is /dev/dsp
[/dev/dsp0] and my input device is dev/dsp4.
Back to top
12. Edson Pereira
has included a very nice script to start jack and sdr-core, called sdr.sh,
in his tar.gz file, and I would recommend that you use it, and modify it as
necessary for your system. Things ran right off the bat here with Edson's script
plus a few minor modifications to 'tweak it' for my system here.
When I run the script I get the following output from the terminal:
debian:/wsenew# sdrg start
OSS is already running
> Starting jack...
Succeeded. JackD PID is 7325
jackd 0.101.1
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
oss_driver: /dev/dsp4 : 0x10/2/48000 (512)
oss_driver: /dev/dsp : 0x10/2/48000 (4096)
oss_driver: indevbuf 4096 B, outdevbuf 4096 B
oss_driver: using barrier mode, (dual thread)
> Starting dttsp...
Succeeded. DttSP PID is 7332
> Connecting dttsp to jack...
safemem 75688
sdr-7332:ol -> oss:playback_1
engine sample rate: 48000
sdr-7332:or -> oss:playback_2
engine sample rate: 48000
oss:capture_1 -> sdr-7332:il
engine sample rate: 48000
oss:capture_2 -> sdr-7332:ir
engine sample rate: 48000
debian:/wsenew#
Back to top
13. Download and
install John Melton's Java-Based GUI.
Because the java GUI expects these fifo files to be named without the leading ".", it is necessary to create some symbolic links so that both dttsp2 and the java GUI are happy:
While still in the directory /usr/local/sdr where the fifo's reside, type:
# ln -s .SDRcommands /usr/local/sdr/SDRcommands [or /usr/local/sdrhw/SDRcommands,
etc]
# ln -s .SDRspectrum /usr/local/sdr/SDRspectrum
# ln -s .SDRmeter /usr/local/sdr/SDRmeter
13d. Figure out the alsa or oss assignments for your devices and soundcards, as appropriate, as above in .
13e. You are now ready to run the programs. You can modify Edson's script
to do this, or use the script below if you run OSS. If you run alsa sound,
you will need to make your own script. Having done all of this, things ran
right off the bat.
-----------
#! /bin/sh
# Usage: .szoss2 start|stop
# Based on a script by Edson Pereira, pu1jte, n1vtn. Slightly modified by
w3sz
# This version is configured for OSS
# Start OSS
/lib/oss/bin/./soundon
##############################################################################
# Configurable parameters
JACKD=/usr/bin/jackd
JACKDRT=/usr/bin/jackstart
JACKC=/usr/bin/jack_connect
SRATE=48000
# SRATE=44100
HOUT=/dev/dsp
HIN=/dev/dsp4
DTTSP="/usr/local/bin"
DTTSP1="/usr/local/sdr/"
DTTSP_SHELL="/usr/local/sdr/"
# sdr-core commands can be put here as well
DTTSP_CMDS="setSpectrumType 1"
CMD_FIFO=$DTTSP1/.SDRcommands
##############################################################################
# Test if we have the needed executables and directories
test -x $JACKD || ( echo "Can't find $JACKD"; exit 1 )
test -d $DTTSP || ( echo "Can't find $DTTSP"; exit 1 )
test -x $JACKC || ( echo "Can't find $JACKC"; exit 1 )
case "$1" in
start)
# Start jackd
echo "> Starting jack..."
$JACKD -R -d oss -P $HOUT -C $HIN -r $SRATE -p1024 -n2 &
JACKD_PID=$!
if [ $JACKD_PID ]
then
sleep 5
echo $JACKD_PID > /var/run/jackd.pid
echo " Succeeded. JackD PID is $JACKD_PID"
else
echo " Failed"
exit 1
fi
# Start dttsp
echo "> Starting dttsp..."
cd $DTTSP
./sdr-core -s -m &
DTTSP_PID=$!
JACKD_PID=$!
if [ $DTTSP_PID ]
then
echo $DTTSP_PID > /var/run/sdr-core.pid
echo " Succeeded. DttSP PID is $DTTSP_PID"
else
echo " Failed"
exit 1
fi
# Connect the ports
echo "> Connecting dttsp to jack..."
sleep 3
echo " sdr-$DTTSP_PID:ol -> oss:playback_1"
$JACKC sdr-$DTTSP_PID:ol oss:playback_1
echo " sdr-$DTTSP_PID:or -> oss:playback_2"
$JACKC sdr-$DTTSP_PID:or oss:playback_2
echo " oss:capture_1 -> sdr-$DTTSP_PID:il"
$JACKC oss:capture_1 sdr-$DTTSP_PID:il
echo " oss:capture_2 -> sdr-$DTTSP_PID:ir"
$JACKC oss:capture_2 sdr-$DTTSP_PID:ir
# Start dttsp-shell
cd $DTTSP_SHELL
java -jar softrock.jar
# Configure sdr-core
echo $DTTSP_CMDS > $CMD_FIFO
;;
stop)
JACKD_PID=`cat /var/run/sdr-core.pid`
DTTSP_PID=`cat /var/run/jackd.pid`
kill -9 $JACKD_PID $DTTSP_PID
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0
----------
When the GUI pops up, Click on "Configure" and change the location of the fifo files to /usr/local/sdr and then exit the GUI and restart it by typing "java -jar ./softrock.jar" from the /usr/local/sdr directory. If you have made a symbolic link from this file to the /usr/local/bin directory you can just type "java -jar softrock.jar".
Now you should have your signals visible on the waterfall and audible via the
speakers.
Back to top
14. Download and install John Melton's GTK-based GUI. by first going to his website
http://microsat.homelinux.org/dttsp/gsdr/ and downloading the binary file. If you did #3 above, this is unnecessary.
I put it in the /local/usr/sdr directory and also made a link to install it:
ln -s /usr/local/sdr/gsdr /usr/local/bin/gdsr.
I also modified Edson's script slightly and changed the fifo references in Edson's script so that the directory for these was /dev/shm, as that is what John's binary expects, and put in the necessary links pointing from here to the fifo's in /usr/local/sdr. With this John's GTK GUI ran right off the bat, with NO problems.
15. Get Presonus Firebox Working with Ubuntu Linux [Dapper]
I have been able to get the Presonus Firebox to work properly under Ubuntu
Linux [Dapper] with the 2.6.15-26-386 PREEMPT i686 kernel. Some of you like me
may want to use the Firebox with your SDR-1000 under Linux, so I give some
details of what I did here.
This is all circa October, 2006.
Getting this to work involved:
1. Adding a couple of lines to /etc/apt/sources.list so that alternate forms of
some packages required for FreeBob could be located and used to replace the
stock Ubuntu packages. [The new versions of jackd are designed to permit use of the
freebob driver].
2. Removing some of the stock Ubuntu packages that need to be replaced with
alternate versions to satisfy dependencies
3. Installing the alternate versions of these packages and some additional
prerequisites for FreeBob
4. Installing FreeBob
5. Making and Running a modified sdr.sh file [and changing SND_DRIV in /usr/dttsp/sdr/dttsp/bin/setup_env
to "freebob"]
The main difficulty / drawback of doing this is that Ubuntu uses its own special
versions of many of the standard Debian packages, and these do not satisfy the
dependencies of the files that need to be installed to get FreeBob working. It
is necessary at times to 'force' the install to occur in spite of these
dependency issues. If one does not take this tack of forcing the install rather
than letting apt automatically satisfy the dependencies, then one will end up
removing much of the basic Ubuntu system and surely have a mess which may not be
fixable short of reinstalling the OS. I have gotten everything to work here
without having to reinstall the OS, and am not aware of anything having been
'broken' in the process, ALTHOUGH IT IS CERTAINLY POSSIBLE that something is
broken and I have just not yet become aware of it.
My instructions below are NOT a step-by-step guide. I wish they were, but I did
this between 1 and 3:30 am this morning after a long work week and didn't take
notes in part because I didn't really start out planning to get this done. I was
just 'noodling around' to see what the problems would be if I tried to do this,
and they melted away one by one. I apologize for the lack of completeness. But
at least this [1] gives you a general outline and [2] lets you know it can be
done by a fellow non-guru.
I found this page to be very helpful:
http://freebob.sourceforge.net/index.php/FreeBoB_on_Debian_GNU/Linux
Here are some notes. Much of this is straight from the URL immediately above:
1. Add the following lines to your /etc/apt/sources.list and then do an 'apt-get
update':
deb http://pkg-freebob.alioth.debian.org/debian unstable main contrib non-free
deb-src http://pkg-freebob.alioth.debian.org/debian unstable main
contrib non-free
2. You MUST have Linux kernel raw1394 support. If you don't you won't get this
to work, of course, as you won't have FireWire support. The above URL tells you
what to do. Do it or quit here. I already had kernel raw1394 support, so I
didn't need to do anything in this regard.
3. apt-get install gnupg so you don't have certificate problems with the new
sources.list lines.
4. wget http://marciotex.googlepages.com/keypub_8709626B.asc -O - | apt-key add
-
[so you don't have certificate problems with the new sources.list lines].
5. apt-get update
6. apt-get install jackd qjackctl
I also did 'apt-get install libfreebob0' and I THINK I also got an alternate
version of libjack0.100.0-0 from this alternate repository [but am not
absolutely certain if that is where I got it].
7. apt-get install svn-buildpackage
8. $ cd /some/dir [where-ever you are going to do the downloads; I used
/download].
$ svn co svn://marciotex-guest@svn.debian.org/svn/pkg-freebob/libiec61883
$ cd libiec61883/trunk
$ svn-buildpackage -rfakeroot -us -uc
[takes a while]
$ cd /some/dir/libiec61883/build-area [/some/dir is where you did downloads].
$ ls -lah
and you should see a bunch of packages related to libiec61883.
If you get errors for unsatisfied dependencies [I did] then you will need to
download these packages, too. For this I used Debian-unstable packages starting
from the URL:
http://packages.debian.org/unstable/allpackages.html [or pick your favorite of
the other choices].
Some of the packages I ended up using to replace/add to Ubuntu packages via the
mechanism:
dpkg -i packagexxx.deb where packagexxx.deb is the name of the downloaded file
taken from the Debian-ustable package list URL above include:
tzdata_2007b-1_all.deb I had to force this.
libc6_2.3.6.ds1-6_i386.deb
libc6-i686_2.3.6.ds1-6_i386.deb
libasound2_1.0.13-1_i386.deb
libgcc1_4.1.1-16_i386.deb
gcc-4.1-base_4.1.1-16_i386.deb
libstdc++6_4.1.1-16_i386.deb
xmms-jack_0.16-2_i386.deb [only necessary if you already have xmms-jack or it
turns out to be a dependency]
libc6-dev_2.3.6.ds1-6_i386.deb I had to force this.
libraw1394-8_1.2.1-2_i386.deb
libraw1394-dev_1.2.1-2_i386.deb
libavc1394-dev_0.5.3-1+b1_i386.deb
libavc1394-0_0.5.3-1+b1_i386.deb
libxml2_2.6.26.dfsg-4_i386.deb
This is not necessarily a complete list. It is what I remember and my memory is
not good especially at 1-3 am. The Debian-unstable Package install series of
pages is good about showing you dependencies and it is easy to get the necessary
files. I took the tack of NOT getting any dependencies in advance, but just
getting those required by error messages encountered during the install process.
When I ran into a dependency that would, if I allowed Ununtu to take care of it
automatically, remove many [e.g.42] files from my OS, I just forced things with
dpkg -i --force-all packagexxx.deb. Do this [if at all] at your own risk. Things
turned out fine for me, but I have done this a few times before and though I am
still a newbie, I have at least developed an intuition about what might cause
trouble that is right most of the time [NOT all the time].
Note that there is a conflict between 'tzdata' and 'locales'. I would
recommend that you use apt-get or Synaptic to replace locales with 'belocs-locales-data'.
You should be able to just install this file from Synaptic or by doing 'apt-get
install belocs-locales-data' from the command line. This will remove
locales and substitute the belocs file. If you don't do this you will have
much difficulty each time you try to upgrade your Ubuntu system in the future
when that upgrade includes a new version of the 'locales' file. [NB as of April
2007 I believe there are new Ubuntu versions of these files that have been
repaired so that the conflict problem disappears. At least that is what
happened here when I did a recent upgrade].
Having done all of that I find that I can just start jackd with the command 'jackd
-d freebob' and jackd starts and the blue light comes on on the Firebox
indicating that all is well. This is a good quick check on whether or not things
have gone well for you. If the blue light does not come on, they have not.
I am able to start jackd either using my modified sdr.sh file [see below], or by
using qjackctl. If I use qjackctl then I need to start sdr-core using a
differently-modified sdr.sh [that has the jackd-related stuff removed]. In
either case after jack and sdr-core are started I run sdr-shell as usual, and
see and hear output from the SDR-1000 just as if I was using the Delta44 on the
other machine. The only issue of which I am aware is that when I start and stop things via sdr.sh, the 1394 link
does not get reset properly and I have to unplug and replug the firewire physical cable to get things to work the next time I type sdr start. If I use qjackctl, all the connections are properly terminated and then restarted when
requested, and I don't need to do this.
;)
Here is what I see when I run my modified sdr.sh:
root@w3sz-laptop:/usr/dttsp/sdr# sdr start
> Starting jack...
> freebob starting
Succeeded. JackD PID is 9518
jackd 0.102.10
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
Freebob using Firewire port 0, node -1
> Starting dttsp...
Succeeded. DttSP PID is 9523
> Connecting dttsp to FireBox
safemem 75688
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file
or directory
FreeBoB ERR: Error opening ALSA sequencer.
FreeBoB ERR: -----------------------------------------------------------
FreeBoB ERR: Error creating midi device!
FreeBoB ERR: FreeBob will run without MIDI support.
FreeBoB ERR: Consult the above error messages to solve the problem.
FreeBoB ERR: -----------------------------------------------------------
libiec61883 warning: Established connection on channel 0.
You may need to manually set the channel on the receiving node.
libiec61883 warning: Established connection on channel 1.
You may need to manually set the channel on the transmitting node.
sdr-9523:ol -> freebob_pcm:dev1p_MainOut 1+2 left
engine sample rate: 48000
sdr-9523:or -> freebob_pcm:dev1p_MainOut 1+2 right
engine sample rate: 48000
freebob_pcm:dev1c_LineIn 3+4 left -> sdr-9523:il
engine sample rate: 48000
freebob_pcm:dev1c_LineIn 3+4 right -> sdr-9523:ir
engine sample rate: 48000
root@w3sz-laptop:/usr/dttsp/sdr#
---end of screens from sdr start start-up.
My versions are:
# uname -a Linux w3sz-laptop 2.6.15-26-386 #1 PREEMPT Fri Sep 8 19:55:17 UTC
2006 i686 GNU/Linux
# jackd -V
jackd version 0.102.10 tmpdir /dev/shm protocol 16
I used svn for libiec61883 and debian versions of the other firewire packages.
My output for jack_lsp is:
# jack_lsp
sdr-9746:il
sdr-9746:ir
sdr-9746:ol
sdr-9746:or
sdr-9746:al
sdr-9746:ar
sdr-9746:tl
sdr-9746:tr
freebob_pcm:dev1c_Mic/InstIn 1+2 left
freebob_pcm:dev1c_Mic/InstIn 1+2 right
freebob_pcm:dev1c_LineIn 3+4 left
freebob_pcm:dev1c_LineIn 3+4 right
freebob_pcm:dev1c_SpdifIn left
freebob_pcm:dev1c_SpdifIn right
freebob_pcm:dev1p_MainOut 1+2 left
freebob_pcm:dev1p_MainOut 1+2 right
freebob_pcm:dev1p_LineOut 3+4 left
freebob_pcm:dev1p_LineOut 3+4 right
freebob_pcm:dev1p_LineOut 5+6 left
freebob_pcm:dev1p_LineOut 5+6 right
freebob_pcm:dev1p_SpdifOut left
freebob_pcm:dev1p_SpdifOut right
root@w3sz-laptop:/usr/dttsp/sdr#
Finally, here is my version of Edson's sdr.sh, modified to work with FireBox:
#! /bin/sh
#
# sdr_02.sh
#
# Synopsis: The script starts jack, dttsp, connects the jack ports
#
# Version: @(#)sdr.sh v02 27-Aug-2006 ewpereira@gmail.com
#
# Author: Edson Pereira, pu1jte, n1vtn
#
# Usage: sdr_02.sh start|stop
#
##############################################################################
# Configure this to meet your environment
JACKD=/usr/bin/jackd
JACKDRT=/usr/bin/jackstart
JACKC=/usr/bin/jack_connect
DTTSP=/usr/local/bin
##############################################################################
# Setup the environment
. $DTTSP/setup_env
##############################################################################
if [ "$SND_DRIV" == "oss" ]
then
/lib/oss/bin/./soundon
/lib/oss/bin/./ossmix -d1 envy24.ratelock OFF
/lib/oss/bin/./ossmix -d1 envy24.rate $SDR_DEFRATE
HOUT=/dev/dsp
HIN=/dev/dsp4
else
if [ "$SND_DRIV" == "alsa" ]
then
ALSAH=hw:0
fi
fi
# Uncomment if your kernel has realtime capability
#REALTIME=1
##############################################################################
# Test if we have the needed executables and directories
if [ ! -x $JACKD ]; then
echo "Can't find $JACKD"
exit 1
fi
if [ ! -d $DTTSP ]; then
echo "Can't find $DTTSP"
exit 1
fi
if [ ! -x $JACKC ]; then
echo "Can't find $JACKC"
exit 1
fi
# If we have RT capability, get the realtime module ready
if [ $REALTIME ]; then
echo "Configuring realtime module"
JACKD="$JACKDRT -R"
rmmod capability
rmmod commoncap
modprobe realcap any=1 allcaps=1
fi
##############################################################################
case "$1" in
start)
##########################################################################
# Create FIFOs if needed
if [ ! -p $SDR_PARMPATH ]; then
mkfifo $SDR_PARMPATH
fi
if [ ! -p $SDR_METERPATH ]; then
mkfifo $SDR_METERPATH
fi
if [ ! -p $SDR_SPECPATH ]; then
mkfifo $SDR_SPECPATH
fi
##########################################################################
# Sanity check
if [ ! -p $SDR_PARMPATH ]; then
echo "Error while creating $SDR_PARMPATH fifo"
exit 1
fi
if [ ! -p $SDR_METERPATH ]; then
echo "Error while creating $SDR_METERPATH fifo"
exit 1
fi
if [ ! -p $SDR_SPECPATH ]; then
echo "Error while creating $SDR_SPECPATH fifo"
exit 1
fi
##########################################################################
# Make sure jack and dttsp are not already running
TMP=`ps -ef | grep jack | grep -v grep | wc -l`
if [ ! $TMP == 0 ]; then
echo "jackd is already running. Stopping..."
exit 1
fi
TMP=`ps -ef | grep sdr-core | grep -v grep | wc -l`
if [ ! $TMP == 0 ]; then
echo "sdr-core is already running. Stopping..."
exit 1
fi
##########################################################################
# Start jackd
echo "> Starting jack..."
if [ "$SND_DRIV" == "oss" ]; then
$JACKD -d oss -P $HOUT -C $HIN -r $SDR_DEFRATE -p128 -n2 &
elif [ "$SND_DRIV" == "alsa" ]; then
$JACKD -d alsa -d$ALSAH -r$SDR_DEFRATE -p1024 -n2 &
elif [ "$SND_DRIV" == "freebob" ]; then
echo "> freebob starting"
$JACKD -d freebob -r $SDR_DEFRATE -p1024 -n 2 &
fi
JACKD_PID=$!
if [ $JACKD_PID ]
then
echo $JACKD_PID > /var/run/jackd.pid
echo " Succeeded. JackD PID is $JACKD_PID"
else
echo " Failed"
exit 1
fi
##########################################################################
# Needed in some systems
sleep 1
##########################################################################
# Start dttsp
echo "> Starting dttsp..."
cd $DTTSP
$DTTSP/sdr-core -s -m &
DTTSP_PID=$!
JACKD_PID=$!
if [ $DTTSP_PID ]
then
echo $DTTSP_PID > /var/run/sdr-core.pid
echo " Succeeded. DttSP PID is $DTTSP_PID"
else
echo " Failed"
exit 1
fi
##########################################################################
# Connect the jack ports
if [ "$SND_DRIV" == "oss" ]; then
echo "> Connecting dttsp to jack..."
sleep 3
echo " sdr-$DTTSP_PID:ol -> oss:playback_1"
$JACKC sdr-$DTTSP_PID:ol oss:playback_1
echo " sdr-$DTTSP_PID:or -> oss:playback_2"
$JACKC sdr-$DTTSP_PID:or oss:playback_2
echo " oss:capture_1 -> sdr-$DTTSP_PID:il"
$JACKC oss:capture_1 sdr-$DTTSP_PID:il
echo " oss:capture_2 -> sdr-$DTTSP_PID:ir"
$JACKC oss:capture_2 sdr-$DTTSP_PID:ir
elif [ "$SND_DRIV" == "alsa" ]; then
echo "> Connecting dttsp to jack..."
sleep 3
echo " sdr-$DTTSP_PID:ol -> alsa_pcm:playback_1"
$JACKC sdr-$DTTSP_PID:ol alsa_pcm:playback_1
echo " sdr-$DTTSP_PID:or -> alsa_pcm:playback_2"
$JACKC sdr-$DTTSP_PID:or alsa_pcm:playback_2
echo " alsa_pcm:capture_1 -> sdr-$DTTSP_PID:il"
$JACKC alsa_pcm:capture_1 sdr-$DTTSP_PID:il
echo " alsa_pcm:capture_2 -> sdr-$DTTSP_PID:ir"
$JACKC alsa_pcm:capture_2 sdr-$DTTSP_PID:ir
elif [ "$SND_DRIV" == "freebob" ]; then
echo "> Connecting dttsp to FireBox"
sleep 3
echo " sdr-$DTTSP_PID:ol -> freebob_pcm:dev1p_MainOut 1+2 left"
$JACKC sdr-$DTTSP_PID:ol "freebob_pcm:dev1p_MainOut 1+2 left"
echo " sdr-$DTTSP_PID:or -> freebob_pcm:dev1p_MainOut 1+2 right"
$JACKC sdr-$DTTSP_PID:or "freebob_pcm:dev1p_MainOut 1+2 right"
echo " freebob_pcm:dev1c_LineIn 3+4 left -> sdr-$DTTSP_PID:il"
$JACKC "freebob_pcm:dev1c_LineIn 3+4 left" sdr-$DTTSP_PID:il
echo " freebob_pcm:dev1c_LineIn 3+4 right -> sdr-$DTTSP_PID:ir"
$JACKC "freebob_pcm:dev1c_LineIn 3+4 right" sdr-$DTTSP_PID:ir
fi
;;
stop)
JACKD_PID=`cat /var/run/sdr-core.pid`
DTTSP_PID=`cat /var/run/jackd.pid`
kill -9 $JACKD_PID $DTTSP_PID
;;
##############################################################################
# Give up
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0
Back to top
16. How to get SDR-1000 Hardware Control working under Ubuntu Linux [Dapper]
This is not the final answer to using the SDR-1000 with Linux. But if you want to get started playing now, this is a way to do it. Currently interactively controlling the SDR-1000 in Linux requires typing commands while running python. Likely there will be a GUI shortly. This is all circa March 9, 2007.
As of March 9, 2007, Eric Wachsmann, Frank Brickle, and Bob McGwier have gotten their hardware control software working and the download from svn will work without the need for modifications. The available SDR1000 control commands can be found in the file 'hw_sdr1000.h' which is part of the download. I have not tried to transmit yet using this interface, but have tested and found that the following commands work:
StandBy() Puts the SDR-1000 in standby mode. No contents within ().
PowerOn() Puts the SDR-1000 in operate mode. No contents within ().
SetFreq() Sets the DDS and filters for desired frequency expressed as (w.xyz) MHz
SetBPF() Sets the BPF filter frequency, expressed as (w.xyz) MHz. SetFreq takes care of this.
SetLPF() Sets the LPF filter frequency, expressed as (w.xyz) MHz. SetFreq takes care of this.
SetINAOn() Turns the LNA On (False) or Off (True).
SetATTOn() Turns the Attenuator On (True) or Off (False).
SetXVTR_RF() Switches the RF path to the transverter port (True) or away from it (False).
Create a directory /usr/local/sdrhw [mkdir /usr/local/sdrhw].
Then get the download via svn by typing : svn co svn://206.216.146.154/svn/repos_sdr_linux/trunk . This will create a directory /usr/local/sdrhw/trunk that contains dttsp, hardware libraries, test code, and swig for linux, cygwin, and visual studio 2005. Current svn version as I type this is 90.
Copy the trunk directory to a directory for the current repository by typing: cp -r trunk sdrhw-r90 [or whatever the version number is].
Then create a symbolic link by typing: 'rm sdrhw' and then 'ln -s sdrhw-r90 [or whatever your version number is] sdrhw'. This way you can set up all of your scripts so that they use the directory /usr/local/sdrhw/sdrhw and you won't need to change them when you get new versions of the software; you will just need to delete and re-create the link by typing from the directory /usr/local/sdrhw 'rm sdrhw' and then 'ln -s sdrhw-r91 [or whatever] sdrhw' after you do the svn download and copy the trunk directory to a new directory sdrhw-r91 [or whatever] as above.
Note that there are certain pre-requisite files or 'dependencies' that you will need to compile dttsp and the SDR-1000 control software. I listed what is necessary for dttsp in section 2, above. You will of course need python, python2,4-dev, swig, the libusb packages and possibly some other files [e.g. doxygen] in addition. To get these files do the following:
To get python: 'apt-get install python' [add sudo at the beginning if not root]
To get python2.4-dev: 'apt-get install python2.4-dev' [add sudo at the beginning if not root]
To get swig: 'apt=get install swig' [add sudo at the beginning if not root]
To get doxygen: 'apt=get install doxygen' [add sudo at the beginning if not root]
To get libusb:
You can run Synaptic and search on 'libusb' and install what you find. I have installed
on the laptop here libusb++0.1-4, libusb++-dev, libusb-0.1-4, libusb-dev. Or, you can do 'dpkg -l libusb*' and see what pops up and install what seems appropriate. When I do this it shows that I have the files just mentioned installed, and that I don't have 'libusb0' installed.
The x64 machine has libusb++0.14c2 instead of libusb++0.1-4.
To compile all of the software you have downloaded from the svn repository, make sure you are in the /usr/local/sdrhw/sdrhw/dttsp/src directory and type './configure' without the quotes, and then type 'make' without the quotes and then 'make install' without the quotes [this last one may be unnecessary]. To compile the SDR-1000 hardware control software go to /usr/local/sdrhw/sdrhw/hardware/sdr1000/build/linux and type 'make' and 'make -f swig.mk' and the hardware control software will be installed. Then type './hwtest' to start the SDR1000 using the compiled C++ test program. You can modify ../hw_test.cpp to set things up as you like. For the make commands, if you are not root you will need to type 'sudo make' instead of 'make' each time.
The easiest way to control the hardware is to either use the GUI I describe below, or to run things interactively from python. There are two ways to do the latter, either from the command line in your terminal window after invoking python, or with IDLE:
[IDLE - an Integrated DeveLopment Environment for Python ]. The Idle shell adds some convenience to playing with python, but I tend to just run 'python' from the command line and so I describe the python command-line method here.
To run python from the command line, from the /usr/local/sdrhw/sdrhw/hardware/sdr1000/build/linux directory type:
>python
>>>import sys
>>>from sdr1khw import *
>>>sdr = SDR1000('test', True, True, False, 0x378)
>>>sdr.PowerOn()
>>>sdr.SetFreq(7.05 - 0.11025)
and the SDR will be set up to receive around 7.05 MHz. To get out of python when you are done playing, type "ctl-d". IDLE works similarly...just type 'idle' from within the ../build/linux directory instead of typing 'python' to start and then proceed as above. The IDLE interface looks like this:

To keep from having to type all of the above every time you want to run the SDR1000, you can make up and put in the ../build/linux directory a python script hw_test.py that includes the following text:
----------------------------
#! /usr/bin/env python
import sys
from sdr1khw import *
sdr = SDR1000('test', True, True, False, 0x378)
sdr.PowerOn()
sdr.SetFreq(7.05 - 0.11025)
try:
sys.stdin.read()
except KeyboardInterrupt:
pass
----------------------------
And then when you want to control the SDR1000 just type:
>python [or idle]
>>>execfile("hw_test.py")
>>>ctl-C [to get back to the python '>>>' prompt]
>>>sdr.SetFreq(14.025) to change to another frequency, and so on.
In addition to having the SDR1000 hardware running, you need to have the DSP software [DttSP] running. Assuming that you have set DttSP up as shown earlier on this webpage, open another terminal shell and type 'sdr start' and 'sdr-shell &' to start receiving. Note that if you your setup is like mine you will need to add setup_env to the /usr/local/bin directory for things to work properly. You will need to make sure that the script 'sdr' points to the right directory for your new dttsp files; for me, that is also /usr/local/bin.
Here is a little widget tktest.py that will start the SDR-1000 and let you move its frequency up and down by
250 kHz, 50 kHz, 5 kHz
or 50 Hz [that is all you need with a GUI and waterfall] or type in a frequency of your choice, change bands, separately activate or deactivate the LNA and attenuator, or reset the unit. Put it in your ../hardware/sdr1000/build/linux directory. When it starts up it will center the SDR-1000 on approximately 7.050 MHz. It assumes that your parallel port 0x378 is being used to control the SDR-1000. To run it just type: 'python tktest.py'. Here is an image of the GUI:
To select a band, just click on the 'RadioButton' for the band you want and the
SDR-1000 will go to the last frequency you used on that band, or to the default
frequency in the sdrini file if you haven't used that band before.
Clicking on the 'up 5 kHz' or 'down 5 kHz' button moves the SDR-1000 up or down
5 kHz, respectively. Since my SDR-Shell waterfall is set to show a bit
more than 5 kHz either side of center, this works well for tuning up or down the
bands. Clicking on the 'up 50 Hz' or 'down 50 Hz' buttons of course moves
the SDR-1000 up or down 50 Hz. This is good for 'fine-tuning' a station
after you've clicked on it in the SDR-Shell to bring it into the filter passband,
and is much more convenient that trying to fine tune by clicking the mouse.
The 'reset' button resets the SDR-1000 by reading in the defaults from the sdrini file, and doing a 'power-on' to the SDR-1000. The 'LNA On' and 'LNA Off' buttons turn on and off the LNA. The 'Att On' and 'Att Off' do the same for the attenuator.
You can type a frequency into the text window above the 'Frequency' label if you want. When you click on the 'QSY' button it will send that frequency to the SDR and you can tune from there using the up and down 5 and 50 buttons. If you try to enter a frequency below 12 kHz or above 60 MHz, the widget won't accept it. If you hit the 'Enter' key while the focus is on the frequency textbox, the frequency will be erased and not entered. So avoid hitting 'Enter' after you have entered a frequency; click on the 'QSY' button instead.
Clicking on the 'QUIT' button closes the widget. Please let me know if this widget is or is not useful for you, and report any problems that occur with it.
Now that Frank and Bob's SDR1000 control software is running, Hamlib has been superceded. The text below is thus primarily of historical interest and I include it here only so that I can find the method again if asked. To run Hamlib at a terminal prompt type 'rigctl -vvvvv -m 2301' and Hamlib should startup. 'f' is the command to getfreq and thus see what frequency the SDR-1000 is set to. 'F' is the Hamlib command to send the frequency instruction to the rig. Frequency in Hamlib is given in Hz so type something like 'F 7050000' and you should immediately be listening to cw on 40 meters, assuming that you already have dttsp running [see earlier sections on this page if you don't]. Once in Hamlib, '?' shows many Hamlib commands, many of which aren't implemented in Hamlib for the sdr-1000 or at least I haven't figured them out. The following commands function: 'f' for get frequency, 'F' for set frequency, 'T' for transmit, 'L PREAMP' for set preamp level, L ATT for set attenuator level. You need to set T to '1' for transmit. Acceptable preamp levels are '0' and '26'. Acceptable attenutor levels are '0' and '10'. You can see what Hamlib THINKS should work by typing 'rigctl -u -m 2031' from a terminal prompt.
The sequence of commands that I use here to control the SDR-1000 hardware with Hamlib and receive using Edson's SDR-Shell here is:
sdr start
sdr-shell &
rigctl -vvvv -m 2301
F 7025000
L PREAMP 26
L ATT 10
Back to top 17.
How to get DttSP PortAudio version working under Ubuntu Linux
[Dapper]
This is updated on March 25, 2007. The PortAudio version of DttSP is still in a state of flux, under construction by Bob and Frank. The notes below apply to my system and may not work on yours. I started with my system in the state created by applying the suggestions noted in numbers 1, 2, 6, 7, 8, 9, 15, and 16 above.
I downloaded and am using: versions 0.101.1-2.1 of jackd, libjack, and libjack-dev [0.100.0 of jackd also works]. libasound-plugins is v. 1.0.10-1 and libjackasyn0 is v. 0.11-2ubuntu2. qjackctl is v. 0.2.21-1. Other versions may well work, but I cannot vouch for them. If you are not sure where to get these files, then you definitely should not be considering following this recipe. The links for getting these files are omitted for your protection!
To get PortAudio to work with DttSP I had to remove some Ubuntu Library files. I did this using Synaptic, but you could also do it using apt-get. Doing this resulted in the removal of OpenOffice and also the ubuntu-desktop metafile. I removed libportaudio0 and libportaudio-dev, both of which were Ubuntu-version files.
I am using the svn version of PortAudio. This is currently #1182. You can obtain it by typing:
svn co https://www.portaudio.com/repos/portaudio/branches/v19-devel
I set up a directory /usr/portaudio that is my 'working' directory for portaudio projects, and I made sure I was in that directory "cd /usr/portaudio" before typing this command.
Then I typed "cd v19-devel" and then "./configure" and then "make" and then "make install"
Then type "ldconfig" and then "export LD_LIBRARY_PATH=usr/local/lib". You will need to set LD_LIBRARY_PATH to this value as an environmental variable each time you try to run the DttSP version of PortAudio after rebooting. I do this by running a script each time I start qjackctl, as will be explained below. For some reason the way I set this in /etc/environment and /etc/profile didn't do the trick.
I had to make symbolic links to some library files to get things to work. Do this only if you get errors that indicate the need to do this [i.e., error messages that indicate the library file in question is 'missing']:
ln -s /usr/local/lib/libportaudio.so.2.0.0 /usr/local/lib/libportaudio.so.2
ln -s /usr/local/lib/libportaudio.so.2.0.0 /usr/local/lib/libportaudio.so.0
ln -s /usr/local/lib/libportaudio.so.2.0.0 /usr/local/lib/libportaudio.so
Again, I emphasize that I would recommend that you try doing the installation without these and only add them if needed, and then sequentially as noted.
Once you have PortAudio installed, you need to download and install dttsp-pa. I put this into a directory /usr/dttsp-save. Once that directory was created I typed "cd /usr/dttsp-save" and then
svn co svn://206.216.146.154/svn/repos_sdr_linux/branches/ab2kt/dttsp-pa
Then type "cd dttsp-pa/src" and then "./configure", "make", and "make install". Once you have done this, you can start qjackctl and then left-click on the "Start" button to start the jackd server. The Messages window will show you any errors. Bring up the Connect window if it is not already open by left-clicking on the "Connect" button:

Now I will describe what you need to do to set qjackctl and jack and PortAudio up to work with [1] Alsa or [2] Freebob jack backends.
1. To use the Alsa backend to jack with qjackctl and PortAudio, with the Delta44 soundcard as input and Intel HDA onboard sound as output:
First you need to click on the "Setup" button on qjackctl. This will bring up the screen below. Set the parameters as shown on the screen:

In particular, make sure you have the following parameters set as noted:
Driver: alsa
Audio: Duplex
Input: hw:1,0 [ICE1712 Multi]
Output: hw:0 [HDA Intel]
Input Channels: 12 [Values of 0 thru 8 don't work; I didn't try 9,10,11.
After discovering this for myself I found a note on the web that indicates that Jack considers
the Delta 44 to be "12 and 10". I assume this means it considers the
Delta 44 to have 12 input channels and 10 output channels.]
Output Channels:2 [this specification is for the Intel HDA as it is being used
for output]
Frames/Period: 1024
Sample Rate: 48000
These parameters are specific to using the Delta44 as input and onboard Intel HDA sound as output.
Click on "Save" or "OK" to save these parameters. Now click on "Cancel" to get back to the main qjackctl GUI.
Click on "Start" to start the jack server. You should now see a window that looks like:

The device labels are some of those that you need to know to manually set things up to work with your particular soundcard, or to write a script to set things up. As long as you use qjackctl's GUI, it keeps track of things for you. At this point, you have not started DttSP, and so the DttSP devices are not visible.
Next you need to figure out what device number PortAudio is going to give the DttSP devices, so that you can set those parameters when you start DttSP [sdr-core]. With the jack server running, go to the /usr/portaudio/v19-devel/bin directory and type "./pa_devs". You will get a listing of device numbers generated by this PortAudio script. Using the Alsa sound driver and with a Delta44 soundcard and Intel HDA onboard sound, the pa_devs output showed as the last device:
--------------------------------------- device #7
[ Default JACK Audio Connection Kit Input, Default JACK Audio Connection Kit Output ] Name = alsa_pcm Host API = JACK Audio Connection Kit Max inputs = 12, Max outputs = 2 Default low input latency = 0.021 Default low output latency = 0.021 Default high input latency = 0.021 Default high output latency = 0.021 Default sample rate = 48000.00 Supported standard sample rates for half-duplex 16 bit 12 channel input = 48000.00 Supported standard sample rates for half-duplex 16 bit 2 channel output = 48000.00 Supported standard sample rates for full-duplex 16 bit 12 channel input, 2 channel output = 48000.00
----------------------------------------------
so I knew that I needed to use device #7 for DttSP with PortAudio.
So, with qjackctl running and the jackd server invoked and the Connect GUI showing I next went to the directory /usr/dttsp-save/dttsp-pa/src and typed "./sdr-core --sndev-in=7 --sndev-out=7 -s -m" [note that you have to have already created the SDRcommands, SDRspectrum, and SDRmeter fifo's by this point; see above or look in the qjacksdr script]. This started sdr-core and after about 22 seconds the DttSP devices appeared in the Connect window which then looked like this:

The GUI now shows also the PortAudio DttSP device labels needed: PortAudio-5336:out_0, PortAudio-5336:out_1, PortAudio-5336:in_0, and PortAudio-5336:in_1. The numerical designation is the PID and changes each time DttSP is run. The script below takes care of figuring out what it is so that you can automatically start DttSP, setup the connections properly, and start sdr-shell each time you start the jackd server from qjackctl.
Once all of the was done, I wrote a couple scripts, modified from Edson Pereira's sdr.sh script, to get everything setup automatically and started automatically each time the jackd server is started from within qjackctl. One of these scripts is invoked when the jackd server is started from qjackctl, and the other is invoked when the jackd server is stopped from qjackctl. The startup script is called qjacksdr and is here, and the stop script is called qjackctl-sdr-stop and is here. You set up qtackctl to use these by going to the "Options page" and setting it up as shown here:

Clicking on the "..." button will bring up a directory listing so you can select the desired script files. As noted above, you will need to modify qjacksdr to reflect your particular system environment and soundcard setup. You can figure out what soundcard settings to use by looking at the output of ../v19-devel/test/pa_devs and also by running qjackctl without the scripts and after you have DttSP-pa installed, running it by typing "./sdr-core --sndev-in=xxx --snd-dev-out=yyy -s -m" where xxx and yyy are the numbers you obtained from the output of pa_devs. You need to run sdr-core from the ../dttsp-pa/src directory. All of this is explained above. Don't forget to set permissions on the script files so that you can execute them!
Here is a listing of what appears in the "Messages" window of qjackctl when I start the jack server using qjackctl and the qjacksdr script discussed above:

Note that although there are messages of the type "ERROR PortAudio-5336:out_0 not a valid port" [etc.], PortAudio starts up fine and in fact connects these ports appropriately. I suspect that the errors are due to the significant delay that occurs before the connections are made [approximately 22 seconds].
2. To use the Freebob backend to jack with qjackctl and PortAudio, with the Presonus Firebox sound system:
First start qjackctl and click on "Setup" from the main qjackctl GUI. This will bring up the setup screen. Set its parameters as shown here and then click on "OK" or "Save" on the setup page to save the parameters:

Now click on "Cancel" to get back to the main qjackctl GUI. Next "Start" the jack server using qjackctl by clicking on the "Start" button. You should see a window that looks like:

The device labels are some of those that you need to know to manually set things up to work with your particular soundcard. As long as you use qjackctl's GUI, it keeps track of things for you. At this point, you have not started DttSP, and so the DttSP devices are not visible.
Next you need to figure out what device number PortAudio is going to give the DttSP devices, so that you can set these parameters when you start DttSP (sdr-core). Go to the /usr/portaudio/v19-devel/bin directory and type "./pa_devs". You will get a listing of device numbers generated by this PortAudio script. I need to use the freebob driver for my Presonus Firebox, and the pa_devs output showed as the last device:
--------------------------------------- device #11
[ Default JACK Audio Connection Kit Input, Default JACK Audio
Connection Kit Output ]
Name = freebob_pcm
Host API = JACK Audio Connection Kit
Max inputs = 6, Max outputs = 8
Default low input latency = 0.000
Default low output latency = 0.000
Default high input latency = 0.000
Default high output latency = 0.000
Default sample rate = 48000.00
Supported standard sample rates
for half-duplex 16 bit 6 channel input =
48000.00
Supported standard sample rates
for half-duplex 16 bit 8 channel output =
48000.00
Supported standard sample rates
for full-duplex 16 bit 6 channel input, 8 channel output =
48000.00
----------------------------------------------
so I knew that I needed to use device #11 for DttSP with PortAudio.
So, with qjackctl running and the jackd server invoked and the Connect window showing I next went to the directory /usr/dttsp-save/dttsp-pa/src and typed "./sdr-core --sndev-in=11 --sndev-out=11 -s -m" [note that I had already created the SDRcommands, SDRmeter, and SDRspectrum fifos; see above or look in the qjacksdr script]. This started sdr-core and the DttSP devices appeared in the Connect window which then looked like this:

This was great but I needed Linein 3+4 for the Firebox, NOT Mic/InstIn 1 + 2. It was just a matter of highlighting and connecting/disconnecting the appropriate devices using the GUI to get the proper setup so that I could hear the SDR-1000 using DttSP-pa. After setting things properly, the Connect window looked like this:

The GUI now shows also the PortAudio DttSP device labels needed: PortAudio-7511:out_0, PortAudio-7511:out_1, PortAudio-7511:in_0, and PortAudio-7511:in_1. The numerical designation is the PID and changes each time DttSP is run. The script below takes care of figuring out what it is so that you can automatically start DttSP, setup the connections properly, and start sdr-shell each time you start the jackd server from qjackctl.
Once all of the was done, I wrote a couple scripts, modified from Edson Pereira's sdr.sh script, to get everything setup automatically and started automatically each time the jackd server is started from within qjackctl. One of these scripts is invoked when the jackd server is started from qjackctl, and the other is invoked when the jackd server is stopped from qjackctl. The startup script is called qjacksdr and is here, and the stop script is called qjackctl-sdr-stop and is here. You set up qtackctl to use these by going to the "Options page" and setting it up as shown here:

Clicking on the "..." button will bring up a directory listing so you can select the desired script files. As noted above, you will need to modify qjacksdr to reflect your particular system environment and soundcard setup. You can figure out what soundcard settings to use by looking at the output of ../v19-devel/test/pa_devs and also by running qjackctl without the scripts and after you have DttSP-pa installed, running it by typing "./sdr-core --sndev-in=xxx --snd-dev-out=yyy -s -m" where xxx and yyy are the numbers you obtained from the output of pa_devs. You need to run sdr-core from the ../dttsp-pa/src directory. All of this is explained above. Don't forget to set permissions on the script files so that you can execute them!
With this version of DttSP, you can have multiple instances of sdr-core running and thus many radios running at the same time. Here is an example of the qjackctl Connect window where I have 6 instances of sdr-core running at the same time. By defining different 'pipes' or fifos for each radio, you could have 6 different SDR's running and controlled from the same computer screen at one time!

With PortAudio and Jack Audio Connection Kit [qjackctl] and Jack you can play many interesting games with DttSP. Here is a screendump taken with mhWaveEdit playing back at 1/5 speed a portion of the 20 meter cw band it recorded minutes before. With the slow-speed input to DttSP and SDR-Shell you can easily read the Morse Code as it travels down the waterfall. On the left you see "OK Ted 7...", then "til es hpe to", then "yrs / so", and on the very right, "es sun nice":

With the Jack Audio Connection Kit [qjackctl] it is easy to hook the mhWaveEdit sound recorder/editor/player to the inputs and outputs necessary to first 'steal' and record the input to DttSP from the soundcard and then to process it and play the processed file back into the input to the DttSP so that the processed file now serves as the input to DttSP and SDR-Shell, just as if it were coming directly from the SDR-1000.
I hope the above is helpful to you. If you have problems, join the dttsp-linux yahoogroup and let me know how I can help! This link should get you to the yahoo dttsp-linux homepage, from which you can join the group if you don't already belong. You need to join to read the posts, etc.
Good luck! I am having a blast with this. Thanks Eric and Frank and Bob and Edson and
John and Takafumi etc! Let me know if there are any problems.
Copyright © 1997-2007 COPYRIGHT Roger Rehr W3SZ. All Rights Reserved