rechmp
Posts: 15
Joined: Thu Apr 24, 2014 6:40 am

RPI RTL-SDR server: Segmentation fault.

Sun May 04, 2014 8:43 am

Hello everyone.
I'm trying to use my rpi as sdr server, all works perfect, but i'm stucked with one problem:
I'm using SDRSharp via RTL-SDR/TCP to listen, and when i connecting to rpi first time - all perfect, disconnecting also.
But on second connect (not 2 connects at once) my waterfall on sdr# hanged, like no data.
After disconnect there is two variants on rpi server console:
1. 100% cpu load and hanged process (can kill only with sigkill from other session) (code example 1)
2. Segmentation fault error and closed process, need to restart rtl_tcp.

Looks like that Chinese guy have same problem. But it wont work for me. Looks like article too old for new versions.
And this one too.

Code: Select all

[email protected]:~# rtl_tcp -a 10.0.0.101 -p 4444
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuned to 100000000 Hz.
listening...
Use the device argument 'rtl_tcp=10.0.0.101:4444' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).
[color=#FF0000]first connect[/color]
client accepted!
set sample rate 2048000
set freq correction 50
set freq 439757000
set agc mode 0
set gain mode 1
set tuner gain by index 29
set freq 440257000
[color=#FF0000]stop (disconnect) pressed[/color]
comm recv bye
Signal caught, exiting!
worker cond timeout
Signal caught, exiting!
all threads dead..
listening...
Use the device argument 'rtl_tcp=10.0.0.101:4444' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).
[color=#FF0000]second connect[/color]
client accepted!
set sample rate 2048000
worker cond timeout
Signal caught, exiting!
^X^CSignal caught, exiting!
^CSignal caught, exiting!
[color=#FF0000]process hanged.. only sigkill can kill that process now[/color]

Code: Select all

[email protected]:~# rtl_tcp -a 10.0.0.101 -p 4444
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuned to 100000000 Hz.
listening...
Use the device argument 'rtl_tcp=10.0.0.101:4444' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).
[color=#FF0000]first connect[/color]
client accepted!
set sample rate 2048000
set freq correction 0
set freq 440500000
set agc mode 0
set gain mode 1
set tuner gain by index 0
[color=#FF0000]first disconnect[/color]
comm recv bye
Signal caught, exiting!
worker cond timeout
Signal caught, exiting!
all threads dead..
listening...
Use the device argument 'rtl_tcp=10.0.0.101:4444' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).
[color=#FF0000]second connect[/color]
client accepted!
set sample rate 2048000
Segmentation fault
[email protected]:~#
Ill be happy if someone help me.

6677
Posts: 383
Joined: Wed Mar 14, 2012 9:23 pm

Re: RPI RTL-SDR server: Segmentation fault.

Sun May 04, 2014 8:51 pm

wrong forum section bud

rechmp
Posts: 15
Joined: Thu Apr 24, 2014 6:40 am

Re: RPI RTL-SDR server: Segmentation fault.

Wed May 14, 2014 11:30 am

6677 wrote:wrong forum section bud
Sorry, where i need to move it?

sebr
Posts: 18
Joined: Tue Jun 11, 2013 4:44 pm
Location: Germany

Re: RPI RTL-SDR server: Segmentation fault.

Wed Sep 03, 2014 10:56 pm

I suffer from exactly the same problem on my RPi. rtl_tcp was running fine for almost two years.
Recently I did a dist-upgrade and also decided to get the latest files via git to recompile rtl-sdr as I had random lockups that made me have to reconnect with SDR#. Compiling and installing went fine but also upon a second connection attempt rtl_tcp crashes while the first one is always successful. Sometimes it crashes with no error message but mostly with segmentation fault.
Any clue?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: RPI RTL-SDR server: Segmentation fault.

Wed Sep 03, 2014 11:39 pm

rtl_tcp has never ran partially great on the PI for as long as I can remember however rtl_fm on the other hand has always worked without fail.
In my case running rtl_tcp seems to only work with the first connection if I stop and start SDRSharp then it crashes.
Sometimes on rare occasions rtl_tcp appears to work first time but SDRSharp goes buzzing like crazy.
Now I'm not sure what the problem is (probably some bugs in the code) but since rlt_tcp works when it wants to I find it hard to blame the OS.

The other annoying problem is if you Ctrl + C sometimes the device stops responding when you try to run rtl_tcp again.
I've often though the dongle had crash or gone bad when in fact rtl_tcp focked another rtl_tcp process hogging onto the device still.
A simple kill -9 [pid] should make it possible to run rtl_tcp again. :)

Richard S.

sebr
Posts: 18
Joined: Tue Jun 11, 2013 4:44 pm
Location: Germany

Re: RPI RTL-SDR server: Segmentation fault.

Wed Sep 03, 2014 11:50 pm

Ya, that happens too sometimes that you have to login with another session and kill rtl_tcp.
Well for me, rtl_tcp was reliable (at least not experienced the crash) until i decided to compile it again from latest code.
I found some info pointing towards libusb causing this kind of problems?!

User avatar
0xFF
Posts: 202
Joined: Tue Nov 20, 2012 7:52 pm
Location: Poland

Re: RPI RTL-SDR server: Segmentation fault.

Thu Sep 04, 2014 10:01 am


sebr
Posts: 18
Joined: Tue Jun 11, 2013 4:44 pm
Location: Germany

Re: RPI RTL-SDR server: Segmentation fault.

Thu Sep 04, 2014 11:48 pm

Unfortunately this won't help. The patch is from 2012 and already merged in the latest release. Also there have been some major changes in rtl_tcp.c
Some more ideas?

sebr
Posts: 18
Joined: Tue Jun 11, 2013 4:44 pm
Location: Germany

Re: RPI RTL-SDR server: Segmentation fault.

Sun Sep 07, 2014 11:20 pm

As I mentioned before, trying older versions of rtl-sdr result in same problems. So i decided to re-install my RPi and set up the latest Raspbian image and compiled rtl_tcp and the process crashes again on reconnecting to the server.
Just for fun i compiled rtl_tcp (follwing the same instructions) on my Ubuntu desktop machine - zero problems there with rtl_tcp. I can reconnect many times without rtl_tco crashing.
So it must be related to Raspbian. How can i find out what causes the problem? (sorry I am not a programmer)

PA9X
Posts: 1
Joined: Tue Sep 09, 2014 8:50 pm

Re: RPI RTL-SDR server: Segmentation fault.

Tue Sep 09, 2014 8:52 pm

Got exact the same issue here. I am curious about the solution...

sebr
Posts: 18
Joined: Tue Jun 11, 2013 4:44 pm
Location: Germany

Re: RPI RTL-SDR server: Segmentation fault.

Wed Sep 10, 2014 11:59 pm

Today I have tried some older raspbian images but same result, rtl_tcp keepy crashin on a re-connect. :?:

Eisbaeeer
Posts: 3
Joined: Sun Sep 21, 2014 2:26 pm

Re: RPI RTL-SDR server: Segmentation fault.

Sun Sep 21, 2014 2:28 pm

Same with my rtl_tcp.
If I do a reconnect, I get a memory access error.
Eisbaeeer

sebr
Posts: 18
Joined: Tue Jun 11, 2013 4:44 pm
Location: Germany

Re: RPI RTL-SDR server: Segmentation fault.

Thu Sep 25, 2014 12:26 pm

Unfortunately nobody seems to take care of this issue. :-( I have also posted it on the osmocom mailing list http://lists.osmocom.org/pipermail/osmocom-sdr/ but not got any reply there either.
But as rtl_tcp does not show this behavior on my Ubuntu desktop machine it seems very likely that it is an error related to raspbian. But again, also older releases have the same problem.

Eisbaeeer
Posts: 3
Joined: Sun Sep 21, 2014 2:26 pm

Re: RPI RTL-SDR server: Segmentation fault.

Thu Sep 25, 2014 3:05 pm

I have found a working version of rtl_sdr on my raspberry. You can download the version on https://github.com/Eisbaeeer/rtl-sdr
This version is also controllable by remote with udp.

Eisbaeeer

sebr
Posts: 18
Joined: Tue Jun 11, 2013 4:44 pm
Location: Germany

Re: RPI RTL-SDR server: Segmentation fault.

Thu Sep 25, 2014 4:21 pm

Thanks for sharing. Unfortunately this version causes the problems you can see in this video : https://www.youtube.com/watch?v=8snz1wQSRpw (starting from 1:35).
This happens randomly but I never got the stream stable and continuous for more than a few minutes. It was originally my intention to build the latest rtl-sdr to get rid of this error as I read in the latest release it supposed to be fixed. Then i ran into the segmentation fault problem.

User avatar
tony1tf
Posts: 53
Joined: Tue Jul 03, 2012 12:33 pm

Re: RPI RTL-SDR server: Segmentation fault.

Fri Oct 03, 2014 8:45 am

I have recently installed the latest rtl_sdr on a couple of Model B Pi's from a new NOOBS card with no problems, for a radio astronomy application.
So far have used rtl_test, rtl_fm and rtl_power with no problems - thou not used rtl_tcp yet.
Using the following commands - includes libraries for FITS files which shouldnt be relevant to this:

Code: Select all

sudo apt-get install build-essential cmake libusb-1.0 python-pyfits

git clone git://git.osmocom.org/rtl-sdr.git

cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
make
sudo make install
sudo ldconfig
Reboot the pi so the UDEV rules work, then plug in your RTL dongle.
Running rtl_test should find the dongle and get data from it till <ctrl>c. I usually see a few samples lost with this command, but all works OK. I am using a DVB-T TV Stick with an E4000 tuner. Did some experiments recently with a couple of other makes, and sometimes they cause the USB hub to freeze and the Pi needs rebooting. Not sure whether this is a TV stick problem or a power supply problem - perhaps some sticks take more power?

Tony

chriszerocool
Posts: 1
Joined: Sun Oct 05, 2014 4:18 am

Re: RPI RTL-SDR server: Segmentation fault.

Sun Oct 05, 2014 4:21 am

Could it be the new firmware? I had it running for hours before installing the latest firmware and then I kinda walked away from the project for a while and now, when I pick it back up I'm having the same issue.

Eisbaeeer
Posts: 3
Joined: Sun Sep 21, 2014 2:26 pm

Re: RPI RTL-SDR server: Segmentation fault.

Mon Oct 06, 2014 5:20 am

@tony1tf
But you described not our issue with rtl_tcp. Had you tested rtl_tcp yet?
I don' t think it is a driver issue. If I Compiler the Newer Source, i get the TCP issue.
Eisbaeeer

sebr
Posts: 18
Joined: Tue Jun 11, 2013 4:44 pm
Location: Germany

Re: RPI RTL-SDR server: Segmentation fault.

Tue Oct 07, 2014 11:29 pm

This is strange as I also got the same error with older versions I found here: http://cgit.osmocom.org/rtl-sdr/
The latest source also works well on Ubuntu and even on my NAS :) (just for testing)
So it is very obvious that the problems are related so Raspbian. Unfortunately there is no way to debug of rtl_tcp to find out what causes the crash.
I also use a dongle with R820T tuner. The same dongle worked flawless when I first set up a rtl-sdr server early 2013. But with latest software no luck :-(

hagensieker
Posts: 41
Joined: Thu Mar 13, 2014 7:45 pm

Re: RPI RTL-SDR server: Segmentation fault.

Fri Oct 10, 2014 10:20 pm

I'm curious and watching this thread. Last night I installed sdr as a server and while it works great from SDR# I'm having the exact same issue where you cannot stop and restart the client. Only works once.

Not even close to end of the world for me as I generally just run my dongle off my LinuxMint computer with GQRX however it would be kind of cool to set this up at home as I have way too many unpurposed Raspberry Pi's laying around.

bigbuilder
Posts: 6
Joined: Wed Nov 26, 2014 3:20 am

Re: RPI RTL-SDR server: Segmentation fault.

Sun Dec 07, 2014 12:17 am

Well,

I get intermittent audio from SDR# on my Dell Laptop, when is client to the R PI rtl_tcp server. It seems like the processing is to little for pushing or pulling the data, and buffering is taking place. It "works" - that is, if you consider 0.1 sec every second of audio to work..

I was able to record as I,Q using SDR, and it played back perfectly. Until it stopped after 500 or so buffers on the transmit side.

mardikas
Posts: 1
Joined: Sat Jan 03, 2015 9:16 am

Re: RPI RTL-SDR server: Segmentation fault.

Sat Jan 03, 2015 9:56 am

Hello!

i dont have RPi but Banana Pi. But anyway i have similar problems with rtl_tcp. When i connect from Win7 pc with SDRSharp sometimes spectrum goes crazy and if i stop-start connection to BPi then rtl_tcp service shuts down with segmentation error.

However i did notice that if i use Fedora on BPi then rtl_tcp will not close itself but i can again get connection from Win7 pc.

I noticed that Fedora distro is using newer libusb-1.0-0-dev libraries (ver 19 vs. 11 in Bananian). So i tred to get newer libusb-1.0-0-dev version to Bananian. I found libusb-1.0-0-dev_1.0.19-1_armhf.deb package in testing stage in debian packages ftp. It also requires libusb-1.0-0 newer version, libudev1 and libc6 being installed. I probably took libusb-1.0-0_1.0.19-1_armhf.deb and libudev1_215-8_armhf.deb and libc6_2.19-13_armhf.deb. Then did $ dpkg -i <package file> them all. After that i recompiled rtl-sdr package. I have not seen rtl_tcp closing since then.

But i still have crazy spectrum syndrome sometimes. Combination of RTL AGC and tuner gain seem to solve this. In my case RTL AGC =ON and tuner gain index 21 seem work. Not really sure though.

GL, Mart

ptamike
Posts: 16
Joined: Fri Nov 29, 2013 10:29 am

Re: RPI RTL-SDR server: Segmentation fault.

Mon Jan 05, 2015 8:40 pm

Hi All - This appears to be an issue with the later Raspian builds and may well be connected with libusb. Here are some of the things I have tried to narrow down the problem.

Problem: When using SDR Sharp to connect to the Raspberry Pi RTL-SDR server you can only connect once. If you hit the SDR Sharp stop button and then press the start the connection will fail with a segmentation fault. The only way to recover is to reboot the Pi.

I have tried the Dec 2014 raspbian build on model B and B+ and both suffer the above problem.

I have a Dec 2013 Raspian image that was built with rtl-sdr included. This works correctly when loaded on a model B and I can start and stop SDR Sharp without issue.

I have also just tested a model B+ with Pidora and rtl-sdr and that is also working fine though the setup was a bit tricky.

Is libusb at different build levels in Raspian and Pidora?

NB: The signal will very occasionally break into a screech when receiving Wide FM. The reason is not clear as there are no error messages in rtl_tcp.

Hope that help a bit.

ptamike
Posts: 16
Joined: Fri Nov 29, 2013 10:29 am

Re: RPI RTL-SDR server: Segmentation fault.

Wed Jan 07, 2015 3:11 pm

I have now been through the loading of rtl-sdr onto to pidora and can confirm that the rtl_tcp server works fine. Here's a quick run through the installation steps:

Pidora setup wizard:
I've used pi as the username and raspberry as the password for the user and root for simplicity. When creating the user make sure you tick 'add to admin group' or you won't be able to sudo. If you're using an hdmi to dvi adapter make sure you tick that box on the system settings screen or you won't see any output.

Loading the software:
su -
yum -y install cmake
yum -y install libusb-devel
yum -y install git
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install

Now to update the library path:

sudo nano /etc/ld.so.conf.d/libs.conf
add the following line:
/usr/local/lib
save the file
sudo ldconfig

Reboot and you're in business! If you add an empty file called headless (with no suffix) to the root directory of the SD card, pidora will read out its ip address via the headphone jack after it boots. If you want to use a static ip address you can enter it in the headless file - just Google pidora headless for instructions.
To use the IQ streaming, access the pi via ssh and type:
rtl_tcp -a 192.168.n.n (where n.n is the last part of the pi's ip address)

That's it!

wornoutsjg
Posts: 2
Joined: Mon Feb 16, 2015 6:31 pm

Re: RPI RTL-SDR server: Segmentation fault.

Mon Feb 16, 2015 6:37 pm

ptamike
Thanks for your suggestions and I am giving it a try, however. whenever I get to the step "cmake ../ -DINSTALL_UDEV_RULES=ON" I get error message package 'libusb-1.0' not found.
I have tried re-installing from scratch and searched the web for an answer but to no avail.
I am admittedly a complete novice with Pidora so any help (in simple layman's terms !!) would be much appreciated.

Return to “Advanced users”