# New stream selector block in gr-basic

**URL:** <https://www.ruby-forum.com/t/new-stream-selector-block-in-gr-basic/213859>\
**Category:** GNU Radio\
**Created:** [November 14, 2011, 4:58pm UTC](https://www.ruby-forum.com/t/new-stream-selector-block-in-gr-basic/213859 "2011-11-14T16:58:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [November 14, 2011, 4:58pm UTC](https://www.ruby-forum.com/t/new-stream-selector-block-in-gr-basic/213859/1 "2011-11-14T16:58:40Z")

</div>

Hey list,

I have noticed that many user’s have found the need to mux a stream.  
Either to dynamically select an alternative data source or to mux an  
output to an alternative sink like a different demodulator.

Currently, GRC has come with selector (and valve). These blocks  
implement stream muxing by dynamically reconfiguring the flow graph.  
However, this method seems to be slow and error prone.

So, I have created a stream selector block in gr-basic. Stream selector  
has N inputs and M outputs and allows the user to dynamically change the  
stream routing without flow graph reconfiguration.

The good:

- the switchover is immediate
- no lock/unlock start/stop, so no errors
- unused inputs can be put into blocking or consume mode

The bad:

- The post-reconfiguration overhead is an extra memcpy from source port  
to destination port

The work is here, and grc demo attached:  
[http://gnuradio.org/cgit/jblum.git/tree/gr-basic/include/gr\_basic\_stream\_selector.h?h=gr\_basic](http://gnuradio.org/cgit/jblum.git/tree/gr-basic/include/gr_basic_stream_selector.h?h=gr_basic)

-Josh

---

<div class="post-metadata">

**Author:** ![Josh\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8797f3/32.png) [@Josh\_B](https://www.ruby-forum.com/u/Josh_B)\
**Post date:** [November 15, 2011, 7:19am UTC](https://www.ruby-forum.com/t/new-stream-selector-block-in-gr-basic/213859/2 "2011-11-15T07:19:06Z")

</div>

Hi,

Can someone please explain me how can I integrate this new selector  
block into my gnuradio/GRC installation on Ubuntu.

Thanks,

Khalid.

Josh B. wrote in post #1031824:

> Hey list,
> 
> I have noticed that many user’s have found the need to mux a stream.  
> Either to dynamically select an alternative data source or to mux an  
> output to an alternative sink like a different demodulator.
> 
> Currently, GRC has come with selector (and valve). These blocks  
> implement stream muxing by dynamically reconfiguring the flow graph.  
> However, this method seems to be slow and error prone.
> 
> So, I have created a stream selector block in gr-basic. Stream selector  
> has N inputs and M outputs and allows the user to dynamically change the  
> stream routing without flow graph reconfiguration.
> 
> The good:
> 
> - the switchover is immediate
> - no lock/unlock start/stop, so no errors
> - unused inputs can be put into blocking or consume mode
> 
> The bad:
> 
> - The post-reconfiguration overhead is an extra memcpy from source port  
> to destination port
> 
> The work is here, and grc demo attached:

[http://gnuradio.org/cgit/jblum.git/tree/gr-basic/include/gr\_basic\_stream\_selector.h?h=gr\_basic](http://gnuradio.org/cgit/jblum.git/tree/gr-basic/include/gr_basic_stream_selector.h?h=gr_basic)

> -Josh
