# Change in 3.7 with buffers

**URL:** <https://www.ruby-forum.com/t/change-in-3-7-with-buffers/233007>\
**Category:** GNU Radio\
**Created:** [November 11, 2014, 5:28am UTC](https://www.ruby-forum.com/t/change-in-3-7-with-buffers/233007 "2014-11-11T05:28:57Z")\
**Posts on this page:** 3\
**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:** [November 11, 2014, 5:28am UTC](https://www.ruby-forum.com/t/change-in-3-7-with-buffers/233007/1 "2014-11-11T05:28:57Z")

</div>

Sorry - I seem to keep running into weird corner cases with my program.  
I am having an issue were I am trying to run multiple graphs off the  
same source, and decoding different channels digital audio to wav files.  
It worked great under 3.6, but with 3.7 they are cutting off  
prematurely.

I will keep digging deeper, but I just wanted to check first to see if  
this has happened to anyone or if there were any obvious changes to  
blocks. If there anything new and special I might have to do to flush  
buffers in blocks once I tell it to stop recording and close the file? I  
am using wav\_file-\>close();. It is a pretty standard graph using  
quad\_demo to a gr\_DSD block to decode the digital audio and then a  
wav\_file\_sink.

- Luke

---

<div class="post-metadata">

**Author:** ![hagus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de053/32.png) [@hagus](https://www.ruby-forum.com/u/hagus)\
**Post date:** [November 11, 2014, 9:09am UTC](https://www.ruby-forum.com/t/change-in-3-7-with-buffers/233007/2 "2014-11-11T09:09:37Z")

</div>

On 11/11/2014 05:27 AM, Luke B. wrote:

> the file? I am using wav\_file-\>close();. It is a pretty standard  
> graph using quad\_demo to a gr\_DSD block to decode the digital audio  
> and then a wav\_file\_sink.

This behaviour was not (intentionally) changed. However, calling close()  
on a wav file block will not flush any buffers (and never has), it’ll  
just write the headers to the WAV file. That it’s cut off doesn’t strike  
me as odd, but I’m not sure why it would have worked before. Did you  
change buffer sizes?

M

---

<div class="post-metadata">

**Author:** ![hagus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de053/32.png) [@hagus](https://www.ruby-forum.com/u/hagus)\
**Post date:** [November 11, 2014, 10:12pm UTC](https://www.ruby-forum.com/t/change-in-3-7-with-buffers/233007/3 "2014-11-11T22:12:39Z")

</div>

I tried to build everything out as a GRC graph. I don’t think it has  
anything to do with the wav file sink. I recorded the raw signal and  
everything is working fine until it gets to the vocoder block, DSD. It  
handles decoding fine when there is only one instance, but when there  
are multiple instance of the block running at once, they step on each I  
think. So when one block stops it seems to be stopping the wav file for  
another.

Each of the blocks store state information for the radio call it is  
decoding. Did anything change between 3.6 and 3.7 with the way blocks  
are initialized, where some of the class variables are shared between  
multiple instances? Is there someway multiple instances of a single  
block type might be combined to save on memory?

The DSD block is created and return using the standard make and  
gnuradio::get\_initial\_sptr() pattern.

The weird part is that the same code logic works great in 3.6. I  
compared everything in diff and the only meaningful difference is the  
header changes for 3.7 classes.

- Luke
