# HeirBlock2 Lock/Unlock breaks WavSink

**URL:** <https://www.ruby-forum.com/t/heirblock2-lock-unlock-breaks-wavsink/233687>\
**Category:** GNU Radio\
**Created:** [January 4, 2015, 2:39pm UTC](https://www.ruby-forum.com/t/heirblock2-lock-unlock-breaks-wavsink/233687 "2015-01-04T14:39:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [January 4, 2015, 2:39pm UTC](https://www.ruby-forum.com/t/heirblock2-lock-unlock-breaks-wavsink/233687/1 "2015-01-04T14:39:58Z")

</div>

Short story - doing a Lock/Unlock on a HeirBlock2 to reconfigure its  
internal flow graph stops a WavFile\_Sink that is in it until a new wav  
file is opened. It doesn’t affect any File\_Sinks that are in the graph.  
If there are multiple instances of the HeirBlock2 running, it will stop  
the WavFile\_Sink running in all the instances. This didn’t happen in  
3.6, but started in 3.7. I have an extremely simplified sample program  
that demonstrates the problem: [GitHub - robotastic/multi-wav: Test out having multiple wav recorder running at once](https://github.com/robotastic/multi-wav)  
[https://github.com/robotastic/multi-wav](https://github.com/robotastic/multi-wav)

Long Story - I am recording multiple audio channels from my SDR to  
capture my local fire departments radio system. I have to add and remove  
multiple recorders at different freq offsets to catch the different  
transmissions as the start and stop. To do that I have a bunch of  
HeirBlock2 based graphs that I attach to the source. When they are not  
being used I lock the block and connect the block source to a null sink.  
When they are needed, I connect all the internal blocks together and  
tune the xlating offset.

The sample program I wrote shows this. It starts up 6 recording blocks.  
After 10 seconds it will randomly lock/unlock one of the recording  
blocks. You will see that all of the WavFile\_Sinks in each instance of  
the block stops recording. However the file\_sinks that are attached  
inside the Block keep on recording fine. You will see the raw file size  
continue to grow and the wav file size stop.

The sample program is in C++. You should be able to download, do ‘cmake  
.’ and then ‘make’ and then ‘./multi-wav’ Then look in the ‘recordings’  
directory.

It seems like there is a problem with GnuRadio and HeirBlock Locking in  
3.7…. or wavfile\_sink. Also possible I did something really dumb. Any  
thoughts?
