Using A Raspberry Pi as an SDR Based Feed Server For Brodcastify?

Status
Not open for further replies.
Joined
Jun 29, 2021
Messages
97
After taking a look around at some SDR information and the release of the Raspberry Pi Feed Appliance software form Brodcastify, I was wondering if it would be possible to use a Raspberry Pi 4 as both an SDR Receiver and a feed appliance all in one? Would this be possible with the current landscape of software and hardware or would it require windows to function properly?

East
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,492
Location
Talbot Co, MD
After taking a look around at some SDR information and the release of the Raspberry Pi Feed Appliance software form Brodcastify, I was wondering if it would be possible to use a Raspberry Pi 4 as both an SDR Receiver and a feed appliance all in one? Would this be possible with the current landscape of software and hardware or would it require windows to function properly?

East
Absolutely - there are lots of people using RPi3b and RPI4 to host their broadcastify feeds. One way to do it is with op25 as the sdr receiver and liquidsoap as the streaming interface. For a single feed you just need one RTL dongle and some patience to set it all up.
 
Joined
Jun 29, 2021
Messages
97
Good info to know! Do you know if it would be possible to "scan" automatically with SDR software. For example scan between the local fire and police department frequencies?
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,095
Location
NE Wisconsin
Good info to know! Do you know if it would be possible to "scan" automatically with SDR software. For example scan between the local fire and police department frequencies?

Are these on P25 Conventional or P25 Trunking Systems? There are options to setup multiple channels using multi_rx.py application in op25 but not in the sense of scanning multiple Analog FM channels. Are you local fire and police perhaps on the same system?
 
Joined
Jun 29, 2021
Messages
97
Are these on P25 Conventional or P25 Trunking Systems? There are options to setup multiple channels using multi_rx.py application in op25 but not in the sense of scanning multiple Analog FM channels. Are you local fire and police perhaps on the same system?
Neither. Its all UHF conventional. So based on what I now understand I wouldn't be able to "scan between two frequencies using an SDR. Right?
 

lwvmobile

DSD-FME
Joined
Apr 26, 2020
Messages
1,349
Location
Lafayette County, FL
So based on what I now understand I wouldn't be able to "scan between two frequencies using an SDR. Right?
You can do it with rtl_fm easily enough.

Code:
rtl_fm -d 0 -f 851.8M -f 855.9875M -f 858.4875M -f 851.375M -l 150 -s 28.8k -p -2.0 -g 36 | ./ledacs-esk-ncurses7b -x -s slers.csv -g slers-talkgroups.csv

I use this example to scan between 4 different frequencies to lock onto the control channel for an EDACS system, it never lets me down. Let's see, if you want to scan through and playback a few conventional analog channels you can use this:

Code:
rtl_fm -d 0 -f 851.8M -f 855.9875M -f 858.4875M -f 851.375M -l 150 -s 48.8k -p -2.0 -g 36 | sox -t raw -b 16 -e signed-integer -r 48000 -c 1 - -t raw - vol 2 sinc 0.2k-4.5k -a 110 rate 48000 | aplay -t raw -f S16_LE -r 48000 -c 1

Uses rtl_fm and scans through those frequencies, has a gain of 36 and squelch of 150 (-l 150 (lower case l)), passes through sox for a little sound shaping, and plays back through aplay. Simple. You may need to tweak values like the gain and squelch to get it just right. Advanced tweaking with sox to get the audio nice and beefy. Admittedly the above sox example was more for getting audio to pass through dsd nicer than for pure listening.

Recommended reading

Advanced reading for Sox
 
Joined
Jun 29, 2021
Messages
97
You can do it with rtl_fm easily enough.

Code:
rtl_fm -d 0 -f 851.8M -f 855.9875M -f 858.4875M -f 851.375M -l 150 -s 28.8k -p -2.0 -g 36 | ./ledacs-esk-ncurses7b -x -s slers.csv -g slers-talkgroups.csv

I use this example to scan between 4 different frequencies to lock onto the control channel for an EDACS system, it never lets me down. Let's see, if you want to scan through and playback a few conventional analog channels you can use this:

Code:
rtl_fm -d 0 -f 851.8M -f 855.9875M -f 858.4875M -f 851.375M -l 150 -s 48.8k -p -2.0 -g 36 | sox -t raw -b 16 -e signed-integer -r 48000 -c 1 - -t raw - vol 2 sinc 0.2k-4.5k -a 110 rate 48000 | aplay -t raw -f S16_LE -r 48000 -c 1

