discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] How to "close" osmosdr source?


From: M. Ranganathan
Subject: Re: [Discuss-gnuradio] How to "close" osmosdr source?
Date: Fri, 25 Mar 2016 16:47:22 -0400

Yes. It is indeed the way to go about things. Works much more smoothly and quite a bit faster as well. Thanks.

On Fri, Mar 25, 2016 at 11:26 AM, Kevin Reid <address@hidden> wrote:
On Mar 25, 2016, at 7:53, M. Ranganathan <address@hidden> wrote:

> Kevin,
>
> Thanks for the answer. My setup is a little more complicated than that. The sensor reads its configuration from the server. The server could reconfigure the sensor between restarts.
>
> I did try stopping the task graph and restarting but the problem is unresolved. I tried ulocking but I get the following: AttributeError: 'top_block_sptr' object has no attribute '_unlock'

The method is called unlock, not _unlock. The underscore in my previous message was for emphasis. I didn't mean to suggest that you should blindly call unlock(), but as part of a proper flowgraph reconfiguration. Sketch like this:


  top_block.lock()
  top_block.disconnect(source, whatever_is_next)
  top_block.unlock()
  source = osmosdr.source(...)
  top_block.lock()
  top_block.connect(source, whatever_is_next)
  top_block.unlock()

What I meant in my previous message was that line 3 of this example must be present before line 4 (you can't lock/unlock only once around the whole thing). This is because the changes don't completely take effect until you unlock, so the old source is still around.

You might find it simpler to discard the entire flow graph and rebuild it. But again, you must make sure that you're not holding on to references to the source in any direct or indirect way.

--
Kevin Reid                                  <http://switchb.org/kpreid/>




--
M. Ranganathan

reply via email to

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