This is a followup to variations in decoding the same file. You may recall that 
I was implementing a sink block that accepted AFSK tones and produced a PDU 
message. After messing with set_history() and set_output_multiple(), I learned 
that the scheduler will sometimes provide different amounts of noutput_items to 
work(). Because I was mishandling noutput_items, it looked like the decoding 
was non-deterministic, but it was actually variations in noutput_items.


Other things that may be useful for beginners:
a) it's easy to print a few things to the output window using:
GR_LOG_INFO(d_logger, "Message goes here");

b) you can define a separate output (or outputs) for debugging and assign an 
internal variable to it in work(); then use the QT Time plot to trace your 
internal variable against inputs or other streams.

c) the argument noutput_items applies to both inputs AND outputs, for any 
variation of a sync block. This includes sink and source blocks. This is 
especially confusing for a sink block because there are no outputs. You might 
think that you would tell the scheduler how many items you consumed, but no, 
you declare a quantity produced, and that gets applied to both ins and outs. 
Eventually you can find this in the docs and examples, but even then it is not 
obvious.


________________________________
From: Gavin Jacobs <[email protected]>
Sent: September 21, 2016 10:07 AM
To: [email protected]
Subject: Re: [Discuss-gnuradio] Module development and debugging
Are you saying that on the same file, it gives non-deterministic
results? If so, that might be a bug in the file, but could also be in
GNU Radio. There are rumours that there's a randomness bug in the
scheduler, but it's hard to reproduce.
GBJ> I set the wav file to repeat, and it always decodes differently; but I 
should be able to provide more info once I learn more about the items below.






_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to