summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
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
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')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp15
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp15
2 files changed, 16 insertions, 14 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index b8849f65b..34a2b7c69 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -64,27 +64,16 @@ usrp2_mboard_impl::usrp2_mboard_impl(
device_addr["addr"], boost::lexical_cast<std::string>(USRP2_UDP_CTRL_PORT)
)))
{
-
- //setup the dsp transport hints (default to a large recv buff)
- device_addr_t dsp_xport_hints = device_addr;
- if (not dsp_xport_hints.has_key("recv_buff_size")){
- //only enable on platforms that are happy with the large buffer resize
- #if defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)
- //set to half-a-second of buffering at max rate
- dsp_xport_hints["recv_buff_size"] = "50e6";
- #endif /*defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)*/
- }
-
//construct transports for dsp and async errors
std::cout << "Making transport for DSP0..." << std::endl;
device.dsp_xports.push_back(udp_zero_copy::make(
- device_addr["addr"], boost::lexical_cast<std::string>(USRP2_UDP_DSP0_PORT), dsp_xport_hints
+ device_addr["addr"], boost::lexical_cast<std::string>(USRP2_UDP_DSP0_PORT), device_addr
));
init_xport(device.dsp_xports.back());
std::cout << "Making transport for DSP1..." << std::endl;
device.dsp_xports.push_back(udp_zero_copy::make(
- device_addr["addr"], boost::lexical_cast<std::string>(USRP2_UDP_DSP1_PORT), dsp_xport_hints
+ device_addr["addr"], boost::lexical_cast<std::string>(USRP2_UDP_DSP1_PORT), device_addr
));
init_xport(device.dsp_xports.back());
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));
}