Re: [linux-audio-dev] async latency problems?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] async latency problems?
From: Paul Davis (pbd_AT_Op.Net)
Date: Fri Apr 05 2002 - 00:04:44 EEST


>maybe i'm missing something somewhere, but is there a reason why i can't
>seem to get audio processing via async handlers to work reliably?

i have explained before on the alsa-devel list that the async handling
stuff in ALSA is fundamentally incompatible with POSIX. you are not
allowed to do very much from a signal handler, and you run into
several subtle scheduling issues with the kernel that do not exist for
"synchronous" I/O. its hard to say more without seeing what you code
actually does.

>i'm using andrew morton's kernel patch for 2.4.18.....and i can crank the
>latency test program all the way down to 64 frames with no trouble. but
>when i try to do things with async handlers, i get underruns from typing
>in xterms or things simpler than that
>
>i can rewrite my code to work without callbacks without much effort..but
>i'm confused as to why this might happen, considering that blocking
>through snd_pcm_wait() shouldn't be that much different as far as process
>wakeup time

the difference is that your async code is executing c/o the kernel's
signal handling system, and not in a regular execution context. you're
running on a different stack, for a start.

you'd be much better off (and have no more "issues") starting a thread
and using poll(2).

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Apr 04 2002 - 23:52:04 EEST