On 8/19/19 6:52 PM, Neel Pandeya wrote:
Hello Jason:
Thanks for all the detailed feedback! No worries about not having a
stand-alone reproducing program at the moment. Could you please try
using the head of the "UHD-3.14" branch? We just tagged v3.14.1.1-rc1
with some bug fixes, which we think should address the issue. Please
let me know your results running with that, and we'll go from there.
--Neel Pandeya
Neel,
I saw the same behavior with the UHD-3.14 branch. I was able to take the
time to put together a self-contained reproducer; see the attached
source file. It's just a simple C++ program that initializes the USRP,
streams a few blocks of data in, and checks the timestamps of
consecutive blocks for continuity. When I run it, I see the following
output:
[jasonr@host:~/test_uhd]$ LD_LIBRARY_PATH=~/git/sceptre/deps/lib ./test_uhd
[INFO] [UHD] linux; GNU C++ version 7.4.0; Boost_106900;
UHD_3.14.1.HEAD-0-g98c7c986
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 8000 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
[INFO] [GPS] Found an internal GPSDO: LC_XO, Firmware Rev 0.929a
[INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000000)
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1303 MB/s)
[INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1312 MB/s)
[INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000000001)
[INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000000001)
[INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000)
[INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000)
[INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000000)
[INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000000)
[WARNING] [X300] Cannot update master clock rate! X300 Series does not
allow changing the clock rate during runtime.
Block 1: 16384 samples @ 100 MSPS
Timestamp: 1.96557
Block 2: 16384 samples @ 100 MSPS
Timestamp: 1.9659
Last timestamp: 1.96557
Difference: 0.00032352
Expected difference: 0.00016384
Block 3: 16384 samples @ 100 MSPS
Timestamp: 1.96622
Last timestamp: 1.9659
Difference: 0.00032352
Expected difference: 0.00016384
Block 4: 16384 samples @ 100 MSPS
Timestamp: 1.96654
Last timestamp: 1.96622
Difference: 0.00032352
Expected difference: 0.00016384
Block 5: 16384 samples @ 100 MSPS
Timestamp: 1.96687
Last timestamp: 1.96654
Difference: 0.00032352
Expected difference: 0.00016384
Block 6: 16384 samples @ 100 MSPS
Timestamp: 1.96721
Last timestamp: 1.96687
Difference: 0.00034348
Expected difference: 0.00016384
Block 7: 16384 samples @ 100 MSPS
Timestamp: 1.96753
Last timestamp: 1.96721
Difference: 0.00032352
Expected difference: 0.00016384
Block 8: 16384 samples @ 100 MSPS
Timestamp: 1.96786
Last timestamp: 1.96753
Difference: 0.00032352
Expected difference: 0.00016384
Block 9: 16384 samples @ 100 MSPS
Timestamp: 1.96818
Last timestamp: 1.96786
Difference: 0.00032352
Expected difference: 0.00016384
Block 10: 16384 samples @ 100 MSPS
Timestamp: 1.96851
Last timestamp: 1.96818
Difference: 0.00032352
Expected difference: 0.00016384
[jasonr@gauss:~/git/sceptre/test/test_uhd]$
Thanks for your help.
Jason
#include <uhd/usrp/multi_usrp.hpp>
int main()
{
std::string args = "type=x300, addr=192.168.40.2, recv_buff_size=100000000";
std::string clock_source = "internal";
std::string time_source = "internal";
std::string subdev = "A:0";
double rate = 100e6;
double freq = 100e6;
int tl = 16384;
double timeout = 5.0;
uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);
usrp->set_clock_source(clock_source);
usrp->set_time_source(time_source);
if (!subdev.empty()) usrp->set_rx_subdev_spec(subdev);
usrp->set_rx_rate(rate);
usrp->set_rx_freq(freq, 0);
uhd::stream_args_t stream_args("sc16");
stream_args.channels.push_back(0);
uhd::rx_streamer::sptr streamer = usrp->get_rx_stream(stream_args);
std::vector<std::complex<int16_t> > buf;
buf.resize(tl);
std::vector<std::complex<int16_t> *> ptrs;
ptrs.push_back(&buf[0]);
uhd::stream_cmd_t stream_cmd( uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
uhd::time_spec_t cmd_time = usrp->get_time_now() + uhd::time_spec_t(0.1);
stream_cmd.num_samps = 0;
stream_cmd.stream_now = false;
stream_cmd.time_spec = cmd_time;
streamer->issue_stream_cmd(stream_cmd);
uhd::rx_metadata_t last_md;
for (int i = 0; i < 10; ++i)
{
uhd::rx_metadata_t md;
size_t n = streamer->recv(ptrs, tl, md, timeout);
std::cout << "Block " << i + 1 << ": " << n << " samples @ " << rate / 1e6 << " MSPS" << std::endl;
std::cout << " Timestamp: " << md.time_spec.get_real_secs() << std::endl;
if (i)
{
std::cout << " Last timestamp: " << last_md.time_spec.get_real_secs() << std::endl;
std::cout << " Difference: " << (md.time_spec - last_md.time_spec).get_real_secs() << std::endl;
std::cout << " Expected difference: " << n / rate << std::endl;
}
last_md = md;
}
stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;
streamer->issue_stream_cmd(stream_cmd);
}
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com