aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-22 15:25:34 -0800
committerJosh Blum <josh@joshknows.com>2011-02-22 15:25:34 -0800
commit5b5606529035d139b5a0a07487fc7ad9dab4da65 (patch)
treea48ef9c1eac6f45711319eb0e810e08ff7cb6bf9 /host/lib/usrp/usrp2/usrp2_impl.cpp
parentfecb6365d8c547362f62ecfb36ea85140f1e9290 (diff)
downloaduhd-5b5606529035d139b5a0a07487fc7ad9dab4da65.tar.gz
uhd-5b5606529035d139b5a0a07487fc7ad9dab4da65.tar.bz2
uhd-5b5606529035d139b5a0a07487fc7ad9dab4da65.zip
usrp2: move buffer resize code and add rule for bsd/mac
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 6230ec41c..95031d211 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -141,7 +141,20 @@ static device_addrs_t usrp2_find(const device_addr_t &hint_){
/***********************************************************************
* Make
**********************************************************************/
-static device::sptr usrp2_make(const device_addr_t &device_addr){
+static device::sptr usrp2_make(const device_addr_t &_device_addr){
+ device_addr_t device_addr = _device_addr;
+
+ //setup the dsp transport hints (default to a large recv buff)
+ if (not device_addr.has_key("recv_buff_size")){
+ #if defined(UHD_PLATFORM_MACOS) || defined(UHD_PLATFORM_BSD)
+ //limit buffer resize on macos or it will error
+ device_addr["recv_buff_size"] = "1e6";
+ #elif defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)
+ //set to half-a-second of buffering at max rate
+ device_addr["recv_buff_size"] = "50e6";
+ #endif
+ }
+
return device::sptr(new usrp2_impl(device_addr));
}