Why does jack speed up system time?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Why does jack speed up system time?

Carlo Scarfoglio
I'm trying to use jack as my sound system mixer/router because
I want to convert all my LPs to Ogg 24bit/48kHz with a Terratec
DMX6Fire 2496 and play them back with xmms/jack.
So far things  have been unsatisfactory because of xruns that plague
recording
and palyback. Even a 0,02 msec xrun is audible. With kernel 2.6.12
things have improved since I get a xrun every 5-10 minutes, but
still I can't record a full LP side reliably.
At the same time I've solved a problem with xntpd: it gave up after
a few minutes because the system clock was running too fast, more
than the 500 PPM (approx. 43 seconds/day) that xntpd is able to
correct. By setting the tick to 9934 with tickadj, now xntpd runs
perfectly, with an average drift of -50 msec.
But as soon as jackd is started (in realtime to avoid/reduce xruns)
 the offset steadily increases and xntpd, after 10-15 minutes, gives up
because
the offset exceeds 500 PPM.
This means that jack interferes with xntpd: I don't know what reference
clock is used by alsa/jackd. I have tested with and without the
snd-rtctimer
driver, there is no difference.
Does jack/alsa use the sound card clock as reference, and adjusts
the system clock to it or the way around?
Is there a way to make jack and xntpd coexist?

Thanks

    Carlo Scarfoglio


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why does jack speed up system time?

Paul Davis
>and palyback. Even a 0,02 msec xrun is audible. With kernel 2.6.12
>things have improved since I get a xrun every 5-10 minutes, but
>still I can't record a full LP side reliably.

then you're system still needs careful tuning. there are lots of
resources to read online. you need to ensure first of all that JACK
really is running in realtime mode. then starting looking at disk
settings (hdparm) and PCI latency settings (lspci/setpci).

>But as soon as jackd is started (in realtime to avoid/reduce xruns)
> the offset steadily increases and xntpd, after 10-15 minutes, gives up
>because
>the offset exceeds 500 PPM.
>This means that jack interferes with xntpd: I don't know what reference
>clock is used by alsa/jackd. I have tested with and without the
>snd-rtctimer
>driver, there is no difference.
>Does jack/alsa use the sound card clock as reference, and adjusts
>the system clock to it or the way around?

neither. if jackd interferes with xnptd it must be because xntpd makes
assumption about its ability to run "on time" that jackd
violates. thats all i can think of.

--p


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why does jack speed up system time?

Florian Paul Schmidt-2
In reply to this post by Carlo Scarfoglio
On Thu, 23 Jun 2005 01:38:49 +0200
Carlo Scarfoglio <[hidden email]> wrote:

> I'm trying to use jack as my sound system mixer/router because
> I want to convert all my LPs to Ogg 24bit/48kHz with a Terratec
> DMX6Fire 2496 and play them back with xmms/jack.
> So far things  have been unsatisfactory because of xruns that plague
> recording
> and palyback. Even a 0,02 msec xrun is audible. With kernel 2.6.12
> things have improved since I get a xrun every 5-10 minutes, but
> still I can't record a full LP side reliably.

Hmm, how about increasing your jack buffer [period] size. The larger,
the less probable xruns are..

Flo

--
Palimm Palimm!
http://affenbande.org/~tapas/


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why does jack speed up system time?

Steve Harris-2
In reply to this post by Paul Davis
On Wed, Jun 22, 2005 at 07:42:05 -0400, Paul Davis wrote:

> >But as soon as jackd is started (in realtime to avoid/reduce xruns)
> > the offset steadily increases and xntpd, after 10-15 minutes, gives up
> >because
> >the offset exceeds 500 PPM.
> >This means that jack interferes with xntpd: I don't know what reference
> >clock is used by alsa/jackd. I have tested with and without the
> >snd-rtctimer
> >driver, there is no difference.
> >Does jack/alsa use the sound card clock as reference, and adjusts
> >the system clock to it or the way around?
>
> neither. if jackd interferes with xnptd it must be because xntpd makes
> assumption about its ability to run "on time" that jackd
> violates. thats all i can think of.

Lots of DMA activity (such as major soundcard i/o) messes with the RTC and
cycle counter on some machines, you can demonstrate it by uploading huge
textures to OpenGL cards.

- Steve


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why does jack speed up system time?

Joachim Deguara
Steve Harris wrote:

