Skip to content
forked from jolivain/gr-pipe

Make GNU Radio blocks with standard pipes.

Notifications You must be signed in to change notification settings

kgadgil/gr-pipe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gr-pipe GNU Radio blocks.

gr-pipe is a set GNU Radio block for using any program as a source,
sink or filter by using standard I/O pipes.

The main goals of these blocks are:
- Fast development of new experimental blocks (no need to dig into C++
  / GNU Radio internals / SWIG / Python).
- Ability to use any programming language able to deal with standard
  input and output (code a block in your preferred language: C, Java,
  MatLab, Perl, Ruby...).


Simple interface:

The pipe blocks read and write samples sequentially in their GNU Radio
internal representation.  The format is the same as for gr_file_source
and gr_file_sink:

GNU Radio Type, C Type, size
Complex, two floats (I,Q), 2*4 bytes
Float, float, 4 bytes
Int, int, 4 bytes
Short, short, 2 bytes
Byte, char, 1 byte

A typical source block command will produce data "forever" on its
standard output, until a SIGTERM is sent by the pipe.source block to
ask for normal termination.  Also, in case of an exception, the pipe
will be closed and a SIGPIPE will be caught.

A typical sink block command will consume data on its standard input,
until end-of-file (EOF) is read, for a proper termination.

A typical filter block command will comsume data "forever" on its
standard input, process it, and produce data on its standard output,
until end-of-file (EOF) is read, for normal termination.  Also in case
of exception, SIGPIPE may be caught.

In pipe blocks, commands are executed in a /bin/sh shell, so every
standard shell features are available in commands provided to blocks
(variables, loops, pipes, redirection, etc...).

See examples for a "square" block implemented in C, Java, MatLab/GNU
Octave, Perl and Python.

Suggestions of use:
- Compression (gzip, lzma, ...)
- Encryption (gpg, openssl, ...)
- Encoding (ffmpeg, mencoder, gsm-tools, ...)
- Debugging (od, hexdump, ...)
- Interface to devices (aplay, arecord, pacat, parec, ...)
- Use your own tools...

Kown limitations and problems:
- Small performance loss, due to pipe communications.
- Small addition of latency, due to pipe buffers.  (On Linux, pipe
  buffer capacity can be changed.  See fcntl(2) F_SETPIPE_SZ).
- Not compatible with stream tags
- Limited to only one input and one output maximum per block
  (but you may use interleaver or multiple blocks).


How to build and install gr-pipe:
(Assuming you have development tools and GNU Radio already installed)

git clone git:https://github.com/jolivain/gr-pipe.git
mkdir gr-pipe/build
cd gr-pipe/build
cmake ..
make
sudo make install


Feedback and comments are welcome !

Julien Olivain <[email protected]>

About

Make GNU Radio blocks with standard pipes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.1%
  • CMake 24.5%
  • C++ 6.1%
  • C 0.3%