Index: gr-usrp/src/usrp1_source_base.cc =================================================================== --- gr-usrp/src/usrp1_source_base.cc (revision 3982) +++ gr-usrp/src/usrp1_source_base.cc (working copy) @@ -29,7 +29,6 @@ #include #include -static const int OUTPUT_MULTIPLE_BYTES = 4 * 1024; usrp1_source_base::usrp1_source_base (const std::string &name, gr_io_signature_sptr output_signature, @@ -58,9 +57,9 @@ throw std::runtime_error ("can't open usrp1"); // All calls to d_usrp->read must be multiples of 512 bytes. - // We jack this up to 4k to reduce overhead. + // We set this to match the fusb block size - set_output_multiple (OUTPUT_MULTIPLE_BYTES / output_signature->sizeof_stream_item (0)); + set_output_multiple (d_usrp->block_size() / output_signature->sizeof_stream_item(0)); } usrp1_source_base::~usrp1_source_base () @@ -91,13 +90,19 @@ gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - static const int BUFSIZE = 4 * OUTPUT_MULTIPLE_BYTES; + static const int BUFSIZE = 64 * 1024; unsigned char buf[BUFSIZE]; int output_index = 0; int output_items_produced; int bytes_read; bool overrun; + // To minimize rx latency, never return more than 1 fusb block_size worth of samples. + // FIXME: A better fix would be to return the maximum we could without blocking, + // but the current interface doesn't allow us to do that. + + noutput_items = std::max(output_multiple(), noutput_items); + while (output_index < noutput_items){ int nbytes = ninput_bytes_reqd_for_noutput_items (noutput_items - output_index); nbytes = std::min (nbytes, BUFSIZE);