On Mon, 2001-10-15 at 05:45, Jaroslav Kysela wrote:
> On 15 Oct 2001, Josh Green wrote:
> >
> > Just wanted to add that my XRUN detection is rather messed up right now,
> > and I've already locked up my machine once (stuck in loop with
> > SCHED_FIFO @:(), so you probably want to run it as non root. Not sure
> > whats wrong with the way I'm detecting XRUNS, but if I just do a
> > snd_pcm_prepare, the output stream starts returning
> > "SND_PCM_STATE_PREPARE" until I restart it. I'll have to look into it
> > more, but if you have any ideas, please let me know.
> 
> There are many thinkos in your code. I found these bugs:
> 
> 1) initial write: the ring buffer should contain data for two periods
>    before the streams are started
> 2) xrun recovery: if you call snd_pcm_prepare, you have to call
>    snd_pcm_start, too; otherwise the state will be SND_PCM_STATE_PREPARED
> 3) count of written / read frames is invalid for i/o operations (you're
>    using count in bytes)
> 4) poll is not synchronized as you think; it's the main problem causing
>    scratchy sound; you must always preserve the order of read/write i/o
>    calls; please, look to 'r' variable and for "unsync" messages in my
>    code
> 
> I've attached my test code (heavy modified) which shows or fixes all
> above bugs.
> 
> 
>                               Have a clear sound,
>                                               Jaroslav

Cool, thanks for the tips and fixes :) Must go to sleep now, sun almost
rising. I finally figured out how to record the Mic input on one channel
and the Music (wavetable) on another with my SB Live and ALSA (have to
use amixer). This setup is nice for the LADSPA vocoder plugin
(http://www.c0nfusion.org/~josh/). Perhaps I should throw together a
sound font of good carrier sounds. Thanks again!

-- 
    Josh Green
    Smurf Sound Font Editor (http://smurf.sourceforge.net)


_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to