Uses rtl_fm and scans through those frequencies, has a gain of 36 and squelch of 150 (-l 150 (lower case l)), passes through sox for a little sound shaping, and plays back through aplay. Simple. You may need to tweak values like the gain and squelch to get it just right. Advanced tweaking with sox to get the audio nice and beefy. Admittedly the above sox example was more for getting audio to pass through dsd nicer than for pure listening.

Recommended reading

Advanced reading for Sox

Interesting to know. I dont fully understand your code, so if you dont mind it would awesome if you could break it down a little bit and how each section of it functions so that I can fully understand it.
 

lwvmobile

DSD-FME
Joined
Apr 26, 2020
Messages
1,349
Location
Lafayette County, FL
Code:
rtl_fm -d 0 -f 851.8M -f 855.9875M -f 858.4875M -f 851.375M -l 150 -s 48.8k -p -2.0 -g 36 | sox -t raw -b 16 -e signed-integer -r 48000 -c 1 - -t raw - vol 2 sinc 0.2k-4.5k -a 110 rate 48000 | aplay -t raw -f S16_LE -r 48000 -c 1

The general gist is that this is three different command, the first having its output piped into the second, the second having its output piped in the third. I'll break them down in varying degrees. First is rtl_fm, this is the program that tunes an rtl dongle to a frequency and demodulates it and outputs to stdout.

Code:
rtl_fm -d 0 -f 851.8M -f 855.9875M -f 858.4875M -f 851.375M -l 150 -s 48.8k -p -2.0 -g 36

rtl_fm - a simple FM demodulator for RTL2832 based DVB-T receivers

-f frequency_to_tune_to [Hz]
               (use multiple -f for scanning, requires squelch)
               (ranges supported, -f 118M:137M:25k)
I'm using -f to set the frequency, or specifying multiple frequencies to jump between

-l squelch_level (default: 0/off)

-s sample_rate (default: 24k)

-p ppm_error (default: 0)

-g tuner_gain (default: automatic)

Next, the signal from rtl_fm is piped over to Sox via the | pipe character, I'm not going to cover Sox becuase its complcated, and you could honestly just pipe straight to aplay.

Code:
aplay -t raw -f S16_LE -r 48000 -c 1

aplay - command-line sound recorder and player for ALSA

-t, --file-type TYPE
    File type (voc, wav, raw or au). If this parameter is omitted the WAVE format is used.
   
-f --format=FORMAT
    Sample format
    Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW A_LAW IMA_ADPCM MPEG GSM SPECIAL S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE
    Some of these may not be available on selected hardware
    The available format shortcuts are:

    -f cd (16 bit little endian, 44100, stereo) [-f S16_LE -c2 -r44100]
    -f cdr (16 bit big endian, 44100, stereo) [-f S16_BE -c2 -f44100]
    -f dat (16 bit little endian, 48000, stereo) [-f S16_LE -c2 -r48000]

    If no format is given U8 is used.
   
-r, --rate=#<Hz>
    Sampling rate in Hertz. The default rate is 8000 Hertz. If the value specified is less than 300, it is taken as the rate in kilohertz. Valid values are 2000 through 192000 Hertz.
   
-c, --channels=#
    The number of channels. The default is one channel. Valid values are 1 through 32.

With these two piped together like so, you should be able to tune between different frequencies, and play them out to the default audio device.

Code:
rtl_fm -d 0 -f 851.8M -f 855.9875M -f 858.4875M -f 851.375M -l 150 -s 48.8k -p -2.0 -g 36 | aplay -t raw -f S16_LE -r 48000 -c 1

Additional reading on aplay usage
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,611
Location
Massachusetts
After taking a look around at some SDR information and the release of the Raspberry Pi Feed Appliance software form Brodcastify, I was wondering if it would be possible to use a Raspberry Pi 4 as both an SDR Receiver and a feed appliance all in one? Would this be possible with the current landscape of software and hardware or would it require windows to function properly?

East
Rtlsdr_airband does just what you want and runs nicely on a raspberry pi.

 

telvana

Member
Joined
Nov 19, 2014
Messages
91
I second rtlsdr_airband - it just works. Configuration can be a little maddening, but once you get past that hurdle it's great. I am using it to run my NOAA weather radio feed. Admittedly it's a bit overkill for a single frequency, but it's working great.
 
Status
Not open for further replies.
Top