# A reconfiguring the flow graph question

**URL:** <https://www.ruby-forum.com/t/a-reconfiguring-the-flow-graph-question/220683>\
**Category:** GNU Radio\
**Created:** [June 16, 2012, 4:19pm UTC](https://www.ruby-forum.com/t/a-reconfiguring-the-flow-graph-question/220683 "2012-06-16T16:19:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 16, 2012, 4:19pm UTC](https://www.ruby-forum.com/t/a-reconfiguring-the-flow-graph-question/220683/1 "2012-06-16T16:19:32Z")

</div>

Hi,

I have several processing chains I need to switch in and out of my flow  
graph. What I have is several chains that look like

filter1-\>quad\_demod1-\> …  
filter2-\>quad\_demod2-\> …

Can I not connect the chains together first and then just switch them in  
and out ?

Say chain 2 was the one connected to the source as  
usrp\_source -\> filter2 -\> …

Can I not switch to chain 1 by

top\_block-\>lock();  
top\_block-\>disconnect(usrp\_source, 0, filter2, 0);  
top\_block-\>connect(usrp\_source, 0, filter1, 0);  
top\_block-\>unlock();

When I try to connect the chains together at startup I’m getting a seg  
fault with the following line. Its the first line where I connect the  
first chain together.

top\_block-\>connect(filter1, 0, quad\_demod1, 0);

What am I not understanding about this?

thanks  
Steve

---

<div class="post-metadata">

**Author:** ![stephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@stephen](https://www.ruby-forum.com/u/stephen)\
**Post date:** [June 16, 2012, 6:30pm UTC](https://www.ruby-forum.com/t/a-reconfiguring-the-flow-graph-question/220683/2 "2012-06-16T18:30:25Z")

</div>

On 06/16/2012 07:18 AM, Stephen wrote:

> and out ?

You may want to checkout the stream selector block in this project, as  
opposed to stopping and disconnecting:

> **[Home](https://github.com/guruofquality/grextras/wiki#wiki-list-of-blocks-in-this-project)**
>
> Advanced GNU Radio Blocks. Contribute to guruofquality/grextras development by creating an account on GitHub.

> When I try to connect the chains together at startup I’m getting a seg  
> fault with the following line. Its the first line where I connect the  
> first chain together.
> 
> top\_block-\>connect(filter1, 0, quad\_demod1, 0);
> 
> What am I not understanding about this?

I recommend taking a look at a gdb traceback. But if I had to guess,  
filter1 or quad\_demod could be an empty shared pointer → ie not  
initialized.

-josh

---

<div class="post-metadata">

**Author:** ![stephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@stephen](https://www.ruby-forum.com/u/stephen)\
**Post date:** [June 16, 2012, 8:47pm UTC](https://www.ruby-forum.com/t/a-reconfiguring-the-flow-graph-question/220683/3 "2012-06-16T20:47:08Z")

</div>

On 6/16/2012 11:29 AM, Josh B. wrote:

> You may want to checkout the stream selector block in this project, as  
> opposed to stopping and disconnecting:

> **[Home](https://github.com/guruofquality/grextras/wiki#wiki-list-of-blocks-in-this-project)**
>
> Advanced GNU Radio Blocks. Contribute to guruofquality/grextras development by creating an account on GitHub.

> 

thanks I’ll look at that.

> I recommend taking a look at a gdb traceback. But if I had to guess,  
> filter1 or quad\_demod could be an empty shared pointer → ie not  
> initialized.

I have but it’s 4 or 5 levels down inside of boost. both filter1 and the  
quad\_demod block appear to be valid. In the filter block I can call  
set\_center\_freq and in the demod block I can call set\_gain. Both of  
those calls work.

stephen

---

<div class="post-metadata">

**Author:** ![stephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@stephen](https://www.ruby-forum.com/u/stephen)\
**Post date:** [June 17, 2012, 3:38am UTC](https://www.ruby-forum.com/t/a-reconfiguring-the-flow-graph-question/220683/4 "2012-06-17T03:38:24Z")

</div>

On 6/16/2012 11:29 AM, Josh B. wrote:

> You may want to checkout the stream selector block in this project, as  
> opposed to stopping and disconnecting:

> **[Home](https://github.com/guruofquality/grextras/wiki#wiki-list-of-blocks-in-this-project)**
>
> Advanced GNU Radio Blocks. Contribute to guruofquality/grextras development by creating an account on GitHub.

> 

that looks like it will do exactly what i need. But I’m having trouble  
figuring out how to use set\_paths. For the case of one input with  
multiple outputs and the case of multiple inputs and one output.

steve
