summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/stream.hpp5
-rw-r--r--host/lib/usrp/b100/io_impl.cpp3
-rw-r--r--host/lib/usrp/e100/io_impl.cpp3
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp3
4 files changed, 11 insertions, 3 deletions
diff --git a/host/include/uhd/stream.hpp b/host/include/uhd/stream.hpp
index b41c1733d..352f63e4e 100644
--- a/host/include/uhd/stream.hpp
+++ b/host/include/uhd/stream.hpp
@@ -88,6 +88,11 @@ struct UHD_API stream_args_t{
* In the "next_burst" mode, the DSP drops incoming packets until a new burst is started.
* In the "next_packet" mode, the DSP starts transmitting again at the next packet.
*
+ * - spp: (samples per packet) controls the size of RX packets.
+ * When not specified, the packets are always maximum frame size.
+ * Users should specify this option to request smaller than default
+ * packets, probably with the intention of reducing packet latency.
+ *
* The following are not implemented, but are listed for conceptual purposes:
* - function: magnitude or phase/magnitude
* - units: numeric units like counts or dBm
diff --git a/host/lib/usrp/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp
index 692ede6d5..494d5d123 100644
--- a/host/lib/usrp/b100/io_impl.cpp
+++ b/host/lib/usrp/b100/io_impl.cpp
@@ -211,7 +211,8 @@ rx_streamer::sptr b100_impl::get_rx_stream(const uhd::stream_args_t &args_){
- sizeof(vrt::if_packet_info_t().cid) //no class id ever used
;
const size_t bpp = 2048 - hdr_size; //limited by FPGA pkt buffer size
- const size_t spp = bpp/convert::get_bytes_per_item(args.otw_format);
+ const size_t bpi = convert::get_bytes_per_item(args.otw_format);
+ const size_t spp = unsigned(args.args.cast<double>("spp", bpp/bpi));
//make the new streamer given the samples per packet
boost::shared_ptr<sph::recv_packet_streamer> my_streamer = boost::make_shared<sph::recv_packet_streamer>(spp);
diff --git a/host/lib/usrp/e100/io_impl.cpp b/host/lib/usrp/e100/io_impl.cpp
index 92905526c..441e32a8d 100644
--- a/host/lib/usrp/e100/io_impl.cpp
+++ b/host/lib/usrp/e100/io_impl.cpp
@@ -287,7 +287,8 @@ rx_streamer::sptr e100_impl::get_rx_stream(const uhd::stream_args_t &args_){
- sizeof(vrt::if_packet_info_t().cid) //no class id ever used
;
const size_t bpp = _data_transport->get_recv_frame_size() - hdr_size;
- const size_t spp = bpp/convert::get_bytes_per_item(args.otw_format);
+ const size_t bpi = convert::get_bytes_per_item(args.otw_format);
+ const size_t spp = unsigned(args.args.cast<double>("spp", bpp/bpi));
//make the new streamer given the samples per packet
boost::shared_ptr<sph::recv_packet_streamer> my_streamer = boost::make_shared<sph::recv_packet_streamer>(spp);
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index fd81071fb..e3fa46920 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -389,7 +389,8 @@ rx_streamer::sptr usrp2_impl::get_rx_stream(const uhd::stream_args_t &args_){
- sizeof(vrt::if_packet_info_t().cid) //no class id ever used
;
const size_t bpp = _mbc[_mbc.keys().front()].rx_dsp_xports[0]->get_recv_frame_size() - hdr_size;
- const size_t spp = bpp/convert::get_bytes_per_item(args.otw_format);
+ const size_t bpi = convert::get_bytes_per_item(args.otw_format);
+ const size_t spp = unsigned(args.args.cast<double>("spp", bpp/bpi));
//make the new streamer given the samples per packet
boost::shared_ptr<sph::recv_packet_streamer> my_streamer = boost::make_shared<sph::recv_packet_streamer>(spp);