Giter Site home page Giter Site logo

pothosware / gnuradio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gnuradio/gnuradio

3.0 3.0 1.0 56.4 MB

GNU Radio

Home Page: gnuradio.org

License: GNU General Public License v3.0

CMake 5.36% Shell 0.04% C 6.01% C++ 56.07% Python 31.84% Scheme 0.02% Perl 6 0.04% MATLAB 0.18% Groff 0.05% Fortran 0.28% Scilab 0.01% M 0.10% Objective-C 0.01% Mathematica 0.01%

gnuradio's People

Contributors

abhowmick22 avatar anastas avatar argilo avatar balister avatar bastibl avatar benreynwar avatar bistromath avatar courtarro avatar don2387ward avatar douggeiger avatar drmpeg avatar eblossom avatar guruofquality avatar jmcorgan avatar johnorlando avatar m0mik avatar maitbot avatar marcusmueller avatar mbr0wn avatar michaelld avatar n-west avatar namccart avatar ncorgan avatar osh avatar pinkavaj avatar saikwolf avatar sdh11 avatar smunaut avatar trondeau avatar yarda avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

shengpub

gnuradio's Issues

pfb_clock_sync - set_taps() not usable

The current set_taps() method takes the new taps and references to various other filter related objects. Its currently used by the constructor with those filter objects passed in from private members. I don't see how this call could be used to change the taps, or how it works in GRC as a callback/setter. I think pfb_clock_sync needs a new set_taps() function that takes only the taps, and reloads all filter settings just as the constructor does.

Fix GRC execute command path slashes

