summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-07-14 20:36:48 +0000
committerPhilip Balister <philip@opensdr.com>2010-07-14 20:36:48 +0000
commit87428bf6e1c5fcf623595063921277f9827a919a (patch)
treefbd2855b45ff24bead6342375f87fe00abb20a05 /host/lib
parent9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e (diff)
parent959669e383c75fdcbd11091466516bd5af66cfb5 (diff)
downloaduhd-87428bf6e1c5fcf623595063921277f9827a919a.tar.gz
uhd-87428bf6e1c5fcf623595063921277f9827a919a.tar.bz2
uhd-87428bf6e1c5fcf623595063921277f9827a919a.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/transport/udp_zero_copy_asio.cpp3
-rw-r--r--host/lib/transport/vrt_packet_handler.hpp3
-rw-r--r--host/lib/usrp/mimo_usrp.cpp19
3 files changed, 21 insertions, 4 deletions
diff --git a/host/lib/transport/udp_zero_copy_asio.cpp b/host/lib/transport/udp_zero_copy_asio.cpp
index 98451f188..bfbcf62d8 100644
--- a/host/lib/transport/udp_zero_copy_asio.cpp
+++ b/host/lib/transport/udp_zero_copy_asio.cpp
@@ -161,10 +161,13 @@ template<typename Opt> static void resize_buff_helper(
) % name % MIN_SOCK_BUFF_SIZE << std::endl;
}
+ //only enable on platforms that are happy with the large buffer resize
+ #if defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)
//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);
}
+ #endif /*defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)*/
}
udp_zero_copy::sptr udp_zero_copy::make(
diff --git a/host/lib/transport/vrt_packet_handler.hpp b/host/lib/transport/vrt_packet_handler.hpp
index 6623957ac..fdcff24b8 100644
--- a/host/lib/transport/vrt_packet_handler.hpp
+++ b/host/lib/transport/vrt_packet_handler.hpp
@@ -146,6 +146,8 @@ namespace vrt_packet_handler{
const handle_overrun_t &handle_overrun,
size_t vrt_header_offset_words32
){
+ metadata.error_code = uhd::rx_metadata_t::ERROR_CODE_NONE;
+
//perform a receive if no rx data is waiting to be copied
if (state.size_of_copy_buffs == 0){
state.fragment_offset_in_samps = 0;
@@ -171,7 +173,6 @@ namespace vrt_packet_handler{
metadata.has_time_spec = false;
metadata.start_of_burst = false;
metadata.end_of_burst = false;
- metadata.error_code = uhd::rx_metadata_t::ERROR_CODE_NONE;
}
//extract the number of samples available to copy
diff --git a/host/lib/usrp/mimo_usrp.cpp b/host/lib/usrp/mimo_usrp.cpp
index fd8225074..b40f98226 100644
--- a/host/lib/usrp/mimo_usrp.cpp
+++ b/host/lib/usrp/mimo_usrp.cpp
@@ -125,20 +125,33 @@ public:
void set_time_unknown_pps(const time_spec_t &time_spec){
std::cout << "Set time with unknown pps edge:" << std::endl;
- std::cout << " 1) set times next pps (race condition)" << std::endl;
+ std::cout << " 1) set times next pps (race condition)" << std::endl;
set_time_next_pps(time_spec);
boost::this_thread::sleep(boost::posix_time::seconds(1));
- std::cout << " 2) catch seconds rollover at pps edge" << std::endl;
+ std::cout << " 2) catch seconds rollover at pps edge" << std::endl;
time_t last_secs = 0, curr_secs = 0;
while(curr_secs == last_secs){
last_secs = curr_secs;
curr_secs = get_time_now().get_full_secs();
}
- std::cout << " 3) set times next pps (synchronously)" << std::endl;
+ std::cout << " 3) set times next pps (synchronously)" << std::endl;
set_time_next_pps(time_spec);
boost::this_thread::sleep(boost::posix_time::seconds(1));
+
+ //verify that the time registers are read to be within a few RTT
+ for (size_t i = 1; i < get_num_channels(); i++){
+ time_spec_t time_0 = _mboards.front()[MBOARD_PROP_TIME_NOW].as<time_spec_t>();
+ time_spec_t time_i = _mboards.at(i)[MBOARD_PROP_TIME_NOW].as<time_spec_t>();
+ if (time_i < time_0 or (time_i - time_0) > time_spec_t(0.01)){ //10 ms: greater than RTT but not too big
+ std::cerr << boost::format(
+ "Error: time deviation between board %d and board 0.\n"
+ " Board 0 time is %f seconds.\n"
+ " Board %d time is %f seconds.\n"
+ ) % i % time_0.get_real_secs() % i % time_i.get_real_secs() << std::endl;
+ }
+ }
}
void issue_stream_cmd(const stream_cmd_t &stream_cmd){