USRP2 start/stop issues

I have an application where I have to start and stop the USRP2
multiple times at various points, but I’ve been having trouble getting
it to work. I traced it down to see that when the stop control message
is sent, the host never processes the reply pack from the USRP2. Using
Wireshark, I can see that this packet is being sent. After the failure
of the stop command, the remaining commands to restart the USRP2 and
set its parameters fail.

To make this easier to debug, I found out that the simple program
below exercises the problem nicely. To see the failures, I just print
out the success message from “usrp2::impl::stop_rx_streaming” and from
“usrp2::impl::start_rx_streaming” (in /usrp2/host/lib/usrp2_impl.cc).
This is what happens:

usrp2::stop_rx_streaming: success=1
usrp2::start_rx_streaming: success=1
usrp2::stop_rx_streaming: success=0
usrp2::start_rx_streaming: success=0
usrp2::stop_rx_streaming: success=0

The first stop_rx_streaming comes during the initialization of the
USRP2 to make sure its not streaming yet.

Strangely (or maybe not; I can think of a some good reasons for this
behavior), when you set the “rate” variable to above 300 to slow down
the transmissions, everything works fine. At rate=200 it’s flaky;
sometimes it works and sometimes it doesn’t. So there seems to be some
timing issue involved.

I’ve been looking and feel like I’m getting close to an answer, but it
keeps escaping me. Any ideas on what’s causing this?

Test program:

#!/usr/bin/env python
from gnuradio import gr, usrp2

class usrp2_test(gr.top_block):
def init(self):
gr.top_block.init(self)

    rate = 100

    src = usrp2.source_32fc("eth1", "")
    src.set_decim(rate)
    src.set_center_freq(10e6)

    snk = gr.null_sink(gr.sizeof_gr_complex)

    self.connect(src, snk)

def main():
tb = usrp2_test()

tb.start()
tb.stop()
tb.wait()

tb.start()
tb.stop()
tb.wait()

if name == “main”:
main()

Tom

On Tue, Sep 01, 2009 at 06:23:24PM -0400, Tom R. wrote:

out the success message from “usrp2::impl::stop_rx_streaming” and from
USRP2 to make sure its not streaming yet.

Strangely (or maybe not; I can think of a some good reasons for this
behavior), when you set the “rate” variable to above 300 to slow down
the transmissions, everything works fine. At rate=200 it’s flaky;
sometimes it works and sometimes it doesn’t. So there seems to be some
timing issue involved.

I’ve been looking and feel like I’m getting close to an answer, but it
keeps escaping me. Any ideas on what’s causing this?

Not sure, but it could be timing out waiting for the reply.
(And not sure why that would bork the following commands…)

If you’ve got a minute, try printing the value of “success” on line 680
and 681.

Eric

On Tue, Sep 01, 2009 at 03:58:32PM -0700, Eric B. wrote:

below exercises the problem nicely. To see the failures, I just print
The first stop_rx_streaming comes during the initialization of the

It’s fixed! I ran your test case 500 times w/o failure.

There was a race in the code that notified the caller when the reply
came in. I also used your “don’t enqueue when trying to stop” idea too.

Please pull from http://gnuradio.org/git/eb.git u2-hang

Eric

On Fri, Sep 4, 2009 at 04:14, Eric B.[email protected] wrote:

Please pull from http://gnuradio.org/git/eb.git u2-hang

This has been merged into the master branch.

Johnathan

On Fri, 2009-09-04 at 08:51 -0700, Eric B. wrote:

On Fri, Sep 04, 2009 at 08:20:19AM -0700, Johnathan C. wrote:

On Fri, Sep 4, 2009 at 04:14, Eric B.[email protected] wrote:

Please pull from http://gnuradio.org/git/eb.git u2-hang

This has been merged into the master branch.

Thanks!

No, thank you for cleaning up after me :slight_smile:

Johnathan

Hi,

