Commit Graph

104 Commits

Author SHA1 Message Date
Harald Welte b94f26929f fix memory leak in tetra_gsmtap_sendmsg()
gsmtap_sendmsg() may return an error, and we need to free the msg.

Likewise, if we don't even call gsmtap_sendmsg, the msgb must be free'd.

Change-Id: I9b018165982996cafb2fd17e89646177462002c6
Depends: libosmocore I106b09f2a49bf24ce0e8d11fd4d4ee93e9cafdf5
Related: OS#5329
2021-11-25 15:58:29 +01:00
Martin Hauke d71027873e Fix typos
Change-Id: I1aae0a52fcf978900fa847a3f813beb2a5ad4a84
2019-07-17 22:50:49 +02:00
Jan Hrach 73e9e0e871 add traffic dumping patch, use getopt to parse arguments
Enable the user to specify a directory, where contents of traffic channel will
be saved. Together with this dump, a text file with SSIs of the engaged
stations is saved too.

Based on 0004-HACK-Quick-hack-to-save-the-speech-data-from-TCH.patch available at
https://build.opensuse.org/package/view_file/home:mnhauke:sdr/osmo-tetra/0004-HACK-Quick-hack-to-save-the-speech-data-from-TCH.patch

Change-Id: I94135753a76cadfa373167ffca18e89bee5bcff8
2018-09-28 23:27:20 +00:00
Jan Hrach 22bb16dfa4 phy/tetra_burst.c: use bitwise operations to speed up synchronization
Finding synchronization sequence eats several times more CPU time than the
actual decoding. This is especially pronounced on channels with lots of errors
(where synchronization is lost frequently) and channels that are most of the
time empty (such as uplink channels, support for which is coming in following
patches).

Profiling shows that all the time is spent in memcmp calls.

A complicated and efficient algorithm, e.g. Aho-Corasick, turned out to be
not necessary. Compilers can optimize even a simple bit filter into fast code.

This provides only a modest (~25 %) performance gain, more fixes are coming.

Fixes: OS#1897
Change-Id: I3b90cc70c2ec67253a0fd2f00c6957a80971c38b
2018-08-06 12:21:19 +00:00
Jan Hrach 013ef6e8a1 update scrambling only if we have good CRC
When a bad frame is received, the scrambling should not be updated,
because setting scrambling to wrong values will completely break further
decoding (until another SYNC frame is received).

Change-Id: I5e88b52fcbb98532d7ab6ca85e4f956589a595ab
2018-07-31 06:58:51 +00:00
Jenda 05fa2d54bb Makefile: -O3 and debug build
Build standard builds with -O3.
Add a "debug" target with -Og and asan.

Change-Id: Ie943babb808ffdb1d807bcd7ce4ace54723b49a9
2018-07-30 21:41:08 +02:00
Jenda 9514389ef5 add script for testing performance and number of correctly decoded frames
Change-Id: I6d8030969eed4519520745207591ce4731939201
2018-07-30 21:38:07 +02:00
Jan Hrach 2c19f9856a Make viterbi decoder deterministic in case of bit errors / too few symbols
Running tetra-rx on a capture with lots of bit errors is not
deterministic. Investigation with Valgrind shows various errors about
uninitialised values in libosmocore's viterbi decoder.

The cause appears to lie in @lower_mac/viterbi.c@. The only function
there allocates space for 864 symbols and then fills it with the symbols
received. However, sym_count is sometimes less than 864, leaving the
rest of the array uninitialized.

Initializing it with @int8_t vit_inp[864*4] = {0};@ fixes the problem.

Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f
Fixes: OS#3410
2018-07-21 10:29:20 +02:00
Neels Hofmeyr f51afec8fa jenkins: use common osmo-build-dep.sh and osmo-clean-workspace.sh
Since the gerrit build jobs no longer contain git clean workspace config (for
good reasons), it is important to use osmo-clean-workspace.sh. To make it work
best, this jenkins.sh should follow the same structure as most others do.

Change-Id: I3eca957c52b2c018e4c784b29330a0d06c4e3595
2017-10-30 05:01:41 +01:00
André Boddenberg cb4bd6d45f Introduce contrib/jenkins.sh to align with other projects
This change will make jenkins' inline scripts obsolete,
so build testing and gerrit verification jobs [1][2] simply invoke:

  $ ./contrib/jenkins.sh

