Closed jxmx closed 4 months ago
My suggestion would be to add an rpt_time() function that behaves like time() but is based off of clock_gettime(). Then search/replace all calls to time() that are used for time comparison with rpt_time().
... and a good place for rpt_time() would be next to rpt_starttime()
Note: in .../asterisk/include/asterisk/time.h you will find ast_tsnow() that calls clock_gettime()
I have a pi3 and a pi4 with USB interfaces that seem to be affected by this--there is USB HID error messages.
I am trying the 'wait for time sync' change to the asterisk.service file in the meantime
Based on https://github.com/AllStarLink/ASL3/issues/76, the boot-time clock skew seems to cause chan_simpleusb to lock the PTT open until a restart of asterisk. Delaying asterisk start on boot until NTP has synchronized seems to resolve the issue but that is not a reliable fix. Within the code, comparisons are being made using
time(2)
when the likely resolution is to useclock_gettime(2)
with aCLOCK_MONOTONIC
type. That way, "wallclock" time changes in the OS don't affect the USB channel driver.