Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: 9.10 system clock runs slow

  1. #1
    Join Date
    Jul 2009
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question 9.10 system clock runs slow / How to correct kernel's tick duration

    Hello. The problem is that the clock stays back about one hour every day. When I reboot having an Internet connection available the clock synchronizes and shows the right time but even after an hour you can see that it is some minutes late.

    On the same laptop I use Hardy Heron and there is no such problem. As so it is not a hardware problem.

    Some time ago I tried out the Eee Applet and an overclocking option it has. I think that it has something to do with my problem. I reverted any choice I did using the Eee Applet but the problem still remains.

    I would be grateful if somebody could give me a hint on how I can fix this problem.
    I promise that I'll do my best to pay it forward to the community.

    -------------------------------------------------------------------------EDIT-------------------------------------------------------------------------------------

    I googled it a little and found several different approaches for similar problems.

    First of all, I had to make sure that my hardware clock runs correctly (although I already knew this since there is no problem when I use Hardy)
    Code:
    ~$ sudo hwclock
    Thu 10 Dec 2009 23:10:22 EET  -0.204852 seconds
    while the clock on my panel shows 22:40...

    One idea proposed (here by psb6m) is to make the kernel use another timer.

    I ran into this problem and found the solution with a little research. It is a bug in the kernel, and the bug is fixed in the next kernel release--but Ubuntu people who have experienced the problem will have to wait till October. In the meantime, do this:

    1. The kernel can use one of several timers. to check which yours is using: Open a terminal and become root (sudo -s). Type

    Code:
          cat /sys/devices/system/clocksource/clocksource0/current_clocksource
    The result identifies the clocksource that has gone wrong.

    2. Now find out what other clocksources are available:

    Code:
          cat /sys/devices/system/clocksource/clocksource0/available_clocksource
    You'll see a list of words (e.g. acpi_pm hpet jiffies).

    3. Test an alternative clocksource, e.g.

    Code:
       echo "hpet"> /sys/devices/system/clocksource/clocksource0/current_clocksource
    You should notice an immediate speedup in the system clock. If so, go on:

    4. We'll add a kernel parameter to make the kernel use a workable clocksource.

    Code:
        cd /boot/grub
    nano menu.lst
    Scroll down to the first menu item (a group of lines beginning "title root kernel" etc.). At the end of the "kernel" line (which shows the command line that starts the kernel), add a "clocksource" parameter specifying the clocksource that worked for you in step 3 above. For example, change

    Code:
         kernel  /vmlinuz-2.6.20-16-lowlatency root=UUID=030313ac-ece9-49bd-8c39-
    5ff6323c34a7 ro single
    to


    Code:
        kernel  /vmlinuz-2.6.20-16-lowlatency root=UUID=030313ac-ece9-49bd-8c39-
    5ff6323c34a7 ro single clocksource=hpet
    5. Save the file and
    Code:
        reboot
    Everything should work correctly now!
    I wanted to find a way to adjust the timer that is in use now, to have the proper tick duration that would make it run more accurately.

    I found this where DomIncollingo said:
    [...]I noticed that the default value for adtimex tick was something like 7979. (Can't imagine how that happened!) I would have expected tick to be set to something like 10000, since I thought that in the pre-tickless kernel there were 10000 ticks per second. So that might explain why the clock was running so slow. I set ticks to 10001, and frequency to -3306000, both in the /etc/default/adtimex file and by running sudo adjtimex. So hopefully the clock will keep fairly accurate time now.
    So, I checked and realized that adjtimex is not installed on my system and as so the files and directories DomIncollingo referred are also missing.

    From Synaptic:
    This package provides a utility to manipulate the kernel time
    variables. For a machine connected to the Internet, or equipped with
    a precision oscillator or radio clock, the best way to keep the
    system clock accurate is using NTP (Network Time Protocol). However,
    for a standalone or intermittently connected machine, you may use
    adjtimex instead to at least correct for systematic drift. It can
    optionally adjust the system clock using the CMOS clock as a
    reference, and can log times for long-term estimation of drift rates.
    Now, maybe I'll give it a try with adjtimex. I haven't found yet how to use it so any information, you people can provide, it would be surely helpful.
    Last edited by RodGer GR; December 11th, 2009 at 02:11 AM.

  2. #2
    Join Date
    Sep 2008
    Location
    Massachusetts, U.S.A.
    Beans
    7
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: 9.10 system clock runs slow

    I do not know for sure but your problem could be related to the fact that you had overclocking enabled when you installed Karmic. Did you have overclocking enabled when you did previous Ubuntu installs of older versions? If it is a new non-tailored install you could just try reinstalling it with overclocking disabled (Check also in your BIOS setup screens). At any rate, good luck!

  3. #3
    Join Date
    Jul 2009
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 9.10 system clock runs slow

    Thanks a lot JDG. The truth is that didn't have overclocking enabled when I installed Karmic and for a certain period I had no issue at all. Everything started after overclocking using the Eee applet (which I initially installed just to make a card reader accessible). Although I reverted any overclocking, the problem continues.

  4. #4
    Join Date
    Sep 2009
    Location
    Pennsylvania, USA
    Beans
    523
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: 9.10 system clock runs slow

    Might be the chips on the computer running slow. Check the time in the BIOS of your computer. Set it there, and see if that helps.

  5. #5
    Join Date
    Jul 2009
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 9.10 system clock runs slow

    I googled it a little and found several different approaches for similar problems.

    First of all, I had to make sure that my hardware clock runs correctly (although I already knew this since there is no problem when I use Hardy)
    Code:
    ~$ sudo hwclock
    Thu 10 Dec 2009 23:10:22 EET  -0.204852 seconds
    while the clock on my panel shows 22:40...

    One idea proposed (here by psb6m) is to make the kernel use another timer.

    I ran into this problem and found the solution with a little research. It is a bug in the kernel, and the bug is fixed in the next kernel release--but Ubuntu people who have experienced the problem will have to wait till October. In the meantime, do this:

    1. The kernel can use one of several timers. to check which yours is using: Open a terminal and become root (sudo -s). Type

    Code:
          cat /sys/devices/system/clocksource/clocksource0/current_clocksource
    The result identifies the clocksource that has gone wrong.

    2. Now find out what other clocksources are available:

    Code:
          cat /sys/devices/system/clocksource/clocksource0/available_clocksource
    You'll see a list of words (e.g. acpi_pm hpet jiffies).

    3. Test an alternative clocksource, e.g.

    Code:
       echo "hpet"> /sys/devices/system/clocksource/clocksource0/current_clocksource
    You should notice an immediate speedup in the system clock. If so, go on:

    4. We'll add a kernel parameter to make the kernel use a workable clocksource.

    Code:
        cd /boot/grub
    nano menu.lst
    Scroll down to the first menu item (a group of lines beginning "title root kernel" etc.). At the end of the "kernel" line (which shows the command line that starts the kernel), add a "clocksource" parameter specifying the clocksource that worked for you in step 3 above. For example, change

    Code:
         kernel  /vmlinuz-2.6.20-16-lowlatency root=UUID=030313ac-ece9-49bd-8c39-
    5ff6323c34a7 ro single
    to


    Code:
        kernel  /vmlinuz-2.6.20-16-lowlatency root=UUID=030313ac-ece9-49bd-8c39-
    5ff6323c34a7 ro single clocksource=hpet
    5. Save the file and
    Code:
        reboot
    Everything should work correctly now!
    I wanted to find a way to regulate the timer that is in use now, to have the proper tick duration that would make it run more accurately.

    I found this where DomIncollingo said:
    [...]I noticed that the default value for adtimex tick was something like 7979. (Can't imagine how that happened!) I would have expected tick to be set to something like 10000, since I thought that in the pre-tickless kernel there were 10000 ticks per second. So that might explain why the clock was running so slow. I set ticks to 10001, and frequency to -3306000, both in the /etc/default/adtimex file and by running sudo adjtimex. So hopefully the clock will keep fairly accurate time now.
    So, I checked and realized that adjtimex is not installed on my system and as so the files and directories DomIncollingo referred are also missing.

    From Synaptic:
    This package provides a utility to manipulate the kernel time
    variables. For a machine connected to the Internet, or equipped with
    a precision oscillator or radio clock, the best way to keep the
    system clock accurate is using NTP (Network Time Protocol). However,
    for a standalone or intermittently connected machine, you may use
    adjtimex instead to at least correct for systematic drift. It can
    optionally adjust the system clock using the CMOS clock as a
    reference, and can log times for long-term estimation of drift rates.
    Now, maybe I'll give it a try with adjtimex. I haven't found yet how to use it so any information, you people can provide, it would be surely helpful.

  6. #6
    Join Date
    Feb 2009
    Beans
    38

    Re: 9.10 system clock runs slow

    Does it lose an hour if the computer is shut down. Could be that your CMOS battery is low or dead. That would cause a clock to run slow.

  7. #7
    Join Date
    Jul 2009
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 9.10 system clock runs slow

    I found that there is a file /etc/adjtime that seems to be relevant.

    Code:
    $ cat /etc/adjtime 
    408.707211 1258071000 0.000000
    1258071000
    LOCAL
    I also found this: http://tldp.org/HOWTO/Clock-3.html

    Is there anyone who can guide me. Somebody more experienced with these commands would save me from much trouble.
    Last edited by RodGer GR; December 10th, 2009 at 11:17 PM.

  8. #8
    Join Date
    Jul 2009
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 9.10 system clock runs slow

    Quote Originally Posted by mihamil View Post
    Does it lose an hour if the computer is shut down. Could be that your CMOS battery is low or dead. That would cause a clock to run slow.
    I didn't saw this before. Thanks for your answer.
    As I described before, no it is definitely not a hardware problem. The computer loses time when (only when) in use and only while running Karmic Koala.

    The problem is with the difference between the cmos clock and the system clock tick duration and frequency.
    It seems like I found a solution using the adjtimex command.

    This:
    Code:
    rodger@rodger-laptop:~$ sudo adjtimex -a
                                          --- current ---   -- suggested --
    cmos time     system-cmos  error_ppm   tick      freq    tick      freq
    1260489815      -3.181637
    1260489825      -3.187912     -627.5  10003   5846020
    1260489835      -3.174583     1332.9  10003   5846020    9990   3692843
    1260489845      -3.177026     -244.2  10003   5846020   10006   2191493
    1260489855      -3.197475    -2044.9  10003   5846020   10024   2236068
    1260489865      -3.171821     2565.4  10024   2236068    9998   4506253
    1260489875      -3.161904      991.8  10024   2236068   10014   2775215
    1260489885      -3.136338     2556.6  10024   2236068    9998   5082815
    is the current output. The first time I gave the above command the value for "error_ppm" was much larger with many more digits. (Unfortunately I closed the terminal since then and I can't find the exact output)

    I'll wait to see if the problem shows up again. If not, it means that adjtimex was the solution.

    Thanks a lot to anybody who tried to help.

  9. #9
    Join Date
    Jul 2009
    Beans
    60
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 9.10 system clock runs slow

    Unfortunately, adjtimex -a didn't solve the problem.

    When I stop moving the mouse or typing, after a while, the clock stops refreshing and the cursor stops blinking. I don't know if this is related to my problem but it seems like everything (downloading, copying files from one partition to another) slows down when I'm idle.

    Please, any ideas?

  10. #10
    Join Date
    Oct 2009
    Location
    Norway
    Beans
    41
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: 9.10 system clock runs slow

    Quote Originally Posted by RodGer GR View Post
    When I stop moving the mouse or typing, after a while, the clock stops refreshing and the cursor stops blinking. I don't know if this is related to my problem but it seems like everything (downloading, copying files from one partition to another) slows down when I'm idle.
    I'd guess that there is a power-save setting somewhere that intentionally underclocks the processor when you're not using the system.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •