discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] usrp1_source_base, usrp_standard_rx::read, and 51


From: Johnathan Corgan
Subject: Re: [Discuss-gnuradio] usrp1_source_base, usrp_standard_rx::read, and 512 nbytes
Date: Thu, 11 Dec 2008 07:09:11 -0800

On Wed, 2008-12-10 at 12:37 -0800, Chris Stankevitz wrote:
> usrp1_source_base.cc has this chunk of code that reads from 
> usrp_standard_rx:
> 
> //----------
> while (output_index < noutput_items)
> {
>    int nbytes = ninput_bytes_reqd_for_noutput_items (
>      noutput_items - output_index);
> 
>    nbytes = std::min (nbytes, BUFSIZE);
> 
>    int result_nbytes = d_usrp->read (buf, nbytes, &overrun);
> //----------
> 
> Question: What guarantees that nbytes is a multiple of 512?

In the usrp1_source_base constructor, a call is made to
set_output_multiple(n), which tells the scheduler to only call the work
function to produce a multiple of n samples: 
                                                                                
                                                                                
                            
http://gnuradio.org/trac/browser/gnuradio/trunk/gr-usrp/src/usrp1_source_base.cc#L63

-Johnathan






reply via email to

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