Saturday 7 July 2018

OpenWebRX - CSDR Audio Stream Via IceCast (SSTV Decoding on Windows)

Guys,

With the recent ISS SSTV event, I would normally use the audio from my FT991A and leave it running with both MMSSTV and RXSSTV running for the duration of the event. However this would mean taking my OpenWebRX 2m stream offline as I'd need to use the VHF antenna.

I could easily open a web browser head over to SDR.Hu and open my OpenWebRX SDR and set the frequency to 145.8MHz and making sure the default audio is the Virtual Audio Cable input then that would be one way to do it.  But I've seen that running the OpenWebRX client to long in a web browser does consume a fair bit of memory as it build that waterfall history over time.....

But with my recent fun with using CSDR to get a audio stream for APRS decoding I thought cool lets do the same thing for SSTV.

Well creating the audio stream monitoring 145.800 MHz under Linux was easy.... but my problem was there was NO SSTV decoders that would take a audio stream piped in from STDIN.  There is QSSTV for Linux but to GUI driven / controlled.

So I thought why not stream the audio and then I can either use a Media player and pipe into a Virtual Sound Cable under windows and similar for Linux to then allow the tool of choice to decode the audio from the virtual audio cable output.

My choice of tools to achieve this was:

1. Audio from CSDR piped via STDIN into EZStream.
2. EZStream feeds to IceCast2 server
3. Windows Media Player play out to a Virtual Audio Cable In
  • VB-Audio VoiceMeeter - This will provide a mixer and Virtual Audio In and Out.
  • VB-Audio Audio Cable -  For free provide a single Virtual Audio cable. So with this and VoiceMeter you will have access to 2 Virtual Audio Cables...
4. MMSSTV and RXSSTV both running decoding the audio from the Virtual Audio Cable Out

Installing the required tools under Linux

sudo apt-get -y install mplayer
sudo apt-get -y install lame
sudo apt-get -y install ezstream
sudo apt-get -y install icecast2

Config Icecast

Please note I will be assuming you have configured the general IceCast config options. Please follow the ICECast doco to complete this. The following is the config for a "mount point":

sudo vi /etc/icecast2/icecast.xml

       

    <mount type="normal">
        <mount-name>/sstv.mp3</mount-name>
        <source-password>srcadmin</source-password>
        <password>password</password>
        <max-listeners>10</max-listeners>
        <burst-size>65536</burst-size>
        <hidden>1</hidden>
        <public>0</public>
    </mount>
       
 


Restart the Icecast Service

sudo service icecast2 restart

Config EZStream 

 Create a EZStream config file with the following contents:

       

<ezstream>
    <url>http://localhost:8000/sstv.mp3</url>
    <sourcepassword>password</sourcepassword>
    <format>MP3</format>
    <filename>stdin</filename>
    <svrinfoname>SSTV STREAM</svrinfoname>
    <svrinfourl>http://www.vk4tmz.com.au</svrinfourl>
    <svrinfogenre>Scanner</svrinfogenre>
    <svrinfodescription>The audio from OpenWebRX for SSTV Decoding</svrinfodescription>
    <svrinfobitrate>16</svrinfobitrate>
    <svrinfochannels>1</svrinfochannels>
    <svrinfosamplerate>11025</svrinfosamplerate>
    <svrinfopublic>0</svrinfopublic>
</ezstream>
       
 


CSDR and EZStream Commands to stream the ISS SSTV audio to IceCast Server


       

export SDR_SAMPLE_RATE=5000000
export SDR_GAIN=IFGR=35,RFGR=2
export AUDIO_SAMPLE_RATE=11025
export AUDIO_GAIN=0.42
export FREQ_CENTER=145500000
export FREQ_MON=145800000
export FREQ_MON_BW=12000
export FIR_DISC_FACTOR=`python -c "print float($SDR_SAMPLE_RATE)/float($AUDIO_SAMPLE_RATE)"`
export FIR_DISC_TRANS_BW=`python -c "print float($FREQ_MON_BW)/float($SDR_SAMPLE_RATE)"`
export SHFT_ADD_PIPE=/tmp/rigctrld_openwebrx_shift_pipe
export SHFT_ADD=`python -c "print float($FREQ_CENTER-($FREQ_MON))/$SDR_SAMPLE_RATE"`
export NFM_LOW_CUT_FREQ=-4000
export NFM_LOW_CUT=`python -c "print float($NFM_LOW_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export NFM_HIGH_CUT_FREQ=4000
export NFM_HIGH_CUT=`python -c "print float($NFM_HIGH_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export FIR_NFM_TRANS_BW=`python -c "print (float($NFM_HIGH_CUT_FREQ) - float($NFM_LOW_CUT_FREQ))/float($AUDIO_SAMPLE_RATE)"`
export FIR_DSSB_BW=4800
export SSB_LOW_CUT_FREQ=300
export SSB_LOW_CUT=`python -c "print float($SSB_LOW_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export SSB_HIGH_CUT_FREQ=3000
export SSB_HIGH_CUT=`python -c "print float($SSB_HIGH_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export FIR_SSB_TRANS_BW=`python -c "print (float($SSB_HIGH_CUT_FREQ) - float($SSB_LOW_CUT_FREQ))/float($AUDIO_SAMPLE_RATE)"`

# Stream ISS SSTV Audio to IceCast using EZStream
nc -v 127.0.0.1 4951 | csdr shift_addition_cc $SHFT_ADD  | csdr fir_decimate_cc $FIR_DISC_FACTOR $FIR_DISC_TRANS_BW HAMMING | csdr bandpass_fir_fft_cc $NFM_LOW_CUT $NFM_HIGH_CUT $FIR_NFM_TRANS_BW HAMMING | csdr fmdemod_quadri_cf | csdr limit_ff | csdr old_fractional_decimator_ff 1.00158333333 | csdr deemphasis_nfm_ff 11025 | csdr fastagc_ff 1024 | csdr gain_ff $AUDIO_GAIN | csdr convert_f_s16 |  /usr/bin/lame -r -s 11.025 -m m -b 16 --cbr - -  | /usr/bin/ezstream -qvc /home/drifter/sdr/stream/sstv_ezstream.xml

       
 

To Check all OK:

  1. The output of the EZStream should be displaying the stream rate ~16Kbps.  If this is not the case check for errors and correct.
  2. Goto Icecast Admin portal http://localhost:8000 and log in as admin and confirm you can see the mount point
  3. let hear it so via your favorite media player tools (ie Windows media player or  Linux - MPlayer)
mplayer http://localhost:8000/sstv.mp3

With that all working I was then able to play the audio on my Windows PC pipe it into Virtual Audio Cable and run the SSTV decoding tools just fine.

The only little thing is like most "streaming" the tool "buffers" which creates a little latency.  In this case the audio when being monitoring via MPlayer or windows is ~30s delayed.  This was fine for me so I did not need to tune Icecast to minimise the latency but may be something you need to consider.

That's All Folks!! Hope you guys find this helpful :)

73
de VK4TMZ (Mark)

2 comments: