Wednesday, November 29, 2017

[Discuss-gnuradio] problem with Tagged File Sink

I have a custom block that is adding the "burst" "True" and "False" tags
via:
add_item_tag(0, d_total_passed_samples, pmt::mp("burst"), pmt::mp("True"));
and
add_item_tag(0, d_total_passed_samples-1, pmt::mp("burst"),
pmt::mp("False"));

When I run it and look at the output via Tag Debug, I see:
----------------------------------------------------------------------
Tag Debug: burst
Input Stream: 00
  Offset: 0  Source: n/a     Key: burst   Value: True
----------------------------------------------------------------------

----------------------------------------------------------------------
Tag Debug: burst
Input Stream: 00
  Offset: 4999999  Source: n/a     Key: burst   Value: False
----------------------------------------------------------------------

Which seems correct to me.  I have a sample rate of 5Msps, and was
attempting to save 1 seconds worth of data, so 5000000 seems like the
right number of samples to pass through.

Yet if I look at what gets generated by Tagged File Sink, I see this file:
file4_0_0.00000000.dat of size 39997440

Then when I close the flowgraph, it appears that it finishes writing the
file and it looks like this:
file4_0_0.00000000.dat of size 40000000

If I don't close the flowgraph and send another burst through, I get the
Tag Debug of:
----------------------------------------------------------------------
Tag Debug: burst
Input Stream: 00
  Offset: 5000000  Source: n/a     Key: burst   Value: True
----------------------------------------------------------------------

----------------------------------------------------------------------
Tag Debug: burst
Input Stream: 00
  Offset: 9999999  Source: n/a     Key: burst   Value: False
----------------------------------------------------------------------


and the file is the same name and now has a size of 39997440 until I
close it, then it has a size of 40000000.

So this leads me to believe that my Flase tag is not making it through
the stream, but I think I am pringing it right.

Is there a bug in Tagged File Sink (not likely)?  Or am I doing
something wrong (where my money is)?

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

No comments:

Post a Comment