pvachon / tsl-sdr

Software Defined Radio Demodulation and Decoding Tools
125 stars 14 forks source link

REQUEST : Example Usage? #31

Closed dlasher closed 6 months ago

dlasher commented 6 months ago

[[[ EDIT :: Found the not-immediately-obvious-correct-links - noted at bottom of page :: ]]]

it would be nice to show a couple of sample uses for each tool -- only way I got multiFM capturing correctly was to snag the CLI from a previous ticket reported here (https://github.com/pvachon/tsl-sdr/issues/27) .. now that i'm capturing, not having any luck getting decoder to deal with the output files.

Something like?

MultiFM

needs at least (2) input filters - one describing the frequencies/channels/etc, and the other describing the filter. Example filters are found in the etc folder of the source tree. The files you specify in the first JSON have to already exist, so using the linux "touch" tool, precreate them before you attempt to capture.

example:

touch /home/pi/ch0.out (repeat for ch0.out through ch7.out)

multifm etc/multifm.json etc/flex_25khz_lpf.json
2024-05-21 17:08:56 [tid=32530] %APP-W-NO-HUGE-PAGE-SIZE-SPECIFIED, Defaulting huge slab size to 2MB. (/usr/src/tsl/app/app.c:421 in app_allocator_init)
Found Rafael Micro R828D tuner
2024-05-21 17:08:56 [tid=32530] %MULTIFM-I-DEV-IDX-OPEN, Successfully opened device at index 0 (/usr/src/tsl-sdr/multifm/rtl_sdr_if.c:363 in rtl_sdr_worker_thread_new)
2024-05-21 17:08:56 [tid=32530] %MULTIFM-I-DEV-IDX-OPEN, Device: Generic RTL2832U OEM Tuner: Rafael Micro R828D (/usr/src/tsl-sdr/multifm/rtl_sdr_if.c:364 in rtl_sdr_worker_thread_new)
2024-05-21 17:08:56 [tid=32530] %MULTIFM-W-DEV-UNTESTED, This tuner type is not tested, so the performance could be poor (/usr/src/tsl-sdr/multifm/rtl_sdr_if.c:367 in rtl_sdr_worker_thread_new)
2024-05-21 17:08:56 [tid=32530] %MULTIFM-I-SAMPLE-RATE, Setting sample rate to 1000000 Hz (/usr/src/tsl-sdr/multifm/rtl_sdr_if.c:371 in rtl_sdr_worker_thread_new)
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CENTER-FREQ, Setting Center Frequency to 929500000 Hz (/usr/src/tsl-sdr/multifm/rtl_sdr_if.c:379 in rtl_sdr_worker_thread_new)
Receiver supports 29 gains: 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-RECV-GAIN, Setting receive gain to 42.1 dB (/usr/src/tsl-sdr/multifm/rtl_sdr_if.c:272 in __rtl_sdr_worker_set_gain)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-FREQ-CORR, Set frequency correction to 0 PPM (/usr/src/tsl-sdr/multifm/rtl_sdr_if.c:417 in rtl_sdr_worker_thread_new)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-SAMPLE-RATE, Sample rate is set to 1000000 Hz (/usr/src/tsl-sdr/multifm/receiver.c:148 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CENTER-FREQ, Center Frequency is 929500000 Hz (/usr/src/tsl-sdr/multifm/receiver.c:149 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CHANNEL, [1]: 929.83800 MHz Gain: 0.000000 dB -> [/home/pi/ch7.out] (/usr/src/tsl-sdr/multifm/receiver.c:240 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CHANNEL, [2]: 929.53800 MHz Gain: 0.000000 dB -> [/home/pi/ch6.out] (/usr/src/tsl-sdr/multifm/receiver.c:240 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CHANNEL, [3]: 929.38800 MHz Gain: 0.000000 dB -> [/home/pi/ch5.out] (/usr/src/tsl-sdr/multifm/receiver.c:240 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CHANNEL, [4]: 929.93800 MHz Gain: 0.000000 dB -> [/home/pi/ch4.out] (/usr/src/tsl-sdr/multifm/receiver.c:240 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CHANNEL, [5]: 929.36200 MHz Gain: 0.000000 dB -> [/home/pi/ch3.out] (/usr/src/tsl-sdr/multifm/receiver.c:240 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CHANNEL, [6]: 929.66250 MHz Gain: 0.000000 dB -> [/home/pi/ch2.out] (/usr/src/tsl-sdr/multifm/receiver.c:240 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CHANNEL, [7]: 929.63800 MHz Gain: 0.000000 dB -> [/home/pi/ch1.out] (/usr/src/tsl-sdr/multifm/receiver.c:240 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CHANNEL, [8]: 929.61200 MHz Gain: 0.000000 dB -> [/home/pi/ch0.out] (/usr/src/tsl-sdr/multifm/receiver.c:240 in receiver_init)
2024-05-21 17:08:57 [tid=32530] %MULTIFM-I-CAPTURING, Starting capture and demodulation process. (/usr/src/tsl-sdr/multifm/multifm.c:160 in main)
Allocating 15 zero-copy buffers`

Now, using the default "multifm.json" you've created multiple output files in /home/pi, named ch0.out through ch7.out. Those files can then be processed by tools including decoder (see below) or resampler (see below)

Decoder

No idea. Everything I try doesn't work so far.

root@pi154:/home/pi# decoder -f 929.61200 -F /root/multiFM/flex_25khz_lpf.json /home/pi/ch0.out
2024-05-21 00:51:34 [tid= 8891] %DECODER-I-WRITE-TO-STDOUT, Output decoded data is going to stdout. (/usr/src/tsl-sdr/decoder/decoder.c:498 in _set_options)
2024-05-21 00:51:34 [tid= 8891] %DECODER-I-CONFIG, Resampling: 1/1 from 0 to 0.000000 (/usr/src/tsl-sdr/decoder/decoder.c:515 in _set_options)
2024-05-21 00:51:34 [tid= 8891] %DECODER-I-CONFIG, Loading filter coefficients from '/root/multiFM/flex_25khz_lpf.json' (/usr/src/tsl-sdr/decoder/decoder.c:517 in _set_options)
The application has PANICked. Reason:
BUG: ((config_get_float_array(cfg, &filter_coeffs_f, &nr_filter_coeffs, "lpfCoeffs"))) == TRUE

Application [version=5b3bbf5d2c708ed2] terminating at /usr/src/tsl-sdr/decoder/decoder.c:527 [thread=8891]
Call backtrace:
decoder(panic+0x68)[0x5591c6e678]
decoder(main+0x10a4)[0x5591c64824]
/lib/aarch64-linux-gnu/libc.so.6(+0x27780)[0x7f90557780]
/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0x98)[0x7f90557858]
decoder(_start+0x30)[0x5591c651f0]
Aborted

Resampler

More data needed

pvachon commented 6 months ago

Hey! Did you happen to check the documentation on the GitHub Wiki for the project? It has a bunch of worked examples, documents some of the filter file formats and gives some theory of operation.

dlasher commented 6 months ago

🤦 🤦 🤦 🤦 🤦 🤦

When I look at the wiki page on my phone, it puts the menu on the BOTTOM of the page, which is where I finally saw the clickable links for "using decoder" and "using multiFM". Going back to the PC/desktop view - it's on the RIGHT side of the wiki page, and looks like this...

Screen Shot 2024-05-21 at 4 26 48 PM

^^^ you want those last two items.

However, if you approach it like I did, you never see this...

Main page -- click on WIKI - scroll down on wiki to "MultiFM" look for help. None found.. Scroll more up and down - don't see the RIGHT sidebar.. never find help. Click in circles never finding help. :(

When I finally ended up at the right pages: MultiFM : https://github.com/pvachon/tsl-sdr/wiki/Using-MultiFM Decoder : https://github.com/pvachon/tsl-sdr/wiki/Using-Decoder

I'm overjoyed at the quality of the documentation. Thank you.

Closing this ticket, but leaving my comments in case anyone else suffers from brain disfunction like I do.