Re: Best way to set USRP Sink value from separate thread

2020-06-18 Thread Guy Marino
Hi Marcus, Thank you so much, it's working like a charm now! Best, Guy On Wed, Jun 17, 2020 at 5:59 PM Marcus Müller wrote: > Hi Guy, > > you don#t have to stop a flow graph to set the gain value. In fact, you > shouldn't. > > Yes, you'll still have signal passing through your USRP while you'r

Re: Best way to set USRP Sink value from separate thread

2020-06-17 Thread Marcus Müller
Hi Guy, you don#t have to stop a flow graph to set the gain value. In fact, you shouldn't. Yes, you'll still have signal passing through your USRP while you're adjusting the gain, but that's exactly what timed commands are for. > I've heard about sending commands to the > USRP Sink, though I cou

Re: Best way to set USRP Sink value from separate thread

2020-06-17 Thread Nick Foster
Just call set_gain() from the thread context of the USRP sink, i.e., the top_block. Use a semaphore: the thread doing the calling sets a semaphore in the top_block, and then the top_block runs a loop which looks for that semaphore to be set and then calls set_gain. Nick On Wed, Jun 17, 2020 at 1:

Best way to set USRP Sink value from separate thread

2020-06-17 Thread Guy Marino
Hello, I'm currently working on a multithreaded application which needs to set the gain value of a USRP sink at runtime. The only thing I've found that works so far is: stop() -> wait() -> lock() -> set_gain() -> unlock() -> start() I tried using just lock/unlock, but this causes the SDR to free