rtl-sdr keeps active and hot after killing rtl_tcp in Linux

Need help installing or figuring out something about your SDR? Ask here.
Post Reply
Remon
Posts: 47
Joined: Fri Jun 22, 2018 2:49 am

rtl-sdr keeps active and hot after killing rtl_tcp in Linux

Post by Remon » Fri Jun 22, 2018 3:11 am

Setup:

Raspberry Pi 3B+ with Raspbian (Debian) and a rtl-sdr v3 plugged in running rtl_tcp to listen remotely with SDR# on a Windows laptop.

If I boot the Raspberry without starting rtl_tcp, the rtl-sdr remains cool, even after a long time. After starting the process the rtl-sdr starts warning up (it even becomes hot during listening with SDR# with high RF gain) and it doesn't cool down after I killed the process (sudo kill -9 pid, I got the rtl_tcp pid I killed with ps -A and it successfully stops the audio/stream in SDR#).

Does rtl_tcp mount the rtl-sdr on startup? Can it be unmount? Is it a driver being loaded on rtl-tcp startup and is a reboot necessary to unload the driver? Is it maybe another process running in the background?

Does anyone of you know how to put the rtl-sdr back to sleep after rtl_tcp is killed in Linux?

rtlsdrblog
Site Admin
Posts: 2751
Joined: Mon Nov 19, 2012 11:54 pm

Re: rtl-sdr keeps active and hot after killing rtl_tcp in Linux

Post by rtlsdrblog » Fri Jun 22, 2018 5:09 am

Yes I believe rtl_tcp activates the RTL-SDR immediately when it's run.

I think if you kill the process like that the code might not be able to activate its 'sleep' register settings. But if you use Ctrl+C it might. Not sure if there is a better method to do it in code.

Remon
Posts: 47
Joined: Fri Jun 22, 2018 2:49 am

Re: rtl-sdr keeps active and hot after killing rtl_tcp in Linux

Post by Remon » Fri Jun 22, 2018 1:09 pm

Thank you for helping me pointing in the right direction.

I'm using my Raspberry Pi "headless": no keyboard, mouse and monitor. I connect to the terminal with SSH and made a start and stop script for rtl_tcp.

Instead of:

Code: Select all

kill -9 pid
I'm now testing:

Code: Select all

kill -3 pid
(which simulates CTRL+C)

I'll let you know if it either works or not.

Remon
Posts: 47
Joined: Fri Jun 22, 2018 2:49 am

Re: rtl-sdr keeps active and hot after killing rtl_tcp in Linux

Post by Remon » Fri Jun 22, 2018 3:01 pm

The results:

It doesn't work as expected:

kill -3 pid kills the process and giving a quit message generated by rtl_tcp but then it immediately restarts itself if SDR# is still connected or when the process is killed in another SSH session.

EDIT:

I did more research and it has maybe something to do with systemd that is restarting the rtl_tcp process because it's running in a group? Maybe it's coded in rtl_tcp?

Code: Select all

[email protected]:~ $ systemctl status 2011
● session-c6.scope - Session c6 of user pi
   Loaded: loaded (/run/systemd/transient/session-c6.scope; transient; vendor pr
Transient: yes
   Active: active (running) since Fri 2018-06-22 17:05:51 CEST; 24min ago
   CGroup: /user.slice/user-1000.slice/session-c6.scope
           ├─1974 sshd: pi [priv]
           ├─1986 sshd: [email protected]/4
           ├─1989 -bash
           ├─2011 /usr/local/bin/rtl_tcp -a 192.168.178.234 -f 423000000 -g 29.0
           ├─2040 systemctl status 2011
           └─2041 pager

Jun 22 17:05:51 raspberrypi systemd[1]: Started Session c6 of user pi.
Since I'm totally new to Linux I have no idea what to do now.

Remon
Posts: 47
Joined: Fri Jun 22, 2018 2:49 am

Re: rtl-sdr keeps active and hot after killing rtl_tcp in Linux

Post by Remon » Fri Jun 29, 2018 10:57 pm

I partially solved it by running rtl_tcp as a systemd service. I can now close it from another SSH session. But it kills the hard way if a client is still connected. I can solve this by starting and stopping it again with no clients connected after the forced kill.

Post Reply