Loading ...
Sorry, an error occurred while loading the content.

Re: [softrock40] Linux SDR Software with Softrock - a summary of recent personal experience

Expand Messages
  • Edson Pereira
    Alex, ... For TX you will need: 1. A soundcard with two stereo inputs and two stereo outputs. Or 2. two separate soundcards. 3. If (2), jackd will need the
    Message 1 of 59 , Dec 1, 2009
    • 0 Attachment
      Alex,

      >> I still have not been able to find out how to use SDR-Shell for Tx.
      >>
      >>

      For TX you will need:

      1. A soundcard with two stereo inputs and two stereo outputs. Or
      2. two separate soundcards.
      3. If (2), jackd will need the additional alsa_in and alsa_out tools
      (part of jack but not included in many Lunux distributions) or jack2
      with the audioadapter plugin (more on this later).
      4. Another instance of sdr-core. One will be used for RX and another for TX.
      5, Some code in SDR-Shell to orchestrate the sdr-cores.

      The major challenge in getting a transceiver using sdr-core is the fact
      that, as far as I know, jack in its present state does not support two
      separate unsynchronized sound cards. To remediate this I am using the
      audioadapter plugin in jack2. The plugin was originally designed to be
      used with netjack on a slave PC. All it does is to get a jack audio
      stream, resample it, and deliver the stream to a native ALSA device. In
      jack1, there are the alsa_in and alsa_out tools that accomplishes more
      or less the same thing.

      The two sdr-cores are needed in order to avoid having to switch jack
      connections (and audio cables) during rx/tx transitions. For phone, this
      would not be much of a problem, but for CW, it is not good. The small
      CPU overhead by running another sdr-core should be very small. The
      sdr-core for RX will listen on the SDR hardware I-Q audio stream and
      deliver audio to the PC speaker. The sdr-core for TX will listen on the
      PC's mic input and deliver I-Q audio to the SDR hardware. SDR-Shell
      needs to feed control data to both sdr-cores so that they can be in sync
      (NCO frequency, mode, filters, etc.).

      73,

      -- Edson, pu1jte, n1vtn, jf1afn
    • andrew.nilsson
      Thanks for that Alex. I definitely need to upgrade to jack 2 if I m going to progress further. I ll have a look at the later versions of sdr shell. I think I m
      Message 59 of 59 , Dec 13, 2009
      • 0 Attachment
        Thanks for that Alex. I definitely need to upgrade to jack 2 if I'm going to progress further.

        I'll have a look at the later versions of sdr shell. I think I'm quite upto date with sdr-core. My problem was with the conversions from pipes to sockets, somehow it kept changing frequency without any input. If I can do away with that it would be better.

        Andrew

        --- In softrock40@yahoogroups.com, "alexle188" <lee188@...> wrote:
        >
        > Hi Andrew,
        >
        > Just in case it is of any help, below is my start_rx script:
        >
        > To use one sound card for capture and another sound card for playback of audio, change the jackd command from -Dhw:0 to:
        >
        > -Chw:1 -Phw:0
        >
        > for capturing in sound card 1 and playback in sound card 0.
        >
        > For different sound cards, PC's and distro's, you may have to play around with various parameters. For example, on my desktop I use JACK_BUFFER=1024. On my laptop I use JACK_BUFFER=2048.
        >
        > On my desktop internal sound card, the -n parameter of jackd is -n2. On my laptop using external USB sound card, the recommended is -n3.
        >
        > If you don't specify the "correct" params for your system, jackd will not start properly.
        >
        > I have found jack2 (v1.9.4) to be superior to jack1. With jack1, I could only run SDR_DEFRATE=48000. But with jack2 installed in place of jack1, I can run at 96000 (I don't have a 192000 sound card to play with, yet).
        >
        > It take a bit of trial and error and tips from experts to get SDR-shell running, but the result is worth the effort.
        >
        > I now have SDR-shell running in the background routinely when I have my Linux system running. I usually tune it to a SW broadcast station for listening to news/music. The audio is excellent and the cpu usage is light.
        >
        > 73's
        >
        > Alex
        >
        > #=============================================================
        >
        > #!/bin/bash
        >
        > # define name used in the RMI registry
        > NAME=SDR-SHELL
        > export SDR_DEFRATE=48000
        > export JACK_BUFFER=1024
        > export LD_LIBRARY_PATH=/usr/local/lib
        >
        > # start usbsoftrock daemon
        > echo "starting usbsoftrock..."
        >
        > usbsoftrock -a -d &
        >
        > # start jackd
        > echo "starting jackd ..."
        >
        > pasuspender -- jackd -s -dalsa -Dhw:0 -r$SDR_DEFRATE -p${JACK_BUFFER} -n2&
        >
        > sleep 5
        > # start RX DttSP
        > echo "starting DttSP ${NAME}_RX ..."
        > /usr/local/bin/sdr-core --spectrum --metering --client-name=${NAME}_RX --buffsize=${JACK_BUFFER} --ringmult=4 --command-port=19001 --spectrum-port=19002 --meter-port=19003&
        >
        > sleep 5
        > # connect receiver
        > echo "connecting receiver ..."
        > jack_connect system:capture_1 ${NAME}_RX:il
        > sleep 2
        > jack_connect system:capture_2 ${NAME}_RX:ir
        > sleep 2
        > jack_connect ${NAME}_RX:ol system:playback_1
        > sleep 2
        > jack_connect ${NAME}_RX:or system:playback_2
        > sleep 2
        >
        > # start sdr-shell
        > ./sdr-shell
        >
        > sleep 2
        > sdrpid=`ps -ef|grep sdr-core|head -n1|awk -vORS='' '{print $2}'`
        > echo "Killing sdr-core pid $sdrpid"
        > kill $sdrpid >/dev/null
        >
        > sleep 2
        > jackpid=`ps -ef|grep jackd|head -n1|awk -vORS='' '{print $2}'`
        > echo "Killing jackd pid $sdrpid"
        > kill $jackpid >/dev/null
        >
        > sleep 2
        > usbsoftrockpid=`ps -ef|grep usbsoftrock|head -n1|awk -vORS='' '{print $2}'`
        > echo "Killing usbsoftrock pid $usbsoftrockpid"
        > kill $usbsoftrockpid >/dev/null
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.