From: Johnathan C. [email protected]
Subject: Re: [Discuss-gnuradio] USRP2 start/stop issues

On Fri, Sep 4, 2009 at 04:14, Eric B.wrote:

Please pull from http://gnuradio.org/git/eb.git u2-hang

This has been merged into the master branch.

Johnathan

svn trunk ?

Best Regards,

Firas

On Fri, Sep 04, 2009 at 08:20:19AM -0700, Johnathan C. wrote:

On Fri, Sep 4, 2009 at 04:14, Eric B.[email protected] wrote:

Please pull from http://gnuradio.org/git/eb.git u2-hang

This has been merged into the master branch.

Thanks!

Eric

On Sat, Sep 5, 2009 at 2:59 AM, Josh B.[email protected] wrote:

The svn trunk has been unofficially deprecated since august third.

http://www.mail-archive.com/[email protected]/msg20442.html

SVN has the nice capability of fetching only a portion of the code
without requiring me to grab the entire code base. I find this
feature lacking in git.

Can it be setup such that the accepted git master is mirrored in the
SVN repository even if the SVN repo doesn’t see any real development
on it and is only a place to “stash” the current workings?

Thanks,
Brian

On Sat, Sep 5, 2009 at 07:27, Brian P.[email protected] wrote:

SVN has the nice capability of fetching only a portion of the code
without requiring me to grab the entire code base. I find this
feature lacking in git.

Can it be setup such that the accepted git master is mirrored in the
SVN repository even if the SVN repo doesn’t see any real development
on it and is only a place to “stash” the current workings?

I owe everyone on the list an update on what we’ve done transitioning
from Subversion to Git; this should happen after the holiday here in
the US.

Johnathan

On Fri, Sep 4, 2009 at 7:14 AM, Eric B.[email protected] wrote:

To make this easier to debug, I found out that the simple program

keeps escaping me. Any ideas on what’s causing this?

Hey. I thought I hit both you and Johnathan with a thank you email,
but looking back, looks like it only went to Corgan.

The fix works, so I’m well on my way with what I’m trying to do now.
Thank you very much for the quick turnaround on this.

Tom

Please pull from http://gnuradio.org/git/eb.git u2-hang
This has been merged into the master branch.

Johnathan

svn trunk ?

The svn trunk has been unofficially deprecated since august third.

http://www.mail-archive.com/[email protected]/msg20442.html

-Josh

On Sat, Sep 05, 2009 at 05:26:13PM -0400, Tom R. wrote:

Eric

Hey. I thought I hit both you and Johnathan with a thank you email,
but looking back, looks like it only went to Corgan.

The fix works, so I’m well on my way with what I’m trying to do now.
Thank you very much for the quick turnaround on this.

Tom

You’re welcome. The funny thing is that the bug has been there since
the beginning but seems to have only recently raised its head. I’m
not sure if there’s been a kernel upgrade along the way that sped up
the path we’re executing or what. Glad it’s fixed in any case.

Eric

Nice job all!
Sent from my Verizon Wireless BlackBerry

Hi,

From: Philip B. [email protected]

How to browse git files and modifications ? I dont see it in the Wiki pages.

GNU Radio cgit

Philip

Thank you.

Never saw this link before.

Best Regards,

Firas

Hi,

The svn trunk has been unofficially deprecated since august third.

http://www.mail-archive.com/[email protected]/msg20442.html

-Josh

At Third August, Jonathan wrote :
{

We are using the git-svn gateway to mirror Subversion trunk commits
into the the above repository, and any git commits we manually push
into the above repository will become check-ins back into the
Subversion trunk. (This process is working but does not yet operate
automatically.)
}

I think the process is still not working. So, how we will know how
(for example) Eric solved USRP2 stop problem? What were the
modifications and on what files ?

Any suggestions or help ?

How to browse git files and modifications ? I dont see it in the Wiki
pages.

Best Regards,

Firas