On Thu, Apr 11, 2002 at 06:23:13PM +0200, Takashi Iwai wrote:
> int snd_pcm_async(snd_pcm_t *pcm, int sig, pid_t pid)
> 
> .. so you can pass your favorite signal to the 2nd argument.
> 
> or do i misunderstand your question?

Yes, let me try to explain it a bit better.

BTW, This is for FreeSCI (http://freesci.linuxgames.com).

The main process forks off a child to handle all of the sound-related
stuff, and communicates with that child through a pair of pipes.  We use
select()s to check for events, usually with a very small (~100ms max)
timeout.  We need the timeout to enforce note timing.

The child process is what opens the sound device.

I wrote an ALSA PCM output plugin for FreeSCI which uses async PCM; ie
I register a callback, and every period ALSA kicks in, executes the
callback and fills its buffers.

Both on their own work just fine.  However, when I turn on the ALSA
callback, the select()s block indefinately.   Since the select()s block,
no note data gets fired off, which results in no sound.

I am not installing any SIGIO handler at all; The only ones installed in
the child is SIGPIPE.

I tried the snd_pcm_async() call; that didn't help.  What
happens is the callback keeps kitting my custom signal, but meanwhile
the select()s still block.  

If I don't start the pcm device, then the select()s succeed.

 - Pizza
-- 
Solomon Peachy                                    pizzaATfucktheusers.org
I ain't broke, but I'm badly bent.                           ICQ# 1318344
Patience comes to those who wait.
    ...It's not "Beanbag Love", it's a "Transanimate Relationship"...

Attachment: msg02549/pgp00000.pgp
Description: PGP signature

Reply via email to