All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stuffed Crust <pizza@shaftnet.org>
To: alsa-devel@lists.sourceforge.net
Subject: Re: Selectable async notification signal?
Date: Thu, 11 Apr 2002 14:02:41 -0400	[thread overview]
Message-ID: <20020411140241.C15906@shaftnet.org> (raw)
In-Reply-To: <s5hzo0ajjbi.wl@alsa2.suse.de>; from tiwai@suse.de on Thu, Apr 11, 2002 at 06:23:13PM +0200

[-- Attachment #1: Type: text/plain, Size: 1642 bytes --]

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 #2: Type: application/pgp-signature, Size: 232 bytes --]

      parent reply	other threads:[~2002-04-11 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-08  3:45 Selectable async notification signal? Stuffed Crust
2002-04-11 16:23 ` Takashi Iwai
2002-04-11 16:41   ` Paul Davis
2002-04-11 18:02   ` Stuffed Crust [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020411140241.C15906@shaftnet.org \
    --to=pizza@shaftnet.org \
    --cc=alsa-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.