Commit Graph

1136 Commits

Author SHA1 Message Date
Piotr Krysik 21fc94db73 resampler: adding only one original_offset tag at given position
Change-Id: I502ca1075b4ecf37d922c72f60cca5c64fd0fdee
2019-07-18 10:33:52 +02:00
Piotr Krysik 59257a11a3 receiver: removed redundant parameter from synchronized_handler
Change-Id: I64862f60eecadd60580a117ab865ea597eaad30b
2019-07-18 10:33:49 +02:00
Piotr Krysik 9e861d7017 receiver: fixes of synchronization
Correcting and making sense of some magic constants
relating to synchronization. Some magic constants
of unknown origin still stay.

Change-Id: I5a45ce1c8bceded70d34302a5b136da5f92fd902
2019-07-18 10:33:44 +02:00
Piotr Krysik 467a7aa80f plotting: improve interface so it's possible to pass rvalues
Change-Id: I387e462a889f7e3572d8e53a241c63aafed70912
2019-07-18 10:33:41 +02:00
Piotr Krysik 0de0172afe utils/time_spec: support fractional tick_rate
If tick_rate is fractional rate_i variable is 0 and shouldn't be used in
division.

Change-Id: I660922683d837160e0546a0f339560d7d0965379
2019-07-18 10:33:37 +02:00
Piotr Krysik 43dfbdf1a9 utils/fn_time: added clock_error to fn_time_delta
Information about clock error is needed in order to transform frame number
to hardware time - which is not ideal (i.e. different than BTS time).

Change-Id: Icd77b88da0490d6c9565bf3df0342574b91aae6e
2019-07-18 10:33:32 +02:00
Piotr Krysik c5ed04572f receiver/time_sample_ref: SDR hardware time tracking
Gr-gsm's receiver needs a stream of samples with sampling frequency that
is integer multiply of gsm symbol rate. Many hardware receivers don't
support such rates, and even if they do there might be error in their
time source. Sample rate is adapted and corrected with use of a resampler.
Moreover corrections are applied in the runtime so resampler's resample
rate is changed dynamically. Those changes need to be tracked in order
to be able to track time of the hardware after resampling.

Hardware time tracking is needed to enable triggering of events in the
hardware (i.e. frequency changes, burst transmissions).

Changes were made in time_sample_ref and receiver in order to enable
SDR hardware time tracking.

Change-Id: Ide8149a5fc6c22700d3a4542115306a4dc682ff2
2019-07-18 10:33:28 +02:00
Piotr Krysik 891b2deb5f constants: added missing brackets to defined values
Change-Id: I730629a58376fb550799a566faca031fcf1cd00d
2019-07-18 10:33:23 +02:00
Piotr Krysik dc4cb98344 trx: renaming of old freq hopping block and creation of a new one
The old freq_hopper -controlling USRP frequency with use of tags -
was renamed to freq_hopper_tag. The new one - freq_hopper_msg -  that
uses uhd_source or uhd_sink control message input was created.

Change-Id: Ic867446314ef2ee6903cef85d48c280981132dae
2019-07-18 10:33:19 +02:00
Piotr Krysik cd69577a40 receiver: Added resamp_rate parameter
Change-Id: Iaffbe8fc28be9a70fbf8fa1689687fbd171f6b0e
2019-07-18 10:33:16 +02:00
Piotr Krysik f11e31dba1 Switching version to development (git) and bumping the
least significant number

Change-Id: I21d79168616d98cd2de3c6a5f597d683b34880ef
2019-07-18 10:33:09 +02:00
Vasil Velichkov f51a624ec0 Filter out SoapyAudio devices
When gr-osmosdr is compiled with SoapySDR support and SoapyAudio is
installed the audio device is picked as a first choice when detecting
devices but grgsm tools are not able to work with audio devices. So in
such cases the user has to always specify the correct SDR device in the
args parameter which is a bit inconvenient.

When args is not specified call osmosdr.device_find to get all devices
and filter out unspported ones like SoapyAudio devices. When args is
specifed just try to create osmosdr.source with whatever value has been
specified.

Add -l and --list-devices command line option that prints information
about all detected devices.

Example commands:
  grgsm_capture --list-devices
  grgsm_capture --list-devices --args=nofake
  grgsm_capture --args=uhd,type=b210 -a 111 capture.cfile
  grgsm_livemon --args=rtl
  grgsm_livemon --args=uhd,type=b210

Change-Id: Ib84081041ca6c2bc18b9da0c32bac9d3ecef65ca
2019-07-18 10:31:27 +02:00
Vasil Velichkov b615cefdee grgsm_capture: Fix device arguments
We need a space between numchan=1 and the rest of the device arguments
otherwise when --args is specified it fails with RuntimeError: bad lexical cast

$ grgsm_capture --args=soapy

Traceback (most recent call last):
  File "/usr/local/bin/grgsm_capture", line 179, in <module>
    device_args=options.device_args)
  File "/usr/local/bin/grgsm_capture", line 57, in __init__
    osmosdr.source(args="numchan=1" + device_args )
  File "/usr/local/lib64/python2.7/site-packages/osmosdr/osmosdr_swig.py", line 1170, in make
    return _osmosdr_swig.source_make(*args, **kwargs)
RuntimeError: bad lexical cast: source type value could not be interpreted as target

Change-Id: I2d1bcee835b695c91a5c44ec78a40b2d969f611c
2019-07-18 10:31:27 +02:00
Vasil Velichkov f8151a8398 Improve the TCH/H decoder logs
- Change "6,90 kbit/s" to "5.9 kbit/s"
  A typo reported in github ptrkrysik/gr-gsm#456
- Comment out the "Error! frame_nr:" message as it turns out to confuse
  users more then it actually helps debugging.
- When voice-boundary detection is enabled write the name of decoded
  control channel messages

Change-Id: I697ef944f30c4cabb62c888317dd3a7f8dcd5611
2019-07-18 10:31:27 +02:00
Piotr Krysik 252ed2feb2 Improve slightly interface of plotting so it's easier to use it
Change-Id: Ia70ab45a8beb81512a9f83e316ad2d2bc385ef19
2019-07-18 10:31:27 +02:00
Vasil Velichkov 807e06139b Fix the TCH/H decoder and demapper XML definitions
- The second argument of tch_h_decoder constructor is a string that
  accepts the value of MultiRate configuration element and not an enum
  like the tch_f_decoder decoder.
- Make the demapper's burst sink required.
- Make all parameters visible.
- Rename the TCH/H Channel parameter to Sub-channel number.
- Add the qa_tch_h_decoder test in the CMakeLists.txt
- Fix several typos

Change-Id: I92d4f49955c634df7d76f17cfb58d7106846c1bd
2019-07-18 10:31:27 +02:00
Piotr Krysik e11b1d3710 Major simplification and some argument changes in grgsm_capture
grmgs_capture tried to do too many things for a simple recorder.
It was simplified by removing the receiver and ability to
save data to bursts files.

All other stuff that is not necessary for recording signal to disk was
also removed:
-setters/getters,
-storing of parameters that never will be changed.

The 'fc' parameter name was changed to 'freq' to follow GNU Radio
guidelines.

The 'shiftoff' parameter was removed.

'bb_gain' and 'if_gain' parameters were added.

Variables specific to some of SDR's like:
-gains at different stages,
-bandwidth (not all devices can set it),
-antennas (some devices have just one, some not),
were moved to separate options group.

What is left to be exposed is:
-dc_offset_mode,
-iq_balance_mode,
-gain_mode.

Change-Id: I092a43eaddb09a99c6cc05fde13f0ae94d9e0251
2019-07-18 10:31:27 +02:00
Vasil Velichkov 8c30ba6687 grgsm_livemon: Use the osr variable in all blocks
In the GSM input adaptor and GSM Receiver blocks the osr was hardcoded
to 4 and cannot be changed using the command line parameter.

Change-Id: I4e85b898f05db636f18fdea6e5fee4fed6e0382a
2019-07-18 10:31:27 +02:00
Vasil Velichkov 4b034e7141 MacOS fixes
- Include grgsm/endian.h in tch_h_decoder_impl.cc
- Revert 0ed39fbf93 as linking with
  boost_thread is needed

Fixes GH-444

Change-Id: I00884962295082cff3eb64fa21e9f73437be0001
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 6feac435ed apps/grgsm_trx: introduce initial LMS driver support
Change-Id: Ie983b10d1814906b6e659213f865e58d0f5c08e4
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy ad0c62a41c apps/grgsm_trx: add RadioInterface driver selection argument
Change-Id: Ic11f878c176bad16b057f25725ab0cfecc01782f
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 25203809c1 trx/radio_if.py: print type of RadioInterface
Change-Id: I6c1ba8546caec122cd1ea0ed87656f691abec068
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 6ee957f904 python/trx: fork RadioInterfaceUHD from RadioInterface
Change-Id: I1644a3f6b8da0d5f2a1a133058269e5383948fda
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 8072d3acd8 trx/ctrl_if.py: use relative import for UDPLink
Change-Id: If4b00f6332461d3c37cde5a1f724906ca3d3a30f
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 0b70fcc19b trx/radio_if.py: update clock_offset_control in set_rx_freq()
Change-Id: I065bf664f775099c90c123c9ff75f262a73bf1be
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 5819e31450 trx/radio_if.py: do not print anything if freq. shift is 0
Change-Id: I100ce2ab8effc00e164e13253894445bdc816f06
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 2cbc3b5d97 python/trx: introduce and use Transceiver class
Change-Id: I6dc88edbb69a68746cc8e01206dc86f7ea2fa80f
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 04863d978f trx/ctrl_if_bb.py: reset transceiver on POWEROFF
Change-Id: I1e7f74c56388a431794a0b32b8a9537c360f5d33
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 6e7f2ce50c trx/radio_if.py: introduce a new @property 'ready'
Change-Id: I513da0f45c6a608d15fbd0e8eafe14d6af8833d7
2019-07-18 10:31:27 +02:00
Vadim Yanitskiy 7d8a1caa0f trx/radio_if.py: do not init both rx_freq and tx_freq
Change-Id: I9f251958ec90141d144fdb027aff20182131a1d1
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy d54e8fb500 python/trx: get rid of FakePM class
Change-Id: Ie96eb9735ecaa3329135c7be976ffd277a2f64f4
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy 3e6bfe799e apps/grgsm_trx: move init code from run() to __init__()
Change-Id: I1bcc9c8a2d37d156bbec93be3838200f6c4a80c2
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy 44d8c1e16b python/trx: use CamelCase naming for basic classes
Change-Id: Ica9c56d01191dda38e63b51caba2ec8c63b671c9
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy 0d0508aa86 trx/radio_if.py: use existing 'dict_toggle_sign' block
Change-Id: Ifa616644a858f493b9f8706663f9e7fed717f3d0
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy ac3fe63bad python/trx: rename 'change_sign_of_dict_elements' to 'dict_toggle_sign'
The old name was quite long, resulting into cumbersome imports:

  from change_sign_of_dict_elements import change_sign_of_dict_elements