The shlex.split(run_command.format(python=sys.executable, ... removes the backslashes entirely from the string and the subsequent subprocess popen fails. For reference: http://bugs.python.org/issue1724822 The fix was to simply replace the backslashes, .replace("\\","/") because forward slashes in paths work just fine.

In addition, quotes have been added to the python executable and generated flowgraph path to support the possibility of spaces in the path. '"%s"'%(self.get_file_path()

pfb_clock_sync_ccf loop goes out of bounds

Under some conditions the error can cause the buffer indexes to go out of bounds. I was able to duplicate this with simulation data using the AGC3 block. While the AGC2 block had a stable envelope, the AGC3 seemed to jump around causing this issue.

During a jump, d_error becomes large

    gr_complex diff = d_diff_filters[d_filtnum]->filter(&in[count]);
    error_r = out[i].real() * diff.real();
    error_i = out[i].imag() * diff.imag();
    d_error = (error_i + error_r) / 2.0;       // average error from I&Q channel

Then d_k becomes large

        for(int s = 0; s < d_sps; s++) {
          d_rate_f = d_rate_f + d_beta*d_error;
          d_k = d_k + d_rate_f + d_alpha*d_error;
        }

It looks like there is an attempt to keep things in bounds, but for d_rate_f, not d_k

d_rate_f = gr::branchless_clip(d_rate_f, d_max_dev);

When the loop begins again, d_filtnum becomes large:

d_filtnum = (int)floor(d_k);

The loops to keep d_filtnum in bounds now cause the count to go out of range

        while(d_filtnum >= d_nfilters) {
        d_k -= d_nfilters;
        d_filtnum -= d_nfilters;
        count += 1;
      }
      while(d_filtnum < 0) {
        d_k += d_nfilters;
        d_filtnum += d_nfilters;
        count -= 1;
      }

Since count is used as a buffer index, things may now segfault.

volk fix cpuid count (latest avx detection) for msvc

Just like for the cpuid_x86() definition, we created a cpuidex_x86() macro that wraps both the GCC macro and the MSVC intrinsic. This was needed to compile volk master at the time of the patch.

I believe from reading the docs that these are equivalent calls for AVX* detection
The changes for __cpuid_count match the style of the existing __get_cpuid usage.

udp source throws for set_option(linger)

The boost::asio::socket_base::linger option fails under windows. This is probably an issue with boost since there is a similar windows supported dont-linger option. In any case, this patch adds a simple try/catch and logs the warning so the block can be used regardless. Patch below:

diff --git a/gr-blocks/lib/udp_source_impl.cc b/gr-blocks/lib/udp_source_impl.cc
index b1977a8..6d3bd7c 100644
--- a/gr-blocks/lib/udp_source_impl.cc
+++ b/gr-blocks/lib/udp_source_impl.cc
@@ -94,7 +94,14 @@ namespace gr {
         d_socket->open(d_endpoint.protocol());

         boost::asio::socket_base::linger loption(true, 0);
-        d_socket->set_option(loption);
+        try
+        {
+            d_socket->set_option(loption);
+        }
+        catch (const std::exception &ex)
+        {
+            GR_LOG_WARN(d_logger, "Failed to set boost::asio::socket_base::linger " + std::string(ex.what()));
+        }

         boost::asio::socket_base::reuse_address roption(true);
         d_socket->set_option(roption);

codec2.h defines for working install

We would like to be able to build against the gr-vocoder C++ header files. Currently the public header codec2.h includes a private header that is not installed. This patch removes the include for the private header and adds the missing relevant definitions.

add log2 to the msvc config.h

The gnuradio config.h is included by volk. Since we build for MSVC2012, which does not provide log2, this patch adds a simple log2 definition which is needed to compile volk (volk_32f_log2_32f.h)

fix config.h for missing math and other definitions

Patch 1

  • Provide math definitions for functions missing in vc11 that are used by various blocks.
  • Also, the INFINITY is mistakenly redefined and this causes some problems with system headers under vc14. Also added a simple ifdef to fix that
  • Also include the iso646.h header to provide and/or/not definitions. This fixes random.cc, but I added it here because this issue comes up a lot, and its best if config just includes the header
  • https://github.com/pothosware/PothosSDR/blob/master/patches/gnuradio_config_msvc_math.diff

Patch 2

And a related patch, use the config.h idiom in ldpc_decoder.cc, which provides round() when otherwise missing under vc11:

FIR filter pointer math is broken on LLP64

The (unsigned long) casts caused pointer truncation and crashes, since long is 32-bits and not the size of a pointer on LLP64 systems. This fix replaces the (unsigned long) casts with (size_t) since size_t is guaranteed to be the size of a pointer.

fix copypasta in grc xml for dtv dvb bbheader

Looks like a copy-pasta error in the keys from the framesize enum.

Here is the patch:

diff --git a/gr-dtv/grc/dtv_dvb_bbheader_bb.xml b/gr-dtv/grc/dtv_dvb_bbheader_bb.xml
index 49b8595..6ae7134 100644
--- a/gr-dtv/grc/dtv_dvb_bbheader_bb.xml
+++ b/gr-dtv/grc/dtv_dvb_bbheader_bb.xml
@@ -453,12 +453,12 @@ $rolloff.val, $mode.val, $inband.val, $fecblocks, $tsrate)</make>
     <hide>$standard.hide_dvbt2</hide>
     <option>
       <name>Normal</name>
-      <key>FECFRAME_NORMAL</key>
+      <key>INPUTMODE_NORMAL</key>
       <opt>val:dtv.INPUTMODE_NORMAL</opt>
     </option>
     <option>
       <name>High Efficiency</name>
-      <key>FECFRAME_SHORT</key>
+      <key>INPUTMODE_HIEFF</key>
       <opt>val:dtv.INPUTMODE_HIEFF</opt>
     </option>
   </param>

Fails to link libpthread on gentoo

Linking CXX shared library libgnuradio-runtime-3.7.7.1.so
CMakeFiles/gnuradio-runtime.dir/thread/thread.cc.o: In function `gr::thread::thread_bind_to_processor(unsigned long, std::vector<int, std::allocator<int> > const&)':
thread.cc:(.text+0xa0): undefined reference to `pthread_setaffinity_np'
CMakeFiles/gnuradio-runtime.dir/thread/thread.cc.o: In function `gr::thread::thread_unbind(unsigned long)':
thread.cc:(.text+0x4ce): undefined reference to `pthread_setaffinity_np'
CMakeFiles/gnuradio-runtime.dir/thread/thread_body_wrapper.cc.o: In function `gr::thread::mask_signals()':
thread_body_wrapper.cc:(.text+0x101): undefined reference to `pthread_sigmask'
collect2: error: ld returned 1 exit status
gnuradio-runtime/lib/CMakeFiles/gnuradio-runtime.dir/build.make:1776: recipe for target 'gnuradio-runtime/lib/libgnuradio-runtime-3.7.7.1.so.0.0.0' failed
make[2]: *** [gnuradio-runtime/lib/libgnuradio-runtime-3.7.7.1.so.0.0.0] Error 1
CMakeFiles/Makefile2:682: recipe for target 'gnuradio-runtime/lib/CMakeFiles/gnuradio-runtime.dir/all' failed
make[1]: *** [gnuradio-runtime/lib/CMakeFiles/gnuradio-runtime.dir/all] Error 2
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2

Stock libgnuradio v3.7.7.1 does not have this issue for me.

pfb_clock_sync segfaults when taps size < 2

The check on the taps size is only for empty taps, but taps of size one causes a segfault. Not that a length one array of taps is useful, but a helpful error message would be preferable. And in general for filters, a user may choose to pass in dummy taps (which might be size 1) with the intent of changing them later with a function call.

PMT Lite - pmt improvements, API flexibility, and converter efficiency

Currently, we have the PMT helper to bridge the gap beween native STL types in a Pothos::Object container and the PMT interface: https://github.com/pothosware/gnuradio/blob/pothos_support/gnuradio-runtime/lib/pmt_helper.cc

Reimplement PMT as a container holding plain STL
To drastically simplify this we can simply typedef pmt_t as container type like boost::any or Pothos::Object and reimplement the pmt_* family of functions to use plain STL data types held in the container. This implementation could be offered as an upstream substitution for PMT which would allow users to deal with native STL types withouth any API or structual changes.

Its impotant to note that a lot of the more obscure lispier pmt_* calls rely on the implementation overloads for specific PMT types -- something we would loose or have a more difficult time re-implementing. Fortunately, all of GNU Radio only uses a subset of the PMT API. One that would be easy to implement on top of STL.

Interned strings consideration
For a creation time vs comparison time tradeoff, GNU Radio heavily relies on using interned strings in a pmt container. The container pointer is unique per string value and used everywhere from std::map keys to tag key equality checks: https://en.wikipedia.org/wiki/String_interning

This just means that functions like string_to_symbol will continue to interact with a hash table of object containers, one entry per unique string. And that users dealing with the native std::string type will need to call into some sort of interning API call in the cases that a downstream consumer will be expecting to use a container with a "interned" string as a key or comparison.

This should work fine for Pothos::Object, but for a boost::any implementation, we will need to confirm that boost::any has a reference counted container that can be compared via an accessable address. If not, then creating a special InternedString class could be an acceptable alternative.

The packet type consideration
The pmt_helper API cannot be completely removed because we still have need of converting between PDU (pair of std::map<pmt, pmt>, std::vector) and Pothos::Packet (a structured type). Although, I should note that the conversion will be simpler. The rest of the types would require zero effort (no checks nor conversions). Therefore, the pmt_helper implementation wil become considerably smaller.

compatibility headers for msvc2013

MSVC2013 and up provides many standard C99 calls and headers. To cleanup warnings and to avoid including a directory with duplicate headers, and to favour including system headers in their place; I created a separate msvc2013 compatibility directory containing a config.h and other missing headers.

volk apps compile failure on msvc 2012

This patch effectively ifdefs out the volk executable apps on msvc 2012 because they don't compile. The bug is that one of the C structs claims to not have an assignment operator operator= for the deque structure. This is not an issue on msvc 2013, and probably related to STL. I think its probably properly fixable with a little creativity. Its not a fix, but being able to compile and use volk is still a big benefit.

constants.cc.in directories problems

Problem 1

Paths in constants.cc.in are escaped for windows initially, and then constants.cc.in is overwritten a second time in the top level CMakeLists.txt and the paths are not escaped. This leads to very broken behaviour for the gnuradio prefs API. If the prefs API cant find a working directory, it also excludes the user's appdata/home directory as well.

Problem 2

The paths are hard-coded into the constants.cc.in. This is bad for installers that may install the bundle into an arbitrary location (that differs from the build location). And certainly this is not isolated to windows.

Current fix

We have modified the constants.cc.in in the gr-runtime project (https://github.com/pothosware/gr-runtime) to use an environment variable to determine the install root (which defaults to compiled in prefix when not specified). And the sysconfdir and prefsdir both use this configurable prefix, which mimics the logic in CMakeLists, but at runtime instead.

The following snippet is from the gr-runtime project and uses the pothos root path API call. A proper upstream fix would look like this, but use getenv for a GNURADIO_ROOT environment variable. This fix is easiest for us because we already have a modified gnuradio runtime and a convenient way to get a prefix path thats already supported by the installer.

  const std::string
  prefix()
  {
    return Pothos::System::getRootPath();
  }

  const std::string
  sysconfdir()
  {
    if (prefix() == "/usr") return "/@GR_CONF_DIR@";
    Poco::Path sysConfPath(prefix());
    sysConfPath.append("@GR_CONF_DIR@");
    return sysConfPath.toString();
  }

  const std::string
  prefsdir()
  {
    Poco::Path sysPrefsPath(sysconfdir());
    sysPrefsPath.append("gnuradio");
    sysPrefsPath.append("conf.d");
    return sysPrefsPath.toString();
  }

update to latest gnuradio + windows fixes

We are going to replay the pothos support on top of the latest gnuradio maint branch. We will be building this branch for the Pothos SDR windows installer and we should have some patches to upstream.

register remaining pmt converters

We have registered conversions for several type-to-pmt calls in this commit: ceab657

This enables arbitrary types to be entered as a parameter when the input type of the call is pmt. Pothos figures out how to convert the object to pmt using the available registered conversions. Complete this work by handling remaining to-pmt conversions for container types. And provide the reverse from-pmt conversions in case those become useful later.

Python inspection fail

After downloading the latest Pothos-bundle for x64 (I'm on Win-10), I get the below failure when launching gnuradio-companion.exe. Seems it is ass-u-me'd Python should be installed from a .MSI file. The first time I've seen a program looking into the Registry to check for Python. My Python 2.7 just works as-is on most cases.
python27-inspection-failed

Furthermore, after downloading the Pothos sources from GitHub, I failed to find any .cpp or .py file with the above error-message. What gives?
Maybe I can add this Registry key manually? (I don't dare to reinstall Python 2.7).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.