Re: fxls8962af: RTC and NTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 9 Jan 2023 08:54:05 +0100
Sean Nyekjaer <sean@xxxxxxxxxx> wrote:

> Hi Jonathan and list,
> 
> We are getting some weird timestamps (with fxls8962af) in the iio 
> buffers when time is set back by NTP.
> 
> Here I have dumped old_timestamp, timestamp from the 
> fxls8962af_fifo_flush():
> old_timestamp 1673008488434717043, timestamp 1673008489457042043
> *old_timestamp 1673008489457042043, timestamp 1673008485198504719*
> old_timestamp 1673008485198504719, timestamp 1673008486220571510
> 
> Time is set back in the middle data set, so the sample timestamp looks like:
> tstamp0 3091988802491735451
> tstamp1 4510969115526428858
> tstamp2 5929949428561122265
> tstamp3 7348929741595815672
> tstamp4 8767910054630509079
> tstamp5 -8259853706044349130
> tstamp6 -6840873393009655723
> tstamp7 -5421893079974962316
> tstamp8 -4002912766940268909
> tstamp9 -2583932453905575502
> tstamp10 -1164952140870882095
> tstamp11 254028172163811312
> tstamp12 1673008485198504719
> 
> Possible solutions?
> Could we store the sample time from the last collected data set?
> And use that if old_timestamp > timestamp?

Ah. I guess this is the timestamp interpolation code going wrong.
It should be possible to make that code 'sort of cope' with negatives
though it would be a slightly nasty heuristic.
You would make it go backwards a little for each fifo entry..

> 
> Or do you have any other idea's?

This mess is a side effect of me picking a silly default clock
a long time back (can't fix that as it's ABI...)

We could smooth it in the driver, but if you have
the option, I'd just change the default clock from userspace.
Take a look at current_timestamp_clock in sysfs.
You should be fine with "monotonic" 

> 
> /Sean




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux