File Sink Size

Hi,

I am using gnuradio companion and I noticed that the block “file sink”
isn’t
written if the number of complex samples stored in it is less or equal
to
512. For a bigger number of samples the file has data inside but
otherwise
it is empty.

Is it supposed to be this way? Is there any way to create shorter files?

View this message in context:
http://old.nabble.com/File-Sink-Size-tp33545017p33545017.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Thats is weird because with me, the file sink will not save anything
above 1024 in real format. Granted, I never tried anything below that.

-Jon

On 04/03/2012 08:48 AM, Jonathan F. wrote:

Thats is weird because with me, the file sink will not save anything
above 1024 in real format. Granted, I never tried anything below that.

-Jon

There’s nothing in the file sink that cares one little bit about how big
your files are. It just uses the stdio library to
write raw samples to whatever file you’ve specified. But because it
uses stdio, it also uses, by default, buffering.
The default stdio buffer size varies from Linux version of Linux
version. So, if you’re running along, and then suddenly
interrupt your app unceremoniously, some number of samples will be
left in the stdio buffer unwritten.

If you use the “unbuffered” option on the file-sink, you can get it to
flush the stdio buffers on every write. This is inefficient,
and I only recommend it for lower sample rates.

But that’s just the stdio buffering. Internal to Gnu Radio, there are
also buffers that hold your “samples in flight”, and that’s of
an unpredictable size.

View this message in context:
Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium

On 03/04/12 04:20 AM, frankist wrote:

Hi,

I am using gnuradio companion and I noticed that the block “file sink” isn’t
written if the number of complex samples stored in it is less or equal to
512. For a bigger number of samples the file has data inside but otherwise
it is empty.

Is it supposed to be this way? Is there any way to create shorter files?

The using the “unbuffered” parameter when you create the block.


Principal Investigator
Shirleys Bay Radio Astronomy Consortium