Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Sep 2004 12:29:56 -0500 (CDT)
From:      "Paul Seniura" <pdseniura@techie.com>
To:        <FreeBSD-gnats-submit@FreeBSD.org>
Cc:        freebsd-emulation@FreeBSD.org
Subject:   ports/71536: emulators/rtc: kernel msg "rtc: [number] > kern.hz: Timing will be inaccurate, please increase hz." issued even when [number] == kern.hz
Message-ID:  <20040909172956.4A6095C13@techpc04.okladot.state.ok.us>
Resent-Message-ID: <200409091740.i89HeSxr009834@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         71536
>Category:       ports
>Synopsis:       emulators/rtc: kernel msg "rtc: [number] > kern.hz: Timing will be inaccurate, please increase hz." issued even when [number] == kern.hz
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 09 17:40:27 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     "Paul Seniura" <pdseniura@techie.com>
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
State of Okla. D.O.T.
>Environment:
System: FreeBSD techpc04.okladot.state.ok.us 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Wed Sep 8 13:47:43 CDT 2004 root@techpc04.okladot.state.ok.us:/usr/obj/src/sys/IBM300SY_4BSD_Os i386


>Description:

We see the kernel msg:
rtc: [number] > kern.hz: Timing will be inaccurate, please increase hz.
on the console as well as in /var/log/messages (maybe dmesg)
even when [number] and kern.hz are the same value
or close to each other.


>How-To-Repeat:

(1)  Choose a suitable kern.hz value that your machine can
     handle.  For the "puny p2" I'm using here at work, I
     set this to 512 for testing.

(2)  Add a line in your /boot/loader.conf to set kern.hz
     to the same value e.g. for me: kern.hz="512" .

(3)  Compile the port multimedia/mplayer with WITH_RTC=yes
     and WITH_KERN_HZ=[number] set in your /etc/make.conf
     e.g. for me: WITH_KERN_HZ=512 .

(4)  Compile & install emulators/rtc normally.  Load rtc.ko
     and ensure /dev/rtc is ready to be used etc.

(5)  Test the freshly-built mplayer with any supported sound
     file i.e. something simple.  I test this on a local
     ttyv session with no X running at all.

(6)  Look at your console and/or /var/log/messages (maybe dmesg)
     to see the 'Timing will be inaccurate' msg is logged.


>Fix:

I don't know much about this, but it sure seems rtc.c is
comparing apples with soccerballs ;) .  I have been using the
following patch for many many weeks so far:

===cut-here===
diff -ur files_orig/rtc.c files/rtc.c
--- files_orig/rtc.c	Thu Jun 24 08:54:46 2004
+++ files/rtc.c	Wed Sep  8 17:11:56 2004
@@ -268,7 +268,7 @@
 			break;
 		}
 		sc->var.freq = freq;
-		if (sc->var.freq * 9 > hz * 8) {
+		if (sc->var.freq > hz) {
 			sc->var.freq = hz;
 			printf("rtc: %d > kern.hz: Timing will be inaccurate, please increase hz.\n", sc->var.freq);
 		}
===cut-here===


FWIW I will usually use 500 for kern.hz et al. as it is
more evenly-divisable for other related system parms. 
Also FWIW this "puny p2" machine really slows down if
kern.hz gets close to or over 1000 for kern.hz; this
slowdown really shows while running KDE or Gnome. <sigh> 
At any rate, I'm not so interested in atomic-level
accuracy here, but rather have a cleaner log, since
this particular msg is issued every single time mplayer
is invoked.  ;)  Besides, wouldn't the accuracy be
'best' if both were set to exactly the same value?


  --  thx, Paul Seniura
           System Specialist
           State of Okla. D.O.T.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040909172956.4A6095C13>