# Is file sink block resetting USRP?

**URL:** <https://www.ruby-forum.com/t/is-file-sink-block-resetting-usrp/242107>\
**Category:** GNU Radio\
**Created:** [May 27, 2015, 11:54pm UTC](https://www.ruby-forum.com/t/is-file-sink-block-resetting-usrp/242107 "2015-05-27T23:54:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 27, 2015, 11:54pm UTC](https://www.ruby-forum.com/t/is-file-sink-block-resetting-usrp/242107/1 "2015-05-27T23:54:33Z")

</div>

Hi all,

I use a file sink block in my flow graph to record samples from a USRP  
N210. I start the flow graph and then after some time starts to record  
using the file sink block by switching it on using a selector block.

My question is, when the file sink is activated, is the flow graph in  
any  
way restarted?

I have attached a plot of the real part of the samples I recorded. I see  
strange behavior in the beginning as I would expect if I instantly  
started  
to record when the flow graph is started (due to the time it takes for  
the  
radio to tune in).

The reason to why I am asking is that I suspect that the phase of the  
signal is changed when I start to record, and maybe this could explain  
why.

Best regards,

Carl

---

<div class="post-metadata">

**Author:** ![calvin76](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9de053/32.png) [@calvin76](https://www.ruby-forum.com/u/calvin76)\
**Post date:** [May 28, 2015, 12:31am UTC](https://www.ruby-forum.com/t/is-file-sink-block-resetting-usrp/242107/2 "2015-05-28T00:31:58Z")

</div>

On 05/27/2015 05:52 PM, Carl O. wrote:

> see strange behavior in the beginning as I would expect if I instantly
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)  
> My recollection is that the selector blocks stop the graph, reconfigure  
> it, and start it again, which means source streams probably get  
> restarted.

When I’ve need to do this in the past, I just tie the filename to a  
variable that is controlled by my “start recording” button–when I’m not  
recording, the file sink is set to “/dev/null”, and when I _am_  
recording, it’s set to the target file.

---

<div class="post-metadata">

**Author:** ![calvin76](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9de053/32.png) [@calvin76](https://www.ruby-forum.com/u/calvin76)\
**Post date:** [May 28, 2015, 2:28pm UTC](https://www.ruby-forum.com/t/is-file-sink-block-resetting-usrp/242107/3 "2015-05-28T14:28:17Z")

</div>

On 27.05.2015 18:30, Marcus D. Leech wrote:

> On 05/27/2015 05:52 PM, Carl O. wrote:
> 
> > Hi all,
> > 
> > I use a file sink block in my flow graph to record samples from a USRP  
> > N210. I start the flow graph and then after some time starts to record  
> > using the file sink block by switching it on using a selector block.
> 
> My recollection is that the selector blocks stop the graph, reconfigure  
> it, and start it again, which means source streams probably get restarted.

That’s right: lock() and unlock() are called, which reset the blocks.  
Marcus’ suggestion is the easiest and most effective solution to this;  
we also have another block (matrix\_multiply\_xx) which can act as a  
selector that doesn’t call lock() if you require this.

M
