Fix for usrp2 overruns when stopping and restarting rx streaming

Hi All,

When you use an USRP2 for capturing and you call

u2->stop_rx_streaming()

and later

u2->start_rx_streaming(0)

You always get a single overrun.
-a single ‘S’ is output on the console
-u2->rx_overruns() returns 1 (in stead of 0)

I am developing a usrp2 application which does not permit any overrun
conditions, so this needed fixing.

It turns out that the expected sequence number of received samples is
not reset when stopping the stream.

This single line patch fixes this.

Best Regards,

Martin

diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index b19c6ec…92d52db 100644
— a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -814,6 +814,7 @@ namespace usrp2 {
success = transmit_cmd_and_wait(&cmd, sizeof(cmd), &p,
DEF_CMD_TIMEOUT);
success = success && (ntohx(reply.ok) == 1);
d_channel_rings[channel].reset();

  •  d_rx_seqno=-1;
     //fprintf(stderr, "usrp2::stop_rx_streaming:  success = %d\n",
    

success);
return success;
}

On Wed, Apr 21, 2010 at 04:08, Martin DvH [email protected]
wrote:

This single line patch fixes this.

This has been applied on the master branch.

Johnathan

Hi Johnathan,

I have updated to 3.3git-473-g41526cd4. It seems the lastest version
from
the last week.

However, ‘S’ is still shown on the console everytime after I use stop
wait
and start the flow graph again.
And received samples is not reset which caused a obvious delay for
further
application.

I have stuck it for quite long time. Can I reset the sample data manual
in
python?

thank you.
Andy

Johnathan C.-2 wrote:


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://old.nabble.com/fix-for-usrp2-overruns-when-stopping-and-restarting-rx-streaming-tp28314794p28331249.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Thu, Apr 22, 2010 at 09:21, Andy_Long [email protected]
wrote:

I have updated to 3.3git-473-g41526cd4. It seems the lastest version from
the last week.

The latest git master is 3.3git-725-g8d3a78da; however, it is only
available via using git to clone the repository.

It looks like you downloaded an older test tarball from the
gnuradio.org website. There is actually a newer one, -594, but that
still doesn’t have the fix you were looking for.

Johnathan

Hi, Martin

Can you put your version number if you have solved it?

thank you.
Andy

Martin D. wrote:

This single line patch fixes this.
@@ -814,6 +814,7 @@ namespace usrp2 {


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://old.nabble.com/fix-for-usrp2-overruns-when-stopping-and-restarting-rx-streaming-tp28314794p28331267.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Thu, Apr 22, 2010 at 12:51, Andy_Long [email protected]
wrote:

1, Can I keep all the package for gnuradio from binary package and update to
the newest version by using git?

No. You will need to uninstall the binary packages.

2, When I can track the 3.3git-725-g8d3a78da version from "Ubuntu Jaunty
(9.04) Distribution unstable development branch ". Will it be available in

It is available now; that is the latest commit to our GNU Radio
development tree.

Go to this wiki page, then go to “Development”:

http://gnuradio.org/redmine/wiki/gnuradio/Download

You will use the git source code repository client to create a local
copy of the source code, then compile and install from there according
to the Ubuntu installation for your version.

The window for 3.3 development is now closing very rapidly, and I
expect to have 3.3 stable released in May. We’ll have new binary
packages at that point.

Johnathan

Hi, Johnathan

I installed from binary package installation for Ubuntu 9.04. Last time
you
said that "You’ll need to switch from the binary install you have now to
a
source code install from the git tree to get the fix. "

But the install guide from gnuradio wiki only shows that how to transfer
from already installed GNU Radio on your system via a source compile to
binary packages. Actually there is any information for people go for
opposite direction.

Furthermore, the source code install build guide for Ubuntu shows that
“The
rest of this page is now somewhat outdated and needs some
reorganization”.

I have two questions.

1, Can I keep all the package for gnuradio from binary package and
update to
the newest version by using git?

2, When I can track the 3.3git-725-g8d3a78da version from "Ubuntu Jaunty
(9.04) Distribution unstable development branch ". Will it be available
in
April or May?

thank you.
Andy

Johnathan C.-2 wrote:

gnuradio.org website. There is actually a newer one, -594, but that


View this message in context:
http://old.nabble.com/fix-for-usrp2-overruns-when-stopping-and-restarting-rx-streaming-tp28314794p28333835.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Andy_Long wrote:

usrp2_impl.cc: In member function ‘void usrp2::usrp2::impl::start_bg()’:
usrp2_impl.cc:340: Error: ‘bind’isn’t‘boost’member

I ran into this also a day or two ago. Try adding “#include
<boost/bind.hpp>” to usrp2/host/include/usrp2/usrp2.h.

– Don W.

Hi Johnathan,

I have tried to build from source.

However, after sudo make install there is always a error that, Do I miss
some some dependencies? I have install all the package with similar name
from documents here.
http://gnuradio.org/redmine/repositories/changes/gnuradio/README

Error message:

deps/usrp2_impl.Tpo -c usrp2_impl.cc -fPIC -DPIC -o .libs/usrp2_impl.o
usrp2_impl.cc: In member function ‘void usrp2::usrp2::impl::start_bg()’:
usrp2_impl.cc:340: Error: ‘bind’isn’t‘boost’member
usrp2_impl.cc: In member function ‘int
usrp2::usrp2::impl::handle_data_packet(const void*, size_t)’:
usrp2_impl.cc:453: Warning: ignoring return value warn_unused_result
declared with attribute ‘ssize_t write(int, const void*, size_t)’
make[3]: *** [usrp2_impl.lo] Error 1
make[3]:Leaving directory /home/shi/gnuradio/usrp2/host/lib' make[2]: *** [install-recursive] Error 1 make[2]:Leaving directory /home/shi/gnuradio/usrp2/host’
make[1]: *** [install-recursive] Error 1
make[1]:Leaving directory `/home/shi/gnuradio/usrp2’
make: *** [install-recursive] Error 1

However The message after ./configure shows that usrp2 will be install
and
only usrp1 won’t install


The following GNU Radio components have been successfully configured:

config
gruel
omnithread
gnuradio-core
mblock
usrp2
vrt
gr-usrp2
gr-msdd6000
gr-audio-alsa
gr-audio-oss
gr-audio-portaudio
gr-atsc
gr-cvsd-vocoder
gr-gsm-fr-vocoder
gr-noaa
gr-pager
gr-radio-astronomy
gr-trellis
gr-video-sdl
gr-wxgui
gr-qtgui
gnuradio-examples
grc
docs

You my now run the make command to build these components.


The following components were skipped either because you asked not
to build them or they didn’t pass configuration checks:

gcell
usrp
gr-usrp
gr-gcell
gr-audio-jack
gr-audio-osx
gr-audio-windows
gr-comedi
gr-gpio
gr-radar-mono
gr-sounder
gr-utils

These components will not be built.

Thank you.
regards,
andy

Configured GNU Radio release 3.3git-727-g04db1ec3 for build.

Johnathan C.-2 wrote:

(9.04) Distribution unstable development branch ". Will it be available
copy of the source code, then compile and install from there according
Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://old.nabble.com/fix-for-usrp2-overruns-when-stopping-and-restarting-rx-streaming-tp28314794p28345022.html
Sent from the GnuRadio mailing list archive at Nabble.com.

I have solved it and updated to the newest version. Hope it will solve
usrp2
overrun problem.

Thank you Don and Johnathan .

Andy

View this message in context:
http://old.nabble.com/fix-for-usrp2-overruns-when-stopping-and-restarting-rx-streaming-tp28314794p28349271.html
Sent from the GnuRadio mailing list archive at Nabble.com.

I can pass the make and make check after adding this line. However it
still
can not work and show the error:

from gnuradio import usrp2
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python2.6/dist-packages/gnuradio/usrp2.py”, line
6,
in
import _usrp2
ImportError: libgnuradio-usrp2.so.0: cannot open shared object file: No
such
file or directory

If I run find_usrps, error shows.

@ubuntu:~$ find_usrps
find_usrps: error while loading shared libraries: libusrp2.so.0: cannot
open
shared object file: No such file or directory

thank you.
regards,
Andy

Don W. wrote:

Error message:


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://old.nabble.com/fix-for-usrp2-overruns-when-stopping-and-restarting-rx-streaming-tp28314794p28346600.html
Sent from the GnuRadio mailing list archive at Nabble.com.