RTL sdr stream to radio reference

Status
Not open for further replies.

VA7DMZ

Member
Joined
Feb 6, 2013
Messages
20
Location
Creston, BC
I am thinking something like this on my linux box.

rtl_fm | sox | ezstream

Code:
/usr/bin/rtl_fm -f 146.8M -N -s 192000 -r 48000 -d 0 | sox -r 12k -t raw -e signed -b 16 -c 1 -V1 - -r 48000 -t mp3 - | /usr/bin/ezstream -c /var/radio/configs/repeater-146.800.xml

But it fails like this...

Code:
root@radio:/var/radio/scripts# /usr/bin/rtl_fm -f 146.8M -N -s 192000 -r 48000 -d 0 | sox -r 12k -t raw -e signed -b 16 -c 1 -V1 - -r 48000 -t mp3 - | /usr/bin/ezstream -c /var/radio/configs/repeater-146.800.xml
 Found 2 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
  1:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Detached kernel driver
Found Rafael Micro R820T tuner
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 7.11ms
Tuned to 147088000 Hz.
Sampling at 1152000 Hz.
Output at 48000 Hz.
Tuner gain set to automatic.
Signal caught, exiting!

User cancel, exiting...
Reattached kernel driver

my pipe fu is weak. where is my error :(
 

VA7DMZ

Member
Joined
Feb 6, 2013
Messages
20
Location
Creston, BC

rosecitytransit

Member
Feed Provider
Joined
Oct 31, 2010
Messages
242
Location
Portland, Oregon
Does just the rtl_fm command work? I know Windows hates having identical devices with the same serial number, but Linux may be smarter about that.

The "Signal caught, exiting! / User cancel, exiting..." seems like the program thinks you're stopping it.
 

VA7DMZ

Member
Joined
Feb 6, 2013
Messages
20
Location
Creston, BC
Does just the rtl_fm command work? I know Windows hates having identical devices with the same serial number, but Linux may be smarter about that.

The "Signal caught, exiting! / User cancel, exiting..." seems like the program thinks you're stopping it.

I compiled the rtlsdr software from latest source and tried again.
I tried using a simple rtl_fm | play command and it does the same thing you noticed.

Code:
# rtl_fm -f 162.5M - | play -t raw -r 24k -e signed-integer -b 16 -c 1 -V1 -
Found 2 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
  1:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 162752000 Hz.
Oversampling input by: 42x.
Oversampling output by: 1x.
Buffer size: 8.13ms
Exact sample rate is: 1008000.009613 Hz
Sampling at 1008000 S/s.
Output at 24000 Hz.
Signal caught, exiting!

User cancel, exiting...
Segmentation fault

The program seems to think I am exiting it. I am not doing anything that sends it a exit signal...

Segmentation fault
I dont think this should be here either.
 

rosecitytransit

Member
Feed Provider
Joined
Oct 31, 2010
Messages
242
Location
Portland, Oregon
Try unplugging one of the dongles. The -d command may tell rtl-fm which device to use, but it won't help Linux tell them apart. If that helps and you really need to use both, use rtl_eeprom to change the serial number on one of them.
 

VA7DMZ

Member
Joined
Feb 6, 2013
Messages
20
Location
Creston, BC
I finally got it working. It turns out the lame and ezstream binary were corrupted.
I reinstalled with "apt-get remove lame ezstream && apt-get install lame ezstream"

Code:
root@kali:/var/radio/configs# rtl_fm -M wbfm -f 139M -d 1 -r 22000 | lame -r -s 22.0 -m m - - | ezstream -c /var/radio/configs/RADIO-139.000.xml
Found 2 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
  1:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 1: Generic RTL2832U OEM
ezstream: Connected to [url]http://audio3.radioreference.com:80/xxxxxxxxx[/url]
ezstream: Streaming from standard input
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 139010000 Hz.
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 8.03ms
Exact sample rate is: 1020000.026345 Hz
Sampling at 1020000 S/s.
Output at 170000 Hz.
Now it streams the data to radio reference. :D

The next task would be to try removing the static. some kind of software squelch.
 
Last edited:
S

screamin72

Guest
you have to do lsmod command in terminal then see if rtl is listed. Then blacklist.conf the lsmod rtl results sudo your editor too save to etc/modprobe.d folder reboot your distro.

eg....blacklist rtl_2832

save as rtl_blacklist.conf into etc/modprobe.d

if you do not want to reboot simply unplug the usb dongle then plug it back in. then run

rtl_test

it will look like it is frozen when in fact it is working (happens with R820T tuner). press ctrl + C at the same time to exit it.

Hope this helps
 
Last edited:

slicerwizard

Member
Joined
Sep 19, 2002
Messages
7,714
Location
Toronto, Ontario
Did you ever get squelch working? I can't seem to make it work for me
The squelch logic in rtl_fm is terrible. Same deal with the bandpass filtering. Better not have any nearby signals. Well, if the squelch doesn't work, I guess the filtering issue is moot anyway.
 
Status
Not open for further replies.
Top