discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Difference between run and start/stop commands


From: mjquinn
Subject: Re: [Discuss-gnuradio] Difference between run and start/stop commands
Date: Wed, 14 Dec 2005 12:24:08 -0500
User-agent: Internet Messaging Program (IMP) H3 (4.0.4)

I have a question regarding this -1 (or EOF) termination method.

Let's assume that we have a simple graph consisting of gr.file_source
a filter
usrp_sink

Say gr.file_source outputs the contents of the file and then returns with -1
what happens next?

What does the next block (ie, filter) do?
will it return a -1 as well when it finishes processing the data,
or will it continue until there is nothing to be processed?
in the later case, how does the scheduler know not to activate the filter anymore?

I guess I am completely ignorant of the internal architecture of gnuradio/scheduling, thus the questions. I wonder if one of the architects can spare some time and write an one page paper on the basics of gnuradio.





Most graphs will run forever unless you explicity tell them to stop.
The exceptions are those which contain blocks that return -1 from
their work function.  This is a kind of EOF indication.  The most common
block that returns -1 is gr.file_source.  This allows us to process
data from a file and terminate when it's done.  The other block that
has this feature is gr.head(sizeof_item, nsamples).  It returns -1
after it copies nsamples from its input to its output.  Use it when
you want to only run something for a fixed number of samples.



I couldn't find any such line in any file in that directory.  Any ideas?

To gather more info, edit
gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.cc.
Change the line that says

 #define ENABLE_LOGGING 0

to

 #define ENABLE_LOGGING 1

then do a make install from gnuradio-core/src/lib

When you run your code, you'll find an ascii log file called sst-0.log
in the current directory.  Examining it might shine some light
on the problem.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]