Open mmatthebi opened 2 years ago
As a quick follow-up, this might help to debug:
$ cat t.cpp
$ cat t.cpp
#include <iostream>
int main() {
float f = 0.3;
double d = 0.3;
double d2 = f;
std::cout << (d == d2) << std::endl;
}
$ g++ t.cpp && ./a.out
0
which shows that in the conversion something happens. And this little difference makes UHD misinterpret time_spec in some way which I cannot debug.
Issue Description
I found a weird behaviour in setting the time_spec for a burst transmission in the future. I modified the tx_timed_samples.cpp example, where i changed the type of
seconds_in_future
fromdouble
tofloat
. Moreover, I added some more debug output. I attach the source code below.Setup
If I compile this the program on the USRP X410 with UHD v4.2.0.0 freshly installed with
Expected Behaviour
and run as such:
Everything is as expected.
Erroneous behaviour
However, If I run with a nsecs value which is not exactly representable in floating point (like 0.3), The output becomes erronous (there are many L in the console, and I get many async error code 8 (which is LATE):
if I change back the type of
seconds_in_future
todouble
and also in the options parser line, the error is gone and evreything works as expected.I know that 0.3seconds cannot be fully represented in both double adn float. However, I expect that the casting into double would not create any problems as long as the time is clearly in the future. I do not expect to see these "LATE" messages in the console, even though I supply a float (also, the compiler does not throw a warning regardign a lossy conversion).
Source code