Skip to content

Instantly share code, notes, and snippets.

@trondeau
trondeau / test_stream_mux_tags.grc
Created April 26, 2016 15:48
Example/test GRC flowgraph for testing tag placement in stream_mux
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.10'?>
<flow_graph>
<timestamp>Tue Apr 26 10:22:07 2016</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
@trondeau
trondeau / gist:41f6b77c44c03bc814bf
Created March 9, 2016 16:28
Functions for building 64bit masks in gnuradio/math.h
#include <stdint.h>
/*!
* \param len length of the mask in bits up to 64.
* \returns A 64-bit mask aligned on the byte's MSB.
*/
static inline uint64_t
create_64bit_msb_mask(unsigned len)
{
return ((~0ULL) >> (64 - len)) << (64 - len);
@trondeau
trondeau / gist:04d6e4ac30b5656aaae1
Created February 16, 2016 19:25
FindThrift.cmake from gnuradio maint
diff --git a/cmake/Modules/FindThrift.cmake b/cmake/Modules/FindThrift.cmake
index 4702f90..e5a8df1 100644
--- a/cmake/Modules/FindThrift.cmake
+++ b/cmake/Modules/FindThrift.cmake
@@ -34,7 +34,11 @@ FIND_LIBRARY(THRIFT_LIBRARIES
)
# Get the thrift binary to build our files during cmake
-FIND_PROGRAM(THRIFT_BIN thrift)
+if (CMAKE_CROSSCOMPILING)
@trondeau
trondeau / gist:5dd9f1ce8a0b2e613d2c
Created February 16, 2016 16:17
Finding binaries not in xcompile path
diff --git a/cmake/Modules/FindThrift.cmake b/cmake/Modules/FindThrift.cmake
index 5963ce9..e5a8df1 100644
--- a/cmake/Modules/FindThrift.cmake
+++ b/cmake/Modules/FindThrift.cmake
@@ -35,7 +35,7 @@ FIND_LIBRARY(THRIFT_LIBRARIES
# Get the thrift binary to build our files during cmake
if (CMAKE_CROSSCOMPILING)
- set(THRIFT_BIN "/usr/bin/thrift")
+ FIND_PROGRAM(THRIFT_BIN thrift NO_CMAKE_FIND_ROOT_PATH)
@trondeau
trondeau / gist:609b00520e17c6435700
Created December 14, 2015 14:35
VOLK failures on Jenkins
1: RUN_VOLK_TESTS: volk_32f_sin_32f(131071,1)
1: a_sse4_1 completed in 0.734ms
1: u_sse4_1 completed in 0.737ms
1: generic completed in 1.477ms
1: offset 21089 in1: -0.000102909 in2: -0.00010276 tolerance was: 0.001
1: offset 23287 in1: 2.16087e-05 in2: 2.14591e-05 tolerance was: 0.001
1: offset 81567 in1: 0.000114115 in2: 0.000113965 tolerance was: 0.001
1: volk_32f_sin_32f: fail on arch a_sse4_1
1: offset 21089 in1: -0.000102909 in2: -0.00010276 tolerance was: 0.001
1: offset 23287 in1: 2.16087e-05 in2: 2.14591e-05 tolerance was: 0.001
linux; GNU C++ version 4.9.1; Boost_105600; UHD_003.010.git-89-gb17b440d
-- Loading FPGA image: /usr/share/uhd/images/usrp_e310_fpga.bit... done
-- Initializing core control...
-- Performing register loopback test... pass
-- Performing register loopback test... pass
-- Performing register loopback test... pass
-- Performing CODEC loopback test... pass
-- Performing CODEC loopback test... pass
-- Setting time source to internal
@trondeau
trondeau / gist:6ccf4a4c06a4e88d6060
Last active November 20, 2015 21:15
Notes on Compiling Thrift with OE SDR
Ran ./bootstrap before setting OE environment
- Looking for some Perl support (File/Find.pm) not in the nativesdk
-- it is in the target sysroot
**********************************************************************
**********************************************************************
Patched files to turn off test support in C:
@trondeau
trondeau / gist:33d72859d1b46ad7a45c
Created September 24, 2015 20:40
gdb bt of fecapi_async_ldpc_encoders
#0 0x00007ffff782dcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff78310d8 in __GI_abort () at abort.c:89
#2 0x00007ffff786a394 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff7978b28 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007ffff787666e in malloc_printerr (ptr=<optimized out>, str=0x7ffff7978c58 "double free or corruption (out)", action=1) at malloc.c:4996
#4 _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840
#5 0x00007ffff535f7b8 in QString::free(QString::Data*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6 0x00007fffd6911171 in QwtText::~QwtText() () from /opt/qwt-6.1.0/lib/libqwt.so.6
#7 0x00007fffd6901941 in QwtScaleDraw::labelRect(QFont const&, double) const () from /opt/qwt-6.1.0/lib/libqwt.so.6
#8 0x00007fffd6902622 in QwtScaleDraw::minLabelDist(QFont const&) const () from /opt/qwt-6.1.0/lib/libqwt.so.6
#9 0x00007fffd6902eeb in QwtScaleDraw::minLength
@trondeau
trondeau / gist:325cb856802ebf22dc46
Created September 23, 2015 18:25
tagged_stream_block patch
diff --git a/gnuradio-runtime/lib/tagged_stream_block.cc b/gnuradio-runtime/lib/tagged_stream_block.cc
index 252a235..6d743e1 100644
--- a/gnuradio-runtime/lib/tagged_stream_block.cc
+++ b/gnuradio-runtime/lib/tagged_stream_block.cc
@@ -141,14 +141,16 @@ namespace gr {
if(n_produced == WORK_DONE) {
return n_produced;
}
- for(int i = 0; i < (int) d_n_input_items_reqd.size(); i++) {
- consume(i, d_n_input_items_reqd[i]);
diff --git a/gnuradio-runtime/lib/buffer.cc b/gnuradio-runtime/lib/buffer.cc
index f00e9a0..a0172b7 100644
--- a/gnuradio-runtime/lib/buffer.cc
+++ b/gnuradio-runtime/lib/buffer.cc
@@ -248,11 +248,34 @@ namespace gr {
locks the mutex itself.
If this function is used elsewhere, remember to lock the
- buffer's mutex al la the scoped_lock line below.
+ buffer's mutex al la the scoped_lock: