Wednesday, April 24, 2013

Overruns & Underruns

No OMINThreads after 3.2.2

Versions of GNU Radio 3.2.2 and older used OMNIThread to provide threading functionality. OMNIThread is a C++ library providing a thread abstraction , namely a set of thread operations , for use in C++ programs. GNU Radio 3.3.0 , abandons OMNIThread in favour of BOOST threads. Therefore any application using threading which was written for GNU Radio 3.2.2 or earlier will not work with GNU Radio 3.3.0 and above.

Important paths

export PATH=$PATH:/opt/gnuradio/bin
export LD LIBRARY PATH=$LD LIBRARY PATH:/opt/gnuradio/lib
export PKG CONFIG PATH=$PKG CONFIG PATH:/opt/gnuradio/lib/pkgconfig
export PYTHONPATH=$PYTHONPATH:/opt/gnuradio/lib/Python2.6/site-packages

Overruns & Underruns


"u" = USRP


"a" = audio

"O" = overruns -- getting more samples than your CPU can process

"U" = underruns -- getting lesser samples thatn your USRP needs to run the process

Combining the flags above results in a specific indication of PC to USRP communication status. For example :

"aUaU" = audio underrun (PC is not providing samples rapidly enough to the soundcard)

"uOuO" = USRP overrun (PC is not keeping up with the sample rate of USRP), so USRP samples are being dropped

"uUuU" = obvious :)  i.e. USRP Underruns

** The frequency with which these symbols are printed on the screen is not an indication of the frequency of the underlying error; overrun and underrun detection is implemented by polling, so the severity of the problem cannot be determined by the frequency with which the above symbols alone are printed on the screen.

In fact if you have some old version of GNU radio you can check it

"uO" == usrp overrun.  
Printed out on line 94 of gr-usrp/src/usrp1_source_base.cc


The lower level host-side library code polls the FPGA at about 10 Hz, asking it if there have been any under or overruns.  The usrp_basic_rx::read and usrp_basic_tx::write methods return this info.



You can access the number of Rx overruns from python with


   x = u.noverruns()  # where u is an instance of usrp.source_c


Likewise, you can the number of Tx underuns with


   x = u.nunderruns()  # where u is an instance of usrp.sink_c


In both cases, a value greater than 2 indicates a problem.  Sometimes we see a couple of over/under-runs right at startup, which accounts for the 1 or 2.




3 comments:

  1. Hi, do you have any solution for aUaU ?
    I tried to run the simple FM rx on USRP1 with GNU radio 3.7.5
    and I had this problem.

    ReplyDelete
  2. Any solution for this?
    I was using USRPN210 throught gnu radio:


    [UHD] An unexpected exception was caught in a task loop.The task loop will now exit, things may not work.RuntimeError: link dead: timeout waiting for control packet ACK
    DDDDDDD

    ReplyDelete