[1] https://jenkins.osmocom.org/jenkins/view/OsmoTETRA/job/OsmoTETRA/
[2] https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/job/OsmoTETRA-gerrit/

Change-Id: I517e1be8b5680c3cc274fd5ad13ac7c920154e7f
2017-09-19 11:21:28 +00:00
Harald Welte 4f3adac31f README.md: Add general information about the project
Change-Id: I3e187676a2c1ceb305f97e95d906659609135068
2017-03-16 20:37:42 +01:00
Harald Welte fcbb5b7692 reformat README file as markdown
Change-Id: I7b2602fa1614cafcfb6e6c4fad0d15ba183b0d1d
2017-03-16 20:34:20 +01:00
Harald Welte 0ca867eda2 remove old gnuradio <= 3.6 demodulator code
keeps some of the device specific scripts in addition to the (supposedly
generic) osmosdr-tetra_demod_fft.py

Also, update the README file to corresponding changes.

Change-Id: Icae93bb9a6a7219e14931fb6e04a4c6fffa0779d
2016-12-18 17:10:10 +01:00
Harald Welte 409d2985cb demod: Import the new GR 3.7 code
This adds demodulator code compatible with gnuradio 3.7 series.

Change-Id: Ibaf7f9c552cc1625210a75f2e9ec142ab47ce8d6
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-12-18 17:06:32 +01:00
Antonio Eugenio Burriel 359ef6ba24 Fix ETSI reference codec's patch for building on 64 bit architectures.
merged/ported to osmocom master by Harald Welte

Change-Id: I6b16811d4a3030dfce0718f0b1d266ee1761bfef
2016-12-18 16:21:35 +01:00
sq5bpf 043cc0e506 Add patches for codec static linking and logging to stderr
Change-Id: I41b32e38c08152e608f20af44db4456ca59169eb
2016-12-18 16:11:22 +01:00
sq5bpf 44956fef8d Update the Codec Download instructions and include a shell script
Change-Id: Ia943a38e422e23e70f73d9672554633c014f6da7
2016-12-18 16:10:23 +01:00
sq5bpf 871782e445 Add simdemod2.py, a simple demodulator without GUI
Change-Id: Ibad17350db1b00f87955684e4cc17e0a5e8ea6de
2016-12-18 15:37:33 +01:00
Dieter Spaar 158270f489 normalize_fn(): Fix computation of frame numbers
A copy+paste mistake resulted in the calculation of wrong frame numbers
in normalize_fn().
2016-11-27 17:50:08 +01:00
Petr Baudis a562b0e9a2 Merged useful extra features
osmosdr-tetra_demod_fft.py: Commandline switch -F for frequency offset
osmosdr-tetra_demod_fft.py: More verbose fine-tuning messages

Conflicts:
	src/demod/python/osmosdr-tetra_demod_fft.py
2015-08-21 01:52:40 +02:00
Petr Baudis 7d6f7287d7 osmosdr-tetra_demod_fft.py: More verbose fine-tuning messages 2015-08-21 01:52:27 +02:00
Jiří Pinkava 89f01f3501 fix debug build 2015-08-21 01:49:46 +02:00
Jiří Pinkava c065f9214c speed up float_to_bits
Reduce overhead caused by inefficient call of read
for each float. Increases speed about 50x.
2015-08-21 01:49:38 +02:00
luckyhacky 6f78d76052 removed hard coded values - exchanged it with enum for better readability 2015-08-21 01:49:02 +02:00
luckyhacky 83140af8d0 extended sysinfo as described in section 21.4.4.1
now every transmitted field in sysinfo is analyzed
2015-08-21 01:48:46 +02:00
luckyhacky 732d06d531 align for better readability 2015-08-21 01:48:30 +02:00
luckyhacky 165bf705a2 fixed typo 2015-08-21 01:47:00 +02:00
luckyhacky 6dcdb89454 set hyperframe number in struct tdma_time 2015-08-21 01:46:50 +02:00
luckyhacky 59e06e22ee added basic hyperframe support for output 2015-08-21 01:46:40 +02:00
Frank A. Stevenson 6430bdeb5f fix some global ugliness
This removes a static global variable which will only work if you only
have once instance of the tetra receiver.
2012-12-01 14:48:52 +01:00
Dimitri Stolnikov 1594e170bc fix first decimation value for FCD devices
thanks to Stefan Mandl for bringing up this issue.
2012-11-11 14:11:53 +01:00
Sylvain Munaut 2ee4b4ad4d float_to_bits: Remove offset
This is a symptom of frequency offset and it's the demodulator job to
correct this ...

