discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] UHD buffer error


From: Josh Blum
Subject: Re: [Discuss-gnuradio] UHD buffer error
Date: Wed, 19 Dec 2012 12:30:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0


On 12/19/2012 06:04 AM, Anton Blad wrote:
> Hi list,
> 
> I am using a USRP1 with UHD directly in C++, and several times I got the
> following error within a few seconds after starting my application:
> 
> UHD Error:
>     The receive packet handler caught an exception.
>     recv buffer smaller than vrt packet offset
> 
> I haven't seen this error before, and after rebooting the USRP it went
> away. Still, I would like to know what the problem was.
> 
> Essentially, my USRP code looks like this:
> 
> complex<float> buffer[SIZE];
> int nread = 0;
> 
> while(nread < SIZE)
> {
>     nread += streamer->recv(rx_streamer::buffs_type(buffer+nread,
> SIZE-nread, rx_meta);
> }
> 

Whats happening here? Is it getting stuck in the while loop?

Here is an example use case of recv in gr-uhd source block:
http://gnuradio.org/cgit/gnuradio.git/tree/gr-uhd/lib/gr_uhd_usrp_source.cc#n331

> I tried with SIZE=4096 and SIZE=65536 before rebooting the USRP. Could
> there be a problem with this implementation, for example if recv returns
> a value close to SIZE so that the next call is made with a small buffer

Basically, the rx streamer will always try to write everything it can
from internal buffers into your buffer. If there is not room, partial
buffers are saved for the next call.

-josh



reply via email to

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