merbanan / rtl_433

Program to decode radio transmissions from devices on the ISM bands (and other frequencies)
GNU General Public License v2.0
6.17k stars 1.33k forks source link

SDR async start failed: Missing threads support #3080

Closed dcousens closed 4 weeks ago

dcousens commented 4 weeks ago

Similar to https://github.com/merbanan/rtl_433/issues/2621, git checkout 22.11 is OK. 23.11 and master are producing the same error.

This process is not operating with network access, if that's relevant.

> ./src/rtl_433 -vvv -R 142
rtl_433 version 23.11-171-g0b426692 branch master at 202410261548 inputs file rtl_tcp RTL-SDR SoapySDR
...
[Protocols] Registered 1 out of 266 device decoding protocols
[Input] The internals of input handling changed, read about and report problems on PR #1978
[SDR] Found 1 device(s)
[SDR] trying device 0: Realtek, RTL2838UHIDIR, SN: 00000001
Found Rafael Micro R820T tuner
[SDR] Using device 0: Realtek, RTL2838UHIDIR, SN: 00000001, "Generic RTL2832U OEM"
Exact sample rate is: 250000.000414 Hz
[R82XX] PLL not locked!
[SDR] Sample rate set to 250000 S/s.
[Input] Bit detection level set to 0.0 (Auto).
[SDR] Tuner gain set to Auto.
[Input] Reading samples in async mode...
[SDR] rtlsdr_set_center_freq 433920000 = 0
[SDR] Tuned to 433.920MHz.
[Input] async start failed (-1).
(exits)

Compiled with

cmake .
make

(edit: actually, I had used -DENABLE_THREADS=OFF earlier)

I am on Linux

> uname
Linux router 6.11.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 10 Oct 2024 20:11:06 +0000 x86_64 GNU/Linux
gdt commented 4 weeks ago

Please test with current git master. 22.11 is ancient. Also, please include all the needed information; I can't tell anything about your environment. It is likely better if you open a discussion asking for help, vs a bug, if you aren't able to have this working on a different platform for comparison or aren't using to providing data for bug reports. I marked this as feedback pending retest with up-to-date code and details.

dcousens commented 4 weeks ago

@gdt I have updated my original post to clarify, in my testing, the 22.11 tag is working.

Tags 23.11, and master, are exiting.

I upped the verbosity of the output snippet omitting only decoding protocol registrations. Let me know if there is any other information I can help with.

gdt commented 4 weeks ago

your problem seems rare and thus the path is you debugging it. I would suggest

you still didn't explain what CPU type your system is, and what distribution it is running. Also the precise model of your rtl-sdr dongle. and if you have tried this on other computers.

zuckschwerdt commented 4 weeks ago

The big thing that changed between those version is threading. The "async start failed" is the point where a new thread (for SDR input) is spawned. I suspect that your system has problems with threading.

zuckschwerdt commented 4 weeks ago

Ah, wait, you don't have sdr_start: error in pthread_create, rc: -1, right? Then this is simply a case where you compiled without support for threads. Without threads rtl_433 can only only run in batch mode, convert files and such.

dcousens commented 4 weeks ago

@zuckschwerdt good call, I did a fresh reset, a previous debugging step of cmake -DENABLE_THREADS=OFF had muddled my environment.

A threading / blocking problem remains, but the output is different.

> ./src/rtl_433 -vvv -R 142
rtl_433 version 23.11-171-g0b426692 branch master at 202410261548 inputs file rtl_tcp RTL-SDR SoapySDR with TLS
...
[Protocols] Registered 1 out of 266 device decoding protocols
[Input] The internals of input handling changed, read about and report problems on PR #1978
[SDR] Found 1 device(s)
[SDR] trying device 0: Realtek, RTL2838UHIDIR, SN: 00000001
Found Rafael Micro R820T tuner
[SDR] Using device 0: Realtek, RTL2838UHIDIR, SN: 00000001, "Generic RTL2832U OEM"
Exact sample rate is: 250000.000414 Hz
[R82XX] PLL not locked!
[SDR] Sample rate set to 250000 S/s.
[Input] Bit detection level set to 0.0 (Auto).
[SDR] Tuner gain set to Auto.
[Input] Reading samples in async mode...
[SDR] rtlsdr_set_center_freq 433920000 = 0
[SDR] Tuned to 433.920MHz.
[acquire_thread] acquire_thread enter...
[Input] Input device start failed, exiting!
[sdr_stop] EXITING...
[sdr_stop] JOINING...
[rtlsdr_read_loop] rtlsdr_read_async done
[acquire_thread] acquire_thread async stop...
[acquire_thread] acquire_thread done...
[sdr_stop] EXITED.
[rtl_433] stopping...
[sdr_stop] EXITING...
[sdr_stop] Already exiting.
[sdr_stop] EXITING...
[sdr_stop] Already exiting.
(exits)
dcousens commented 4 weeks ago

@zuckschwerdt seeing as you closed the issue, did you want me to make a new issue with the other output?

zuckschwerdt commented 4 weeks ago

The commit of the error message on missing threads auto-closed, yes open a new issue but mention this one.