Thanks to Frank A. Stevenson for noticing this legacy hack

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-11-11 12:48:33 +01:00
Gregor Gregoric 095e7bd8aa Add missing if braces in decode_chan_alloc 2012-10-04 18:31:51 +02:00
Ronny Kunze 2d9bf16066 Use correct bit offset to decode the ADDR_TYPE_SSI_USAGE 2012-07-14 13:02:07 +02:00
Dimitri Stolnikov 7bb6e34ad0 move graphical sinks to tabbed control 2012-06-07 21:39:09 +02:00
Dimitri Stolnikov 246b3d37e1 rename rtlsdr-tetra_demod_fft.py to osmosdr-tetra_demod_fft.py 2012-06-07 15:24:52 +02:00
Dimitri Stolnikov 74d40768ed add --args command line argument to pass to gr-osmosdr source 2012-06-07 15:22:37 +02:00
Steve Markgraf e55c014d9c rtlsdr-tetra: remove unneeded import
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-06-07 15:06:20 +02:00
Dimitri Stolnikov 582acdf444 add frequency and gain controls to rtlsdr receiver 2012-06-07 14:29:26 +02:00
Dimitri Stolnikov 2037ebeac6 add rtlsdr based receiver with click & tune functionality
Call it with

 src$ ./demod/python/rtlsdr-tetra_demod_fft.py -s 1.8e6 -f 394.6e6 -g -1 -o /dev/stdout | ./float_to_bits /dev/stdin /dev/stdout | ./tetra-rx /dev/stdin

- Adjust the center frequency (-f) and gain (-g) according to your needs.
- Use left click in Full Spectrum window to roughly select a TETRA carrier.
- Use left click to fine tune the carrier by clicking on the left or right side of the spectrum.
2012-05-31 01:36:22 +02:00
Dimitri Stolnikov 617dacf7b9 demod: use current uhd arguments scheme in uhd-tetra_demod.py
also introduces --spec argument useful with usrp1
2011-12-27 12:14:03 +01:00
Dimitri Stolnikov 7226098a9c add tunctl to .gitignore 2011-12-27 12:09:53 +01:00
Sylvain Munaut d4948d3c29 gsmtap: Fix warnings
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-25 20:29:06 +01:00
Sylvain Munaut 1bc5434a99 lower_mac/viterbi: Use the high level API of conv.h from libosmocore
It's more stable ... here we just need a flexible length, which we
can 'fake' by creating a local copy of the 'code' definition on the
stack.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-25 20:13:51 +01:00
Dimitri Stolnikov 2a7ed4e7ae update cqpsk demodulator to work with gnuradio 3.5 2011-11-20 17:04:27 +01:00
Alexander Huemer a4bdfabbbb fix ordering of gcc food in Makefile 2011-10-30 20:27:18 +01:00
Sylvain Munaut 4384428843 demod: Add new option to usrp1 demod
- Antenna selection
 - FPGA master freq
 - Better default subdevice picking

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-25 16:37:54 +02:00
Harald Welte abc2eb2b97 tetra_mac_pdu: Prevent array overflow of addr_len_by_type[]
detected by Smatch
2011-07-16 18:06:22 +02:00
Harald Welte 6d7b343149 use the new osmocom/core/prim.h header file
(introduced by libosmocore 9b21e88367eea8cdf200cf06fae99dec06e712a7)
2011-06-23 14:16:25 +02:00
Harald Welte 07d1f1f7d2 float_to_bits: add '-v' argument for verbose printing of the bits 2011-06-04 22:11:56 +02:00