> On Wed, Jun 22, 2005 at 07:42:05 -0400, Paul Davis wrote:
>
>>>But as soon as jackd is started (in realtime to avoid/reduce xruns)
>>>the offset steadily increases and xntpd, after 10-15 minutes, gives up
>>>because
>>>the offset exceeds 500 PPM.
>>>This means that jack interferes with xntpd: I don't know what reference
>>>clock is used by alsa/jackd. I have tested with and without the
>>>snd-rtctimer
>>>driver, there is no difference.
>>>Does jack/alsa use the sound card clock as reference, and adjusts
>>>the system clock to it or the way around?
>>
>>neither. if jackd interferes with xnptd it must be because xntpd makes
>>assumption about its ability to run "on time" that jackd
>>violates. thats all i can think of.
>
>
> Lots of DMA activity (such as major soundcard i/o) messes with the RTC and
> cycle counter on some machines, you can demonstrate it by uploading huge
> textures to OpenGL cards.
>
> - Steve
>

Wow I have never heard of this before and a google of "rtc dma linux"
does not seam to help.  Where could this come from?

-joachim

>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Jackit-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jackit-devel


--
Joachim Deguara Email: [hidden email]
Fraunhofer IDMT, Langewiesener St. 22, 98693 Ilmenau, Germany
Phone: +49 3677/69-4851 Fax:   +49 3677/69-4399


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why does jack speed up system time?

Steve Harris-2
On Thu, Jun 23, 2005 at 03:19:55 +0200, Joachim Deguara wrote:

> Steve Harris wrote:
> >On Wed, Jun 22, 2005 at 07:42:05 -0400, Paul Davis wrote:
> >
> >>>But as soon as jackd is started (in realtime to avoid/reduce xruns)
> >>>the offset steadily increases and xntpd, after 10-15 minutes, gives up
> >>>because
> >>>the offset exceeds 500 PPM.
> >>>This means that jack interferes with xntpd: I don't know what reference
> >>>clock is used by alsa/jackd. I have tested with and without the
> >>>snd-rtctimer
> >>>driver, there is no difference.
> >>>Does jack/alsa use the sound card clock as reference, and adjusts
> >>>the system clock to it or the way around?
> >>
> >>neither. if jackd interferes with xnptd it must be because xntpd makes
> >>assumption about its ability to run "on time" that jackd
> >>violates. thats all i can think of.
> >
> >
> >Lots of DMA activity (such as major soundcard i/o) messes with the RTC and
> >cycle counter on some machines, you can demonstrate it by uploading huge
> >textures to OpenGL cards.
> >
> >- Steve
> >
>
> Wow I have never heard of this before and a google of "rtc dma linux"
> does not seam to help.  Where could this come from?

No idea, I've only observed it on a friends machine. Didnt really look
into it. I found that it upset jack because laptops going into low power
mode change the lock rate (naturally).

- Steve


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why does jack speed up system time?

Lee Revell
On Thu, 2005-06-23 at 14:28 +0100, Steve Harris wrote:
> No idea, I've only observed it on a friends machine. Didnt really look
> into it. I found that it upset jack because laptops going into low
> power
> mode change the lock rate (naturally).

DMA starvation is a possibility, we have seen this with some ATA133
controllers.  This is when a device DMA's so aggressively that there's
no memory bandwidth left for code to run.  The other is SMM traps, used
by the BIOS to talk to the battery etc. on laptops.  And of course, you
could be running into our old friend the long-running non-preemptible
section of kernel code.

Try the realtime-preempt patch, compile with the default debug options
and you'll be able rule out some of these problems.

DMA starvation manifests in the latency traces as long sections of code
that seem to go in "slow motion", while SMM issues will show up as a
single inexplicable latency, usually about 200-1500 usecs.

Lee



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why does jack speed up system time?

Lee Revell
In reply to this post by Steve Harris-2
On Thu, 2005-06-23 at 10:50 +0100, Steve Harris wrote:
> Lots of DMA activity (such as major soundcard i/o) messes with the RTC
> and
> cycle counter on some machines, you can demonstrate it by uploading
> huge
> textures to OpenGL cards.

It's actually more likely that you are losing ticks from the PIT.  It's
a known issue that Linux is prone to this, and in fact this recently led
someone from IBM to create a new gettimeofday() subsystem, currently
undergoing code review on LKML.

Lee



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Why does jack speed up system time?

Jussi Laako
On Thu, 2005-06-23 at 11:17 -0400, Lee Revell wrote:

> It's actually more likely that you are losing ticks from the PIT.  It's
> a known issue that Linux is prone to this, and in fact this recently led
> someone from IBM to create a new gettimeofday() subsystem, currently
> undergoing code review on LKML.

This behavior is clearly visible when running Linux under VMware. I'd
guess drivers disabling IRQ's for long time could also do this depending
on clock implementation in use. When running realtime-pe enabled kernel
in full realtime mode this could probably be less likely to happen.


--
Jussi Laako <[hidden email]>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel