summaryrefslogtreecommitdiff
path: root/gr-blocks
Commit message (Collapse)AuthorAgeFilesLines
...
* blocks/socket_pdu: Remove manual memory managementThomas Habets2020-08-141-7/+7
|
* blocks/message_strobe: Use atomic for thread syncThomas Habets2020-08-143-4/+4
|
* blocks/message_strobe: Remove manual memory managementThomas Habets2020-08-144-10/+8
|
* blocks/tcp_server_sink: Remove manual memory managementThomas Habets2020-08-142-27/+17
|
* python: Remove unnecessary 'from __future__ import'Oleksandr Kravchuk2020-08-0316-21/+0
| | | | | | | | | | | | | | | | All of the removed `from __future__ import` were needed in older versions of Python (mostly 2.5.x and below) but later became mandatory in most versions of Python 3 hence are not necessary anymore. More specifically, according to __future__.py[1]: - unicode_literals is part of Python since versions 2.6.0 and 3.0.0; - print_function is part of Python since versions 2.6.0 and 3.0.0; - absolute_import is part of Python since versions 2.5.0 and 3.0.0; - division is part of Python since versions 2.2.0 and 3.0.0; Get rid of those unnecessary imports to slightly clean up the codebase. [1] https://github.com/python/cpython/blob/master/Lib/__future__.py
* Replace all calls to `get_initial_sptr` with `make_block_sptr`Thomas Habets2020-07-30152-211/+192
| | | | | | | | | | | | | | First batch of changes: ``` find […] -print0 | xargs -0 sed -i -r '/get_initial_sptr/{:nxt N;/;/!b nxt;s/get_initial_sptr\(\s*new ([^(]+)(.*)\)\)/make_block_sptr<\1>\2)/}' ``` Then: * Back out `sptr_magic.h` edits * Change some `friend` clauses * clang-format the whole thing * Update checksums in the pybind11 bindings files
* blocks: move the `new` from the block `::make()` to coreThomas Habets2020-07-301-1/+1
| | | | | This includes the first edit of a block, so that it's easy to review. A following commit changes this globally.
* Move from SWIG to Pybind11Marcus Müller2020-06-19415-1981/+14522
|\ | | | | | | | | | | Goodbye, and thanks for all the fish, SWIG. Please refer to docs/PYBIND11.md for details on how to deal with Pybind.
| * blocks: remap enums in yml from int to raw for pybind compatibilityJosh Morman2020-06-044-4/+4
| |
| * pybind: repack_bits change int to enum in ymlJosh Morman2020-06-041-1/+1
| |
| * msg_handler: Apply clang-formatJohannes Demel2020-06-044-5/+8
| | | | | | | | Make sure, code is properly formatted everywhere.`
| * msg_handler: Use lambdas to set msg handlersJohannes Demel2020-06-0415-57/+27
| | | | | | | | | | With this commit, all calls to `set_msg_handler` in `gr-blocks` use lambdas. This helps to use `std::function` instead of `boost::function`.
| * msg_handler: Switch from boost::function to std::functionJohannes Demel2020-06-0416-38/+60
| | | | | | | | | | | | | | This commit is a first stab at moving from `boost::function` to `std::function`. For now, it does only update gr-blocks. Also, this requires more testing. If others can confirm that this change works, I'll continue to update all modules.
| * pybind: add hash check to binding file creation (#3472)mormj2020-06-04165-163/+1543
| |
| * pybind: run clang-formatJosh Morman2020-06-041-7/+6
| |
| * blocks: add pybind11 bindingsJosh Morman2020-06-04370-534/+13104
| |
| * blocks: remove bin_statistics_f block due to swig dependenceJosh Morman2020-06-046-504/+0
| | | | | | | | | | | | | | | | The bin_statistics_f block relies on the SWIG director functionality and therefore will need to be rewritten in the transition to pybind11. Additionally it does not appear documented in any way and there are no example flowgraphs, so it is questionable whether anyone is using it at this point
| * blocks: reorder template params for OR blockJosh Morman2020-06-042-8/+8
| |
| * pybind: removal of swig componentsJosh Morman2020-06-0414-899/+0
| |
* | blocks: qa_moving_average used tuple eq. for lists in pybind11Marcus Müller2020-06-191-1/+1
| |
* | blocks/moving_average: use vector functionsThomas Habets2020-06-153-25/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves performance of moving average for me by about 4-5x. My test is [here](https://github.com/ThomasHabets/radiostuff/blob/master/amateur/listen_70cm.grc), which processes 10MHz to find the strongest signal. Without this PR I see `moving_average` in `top` taking about 89.4-94% CPU. With this patch it's ~20.4-23.7%. Since without this patch it's that high, I don't know that it's not even better. Test measured on a Libremv2 with Intel Core i7-6500U @ 2.5GHz. The memory access pattern is probably worse with this patch, but at least on my hardware on my workload this seems to be dwarfed by the gain of using volk. It can be hard to reason about memory access patterns, so benchmarks overrule theory. The test only actually uses float averaging. More benchmarking may be required. Possible improvements: * Add template specialization for `uint16` and `uint32`? * Refactor for non-volk fallback to use only one loop, with (presumably) better memory access pattern)
* | blocks: Fix XMLRPC Client block templatesClayton Smith2020-06-111-4/+4
|/ | | | | | | | The XMLRPC Client block is currently broken because it tries to import the Python 2 XMLRPC module, and because the "addr" and "callback" parameters are inserted as quoted strings. To fix these problems, I've switched to the Python 3 version of the XMLRPC module, and changed the data types of the problematic parameters to "raw".
* blocks: default value for file_meta_sink in ymlJosh Morman2020-05-211-1/+1
|
* gr-blocks/peak_detector: Remove UB on infinitiesThomas Habets2020-05-211-2/+25
| | | | | | | | | | | | | | | | | | | | This code fixes two issues: 1. The code used `::min()` in one place, and "minus infinity" in another, for the same purpose. 2. It used minus infinity on integer types, which is undefined behavior. (1) seems to have been accidentally left out of 9d9ea63c45b5f314eb344a69340ef49e8edafdfa. (2) Section 4.9: > The behavior is undefined if the truncated value cannot be > represented in the destination type. And trunc() on infinity is still infinity, which can't be represented in integer types.
* gr-blocks: Updated tuntap_pdu_impl.cc to fix strncpy warningAlekh Gupta2020-05-051-3/+2
|
* gr-blocks: Fixed strncpy warning in tuntap_pdu_implalekhgupta14412020-05-051-0/+1
|
* blocks: wav: add missing changesjapm482020-04-192-3/+12
| | | | Add append option to grc file.
* blocks: wavfile_sink: allow appending to filesjapm482020-04-144-16/+180
| | | | | | | | | | | | | Fixes issue #1569. Implement an option in wavfile_sink that allows appending sound samples at the end of an existing file. For this, a target WAV file must meet these requirements: - the file must exist (will not be created if it does not). - the last chunk in the file must be DATA. - file params must match the configured ones (i.e. sample_rate, nchan and bits_per_sample).
* blocks: refactor and reorganize WAV internalsjapm482020-04-146-149/+164
| | | | | | | | This includes the following: - WAV header parameters are now stored in a struct. - do not assume fixed position of data chunk (useful for appending). - use INT{8,18}T_MAX/MIN. - 0|NULL -> nullptr.
* blocks: fix wavfile testjapm482020-04-144-11/+41
| | | | | | | | | | | | | | | | | | | | The example test_16bit_1chunk.wav was invalid even if the tests passed. This file caused errors in ffprobe (from ffmpeg) and wave (from python standard lib). This is what changed: - LIST chunk corrected, according to spec. Previously `ffprobe` complained: [wav @ 0x5653f92d6dc0] too short LIST tag - File size corrected. Previously the test assumed that the resulting headers to be identical, this is now taken into account. Because of this, python's `wave` did not work. This is added to the test. Parser is updated to check file size. - Tests that did not close opened files were corrected. References: [1] https://sites.google.com/site/musicgapi/technical-documents/wav-file-format [2] http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf
* blocks: replace stderr logging by calls to GR's logging faciltiesMarcus Müller2020-04-1312-34/+64
|
* file_sink: Flush file on stop()rear10192020-04-132-0/+9
| | | | | | | | | | | Make sure that data passed to the file sink is written to the disk when the flowgraph is stopped. Before this change this only happened implicitly due to a fclose() in the base class destructor. This in turn means that data was written delayed after stopping the flowgraph [1]. This fixes #2590. [1] https://github.com/gnuradio/gnuradio/issues/2590
* Remove VOLK as a submoduleMartin Braun2020-04-112-4/+3
| | | | | | | | | | | | | | This removes the volk/ submodule pointer and updates the CMake to detect VOLK like any other dependency. The VOLK_MIN_VERSION CMake variable is added (and set to 2.1.0). The GR_VOLK_LIB variable is replaced with Volk::volk everywhere. The VOLK_INSTALL_LIBRARY_DIR and VOLK_INSTALL_INCLUDE_DIR variables weren't used and were removed. CMake will now fail if VOLK cannot be detected. Therefore, ENABLE_VOLK was also removed as a variable; all in-tree components may assume the existence of VOLK.
* interleaved_char/short_to_complex: remove unused private fieldsMarcus Müller2020-04-114-5/+1
|
* gr-blocks: Remove warnings.Ron Economos2020-04-081-3/+3
|
* replace boost endian check with cmakejapm482020-04-061-3/+2
|
* Switch from boost pointers to std C++11 pointersThomas Habets2020-04-01162-167/+167
| | | | | | | | | | | | | | | | | | | Most of this code is automated code changes: ``` set -e SUB="s/dummy/dummy/" for i in shared_ptr make_shared dynamic_pointer_cast weak_ptr enable_shared_from_this get_deleter; do SUB="$SUB;s/boost::$i/std::$i/g" done SUB="$SUB;s^#include <boost/shared_ptr.hpp>^#include <memory>^g" SUB="$SUB;s^namespace boost^namespace std^g" find . \( -name "*.cc" -o -name "*.h" -o -name "*.i" -o -name "*.cxx" -o -name "*.py" \) -print0 | xargs -0 sed -i "$SUB" ``` Only one manual change. In `./gr-fec/lib/fec_mtrx_impl.cc`, add `#include <algorithm>`.
* gr-blocks: Add Phase Shift Block with Msg Capabilitiesghostop142020-03-308-0/+232
| | | | | | | | | | | | This new block provides a native ability to phase shift signals for solutions such as DoA and array-based projects. The block supports both variable and message based updates such that other blocks can provide the appropriate calculations for shifting and only send message-based updates when necessary. Based on a block configuration parameter, shift can be specified either in radians or degrees. his block functions like a multiply const, but with the const limited to abs() == 1 to provide a constant phase shift.
* blocks: Re-convert GRC examplesNick Østergaard2020-03-291-5/+26
| | | | | | | This is made by opening the grc file in gnuradio-companion and saving a copy as on the same file. Fixes #3282
* gr-network: Add grnet networking blocks to GNU Radioghostop142020-03-294-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR is to create a new gr-network structure that includes the grnet TCP and UDP source/sink blocks for inclusion into GNU Radio. This includes new modes (TCP source/sink can act as either a TCP server/listener or a client), and UDP supports multiple new header options for dropped packet detection and integration with external sources such as the Allen Telescope Array. The UDP blocks have a number of important performance and tuning comments in the block documentation to help ensure success with the blocks, and examples for each scenario are included. This PR also deprecates the old TCP/UDP blocks but keeps them in place. The new blocks and new functionality resulted in not a 1:1 drop-in replacement for the old blocks so the old blocks were moved to the deprecated UI group to avoid breaking flowgraphs going to GR 3.9. Some of the new features included in these blocks are: 1. The only TCP block is a sink that listens for inbound connections. This inherently limits the ability to transmit data to another 3rd party application listening for data in TCP server mode. A source block is included here as well. 2. The TCP sink block supports both TCP client and server modes. 3. All blocks (TCP and UDP) support IPv6. 4. UDP blocks now include a variety of header options: None, a 64-bit sequence number that can be used to track dropped packets, CHDR, and the Allen Telescope Array header format for GR-native ATA integration. 5. UDP blocks paired with headers can now notify if any data is lost in transit. 6. UDP blocks now have the option to source 0's (no signal) to allow the flowgraph to run if no incoming data is available. 7. UDP blocks now include a buffering mechanism to ensure data is not lost between different timing domains (network packets and GNU Radio scheduler). 8. Block documentation has been added to help guide users through how to properly configure addresses for IPv6 or dual-stack operations, and tuning / testing before using UDP blocks in a production environment. 9. TCP sink has enhanced work logic to remain running and continue to listen for reconnections if a client disconnects.
* gr-blocks: Add Msg Port to Delay Blockghostop142020-03-293-3/+28
| | | | | | | These updates add the ability to set the block delay value with an asynchronous message. In this manner, blocks doing calculations such as those for DoA or antenna arrays can provide delay updates only when needed.
* blocks/rotator: Remove manual memory management from QAThomas Habets2020-03-271-6/+3
|
* blocks/udp_sink: Remove manual memory managementThomas Habets2020-03-272-3/+5
|
* blocks/udp_source: Switch to smart pointers for socketThomas Habets2020-03-272-3/+5
|
* blocks/udp_source: Remove manual memory management for buffersThomas Habets2020-03-272-16/+13
|
* blocks: clean up pattern_max using std algorithmThomas Habets2020-03-271-5/+4
|
* Replace BOOST_FOREACH with C++11 range forThomas Habets2020-03-273-5/+4
|
* blocks: Add const to member variables that don't changeThomas Habets2020-03-2659-100/+99
|
* ctrlport: fix examplesjapm482020-03-063-6/+3
|
* blocks: file_meta_sink header size error handling logic errorBehnam Sabaghi2020-02-211-1/+1
| | | | | | This fixes a logical bug introduced in 88a9e1f9332d54c1743d062adfaf48aa6d3040ff, where error conditions were AND'ed together instead of OR'ed.