summaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-05 12:29:31 -0700
committerJosh Blum <josh@joshknows.com>2010-07-05 12:29:31 -0700
commit01e5f592d62e2193cc88081bd88765cae4708148 (patch)
tree2a55a89daa426b87dde8cfc99bb57c8362c8acec /host/lib/transport
parente057e6afde4b4be21f0e30ee6071599288b0e8a8 (diff)
downloaduhd-01e5f592d62e2193cc88081bd88765cae4708148.tar.gz
uhd-01e5f592d62e2193cc88081bd88765cae4708148.tar.bz2
uhd-01e5f592d62e2193cc88081bd88765cae4708148.zip
usrp2: increased transport buffer minimum size, and added warning
added more notes on buffer size to the manual pulled in some firmware fixes from the mimo work, just to have them in here
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/udp_zero_copy_asio.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/transport/udp_zero_copy_asio.cpp b/host/lib/transport/udp_zero_copy_asio.cpp
index c3c02707e..7f9292d24 100644
--- a/host/lib/transport/udp_zero_copy_asio.cpp
+++ b/host/lib/transport/udp_zero_copy_asio.cpp
@@ -27,7 +27,8 @@ using namespace uhd::transport;
/***********************************************************************
* Constants
**********************************************************************/
-static const size_t MIN_SOCK_BUFF_SIZE = size_t(100e3);
+//enough buffering for half a second of samples at full rate on usrp2
+static const size_t MIN_SOCK_BUFF_SIZE = size_t(sizeof(boost::uint32_t) * 25e6 * 0.5);
static const size_t MAX_DGRAM_SIZE = 1500; //assume max size on send and recv
static const double RECV_TIMEOUT = 0.1; //100 ms
@@ -159,6 +160,12 @@ template<typename Opt> static void resize_buff_helper(
//otherwise, ensure that the buffer is at least the minimum size
else if (udp_trans->get_buff_size<Opt>() < MIN_SOCK_BUFF_SIZE){
resize_buff_helper<Opt>(udp_trans, MIN_SOCK_BUFF_SIZE, name);
+ if (udp_trans->get_buff_size<Opt>() < MIN_SOCK_BUFF_SIZE){
+ std::cerr << boost::format(
+ "Warning: the %s buffer size is smaller than the recommended size of %d bytes.\n"
+ " See the USRP2 application notes on buffer resizing."
+ ) % name % MIN_SOCK_BUFF_SIZE << std::endl;
+ }
}
}