Clock Unsynchronized

hello
i have device with android running. ntpd and ntpq is available in device and i have configure ntp.conf file with my local linux machine. whenever i start ntpd -d it shows kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized. mine time is synchronizes as per date or rtc but after hour it reset to an hwclock and then driftfile is no more available, i had investigate a bit this and found it might be ntp_adjtime() issue and frequency fail to set, any idea about clock Unsynchronized error. for more idea refer below logs

25 Nov 08:51:45 ntpd[1693]: Listen and drop on 0 v6wildcard [::]:123
25 Nov 08:51:45 ntpd[1693]: Listen and drop on 1 v4wildcard 0.0.0.0:123
25 Nov 08:51:45 ntpd[1693]: Listen normally on 2 eth0 [fe80::691:62ff:fec1:1004%4]:123
25 Nov 08:51:45 ntpd[1693]: Listen normally on 3 dummy0 [fe80::bc31:3ff:fe9e:5230%3]:123
25 Nov 08:51:45 ntpd[1693]: Listen normally on 4 lo [::1]:123
25 Nov 08:51:45 ntpd[1693]: Listen normally on 5 eth0 10.100.134.35:123
25 Nov 08:51:45 ntpd[1693]: Listen normally on 6 lo 127.0.0.1:123
25 Nov 08:51:45 ntpd[1693]: Listening on routing socket on fd #27 for interface updates
25 Nov 08:51:45 ntpd[1693]: Listen for broadcasts to 10.100.135.255 on interface #5 eth0
25 Nov 08:51:45 ntpd[1693]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
25 Nov 08:51:45 ntpd[1693]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
1 Jan 00:06:22 ntpd[1677]: Listen and drop on 0 v6wildcard [::]:123
1 Jan 00:06:22 ntpd[1677]: Listen and drop on 1 v4wildcard 0.0.0.0:123
1 Jan 00:06:22 ntpd[1677]: Listen normally on 2 eth0 [fe80::691:62ff:fec1:1004%4]:123
1 Jan 00:06:22 ntpd[1677]: Listen normally on 3 dummy0 [fe80::b473:95ff:fe66:602%3]:123
1 Jan 00:06:22 ntpd[1677]: Listen normally on 4 lo [::1]:123
1 Jan 00:06:22 ntpd[1677]: Listen normally on 5 eth0 10.100.134.35:123
1 Jan 00:06:22 ntpd[1677]: Listen normally on 6 lo 127.0.0.1:123
1 Jan 00:06:22 ntpd[1677]: Listening on routing socket on fd #27 for interface updates
1 Jan 00:06:22 ntpd[1677]: Listen for broadcasts to 10.100.135.255 on interface #5 eth0
1 Jan 00:06:22 ntpd[1677]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
** 1 Jan 00:06:22 ntpd[1677]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized**
25 Nov 09:01:05 ntpd[1677]: ntpd exiting on signal 15 (Terminated)
25 Nov 09:01:05 ntpd[1677]: 10.100.134.28 local addr 10.100.134.35 ->
25 Nov 09:01:10 ntpd[1771]: Listen and drop on 0 v6wildcard [::]:123
25 Nov 09:01:10 ntpd[1771]: Listen and drop on 1 v4wildcard 0.0.0.0:123
25 Nov 09:01:10 ntpd[1771]: Listen normally on 2 eth0 [fe80::691:62ff:fec1:1004%4]:123
25 Nov 09:01:10 ntpd[1771]: Listen normally on 3 dummy0 [fe80::b473:95ff:fe66:602%3]:123
25 Nov 09:01:10 ntpd[1771]: Listen normally on 4 lo [::1]:123
25 Nov 09:01:10 ntpd[1771]: Listen normally on 5 eth0 10.100.134.35:123
25 Nov 09:01:10 ntpd[1771]: Listen normally on 6 lo 127.0.0.1:123
25 Nov 09:01:10 ntpd[1771]: Listening on routing socket on fd #27 for interface updates
25 Nov 09:01:10 ntpd[1771]: Listen for broadcasts to 10.100.135.255 on interface #5 eth0
25 Nov 09:01:10 ntpd[1771]: kernel reports TIME_ERROR: 0x4041: Clock Unsynchronized
25 Nov 09:01:10 ntpd[1771]: kernel reports TIME_ERROR: 0x4041: Clock Unsynchronized
25 Nov 09:09:54 ntpd[1771]: kernel reports TIME_ERROR: 0x4041: Clock Unsynchronized

thank you in advance

Googling the error message showed some kernel config issues. Since you are running ntpd on an Android device, its kernel timer might be configured to tick slowly (to save battery), not suitable to run ntpd directly. Some threads suggested:

sysctl -w kern.timecounter.hardware=ACPI-fast

to switch the kernel timer into precise operation. Maybe you can try this first…

hello @alica
we don’t have battery for our device and so i think this not suppose to affect, and could you please elaborate more about the flag kern.timecounter.hardwar in kernel source where it define. so we can investigate more on it.

thank you