While I would not expect sleep to fail consistently, it *can* return a non zero 
value when not sleeping for the entire time.

Try checking the return value for success.  Its not likely this is the cause if 
it happens every time, but error checking is your friend :)

-----Original Message-----
From: USRP-users <usrp-users-boun...@lists.ettus.com> On Behalf Of Fabian 
Schwartau via USRP-users
Sent: Tuesday, April 23, 2019 9:47 AM
To: usrp-users <usrp-users@lists.ettus.com>
Subject: [USRP-users] USRPs time wrong by factor of two

*** WARNING ***
EXTERNAL EMAIL -- This message originates from outside our organization.


Hi everyone,

I just found a very strage bug and would like to confirm that this is a bug and 
if someone can explain/fix this.
I read the time from the USRP using get_time_now() and do a lot of stuff with 
it. Mainly to time commands like frequency hopping and starting of streams. I 
noticed that the time in the USRP seemed to run slower than expected, actually 
by a factor of two.
Please find a program attached that demonstrates this effect. It prints the 
internal USRP time roughly every second (using sleep) but the USRP time 
increments only by 0.5 seconds in each step. What is going on?

The program can be compiled using:
g++ -std=c++14 -O2 main.cpp -luhd -lboost_system -o main

I am using a single (or multiple - does not have an effect) X310 with two 
TwinRX. UHD is "linux; GNU C++ version 5.5.0 20171010; Boost_105800; 
UHD_3.15.0.git-89-gf93c5227" from yesterday. FPGA image is also from yesterday 
using the download script - where can I find the version number? I am running 
an up-to-date Ubuntu 16.04.
--
--------------------------------------------------
M.-Sc. Fabian Schwartau
Technische Universität Braunschweig
Institut für Hochfrequenztechnik
Schleinitzstr. 22
38106 Braunschweig
Germany

Tel.:   +49-(0)531-391-2017
Fax:    +49-(0)531-391-2045
Email:  fabian.schwar...@ihf.tu-bs.de
WWW:    http://www.tu-braunschweig.de/ihf
--------------------------------------------------

_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to