let's use a shorter variant:

  from dict_toggle_sign import dict_toggle_sign

Change-Id: Ie75e1d6e5e74c7c1cf34154633c1472e4b85dbb6
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy 31c543f008 python/trx/__init__.py: cosmetic: add missing new line
Change-Id: I379b321866bd892a52b0c272ed50c670da380a17
2019-07-18 10:31:26 +02:00
Vasil Velichkov 4d300e9c61 Improve voice boundary detection
Decode Alerting and Progress messages and if the in-band information
flag is set start decoding the voice
2019-07-18 10:31:26 +02:00
Vasil Velichkov 2479152d5c Add TCH/H decoder tests 2019-07-18 10:31:26 +02:00
Vasil Velichkov 5968552b47 Add TCH/H decoder block with AMR multirate support
Add new TCHH channel mode
Add two new optional arguments

    -m CHAN_MODE, --mode=CHAN_MODE
                        Channel mode. Valid options are 'BCCH' (Non-combined
                        C0), 'BCCH_SDCCH4'(Combined C0), 'SDCCH8' (Stand-alone
                        control channel) 'TCHF' (Traffic Channel, Full rate),
                        'TCHH' (Traffic Channel, Half rate)

    --sub-channel=TCH_H_CHANNEL
                        TCH/H sub-channel. [default=0]
    --multi-rate=MULTI_RATE
                        The MultiRrate configuration element from the
                        Assigment Command message. Example: 28111a40. See 3GPP
                        TS 44.018 - 10.5.2.21aa MultiRate configuration

Example:
    grgsm_decode -m TCHH --sub-channel 0 --multi-rate 2811 -o voice.amr ...
2019-07-18 10:31:26 +02:00
Vasil Velichkov 9d3606b17e Add tests for the TCH/F and TCH/H Demappers 2019-07-18 10:31:26 +02:00
Vasil Velichkov 63e568dc3d Move HR demapping into a separate block 2019-07-18 10:31:26 +02:00
Andrew Artyushok 3e2f883ba0 Add HR demapping 2019-07-18 10:31:26 +02:00
Piotr Krysik 7fb1738cd8 transmitter/txtime_setter: fix error print syntax error 2019-07-18 10:31:26 +02:00
David Holm 9aadf3db64 lib/trx, lib/transmitter: Include grgsm/endian.h
MacOS X does not have endian.h and the build will fail unless
grgsm/endian.h is used.
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy fad602b2b0 trx/txtime_setter: print error if reference fn is missing
Change-Id: I2a6e3f41b6fe79b92d85ff98bc2cd9afd9bdc568
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy 06f76fb3a6 trx/txtime_setter: reduce code nesting in process_txtime_of_burst()
Change-Id: I5c334e16d6b28a5e32cd62a177ad56bfc8e748ee
2019-07-18 10:31:26 +02:00
Vadim Yanitskiy ef93382ed1 apps/grgsm_trx: (re)structurize help message
Change-Id: I612d8ae7d3ff99fee809e10d95919989bfbe0f59
2019-07-18 10:31:26 +02:00
Piotr Krysik db65883a68 apps/grgsm_trx: remove redundant unit from freq_offset variable name
Frequency is always in Hz so there is no need to add that
information in the variable name.

Change-Id: I509771c3fe072069a680f66b0763ae6825f6d529
2019-07-18 10:31:26 +02:00
Vasil Velichkov ad01342ec7 Add .gitreview similar to the other osmocom's projects
A gitreview file is required to use git review.
More information about git review
https://docs.openstack.org/infra/git-review/
https://www.mediawiki.org/wiki/Gerrit/git-review

Change-Id: Ie07446ba1a13e53c87bcc9b23e3b775803d158f4
2019-07-18 10:31:25 +02:00
Piotr Krysik 554aa905e4 receiver/time_sample_ref: improve accuracy of offset<->time conversions
Change-Id: Ie6e7ea4337c9e23a8e4445136a3adffc96b19942
2018-11-02 11:52:43 +01:00