discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: File Source - File Sink data transfer


From: Marcus Müller
Subject: Re: File Source - File Sink data transfer
Date: Wed, 18 May 2022 13:02:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

Hi Jeff,

yeah, that's odd; I was just assuming you were literally typing () in that field, but that just is the string representation of PMT_NIL, so: my apologies :)

What's mainly odd is that PMT_NIL is not accepted; it certainly works for me, and I've checked: There's no code changes in that block's tag handling, the GRC block or the python bindings, and also not to the add_item_tag method, between GNU Radio v3.9.6 and what I'm running :/

What's really confusing is this: If you look at the file source's source code, what it does is check whether you're at the file beginning AND whether the begin tag is NOT PMT_NIL, and only if that's the case, it'd actually call the `add_item_tag` method that fails [1].

 279   │         if (d_file_begin && d_add_begin_tag != pmt::PMT_NIL) {
 280   │             add_item_tag(0,
 281   │                          nitems_written(0) + noutput_items - size,
 282   │                          d_add_begin_tag,
 283   │                          pmt::from_long(d_repeat_cnt),
 284   │                          _id);
 285   │             d_file_begin = false;
 286   │         }

So, if pmt.PMT_NIL was actually successfully passed to the file source, this should never be called! But: it does seem to be called. But it's also being called with something that might very well actually *be* an instance of pmt_null, just maybe not the one and only instance of pmt_null that should exist, namely PMT_NIL?!

This all reeks of Static Initialization Order Fiasco, but I'm really confused on how that could arise here :/ It's a bit as if your flowgraph's python and your file_source's C++ use a different PMT_NIL, although in both it should 100% be the same. Looking for something to hold onto: How did you install your GNU Radio?

Best regards,
Marcus

[1] https://github.com/gnuradio/gnuradio/blob/v3.9.6.0/gr-blocks/lib/file_source_impl.cc#L279-L286

On 18.05.22 12:13, user 1 wrote:
Hi Marcus,

Thank you for your message.


pmt.PMT_NIL is the default value of add begin tag, but unfortunately that doesn't work, see the error message (Screenshots 1 and 2).

However, after many trials, if I put under the add begin tag the values:

    pmt.string_to_symbol("file_begin")

or

    pmt.string_to_symbol("")

or

    pmt.string_to_symbol("whatever_you_want")


finaly the data transfer works fine !

See (Screenshots 4 and 5)


Odd, isn'it ?



Jeff




reply via email to

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