On Sun, 2004-01-04 at 00:44, Jaroslav Kysela wrote:
> On Sat, 3 Jan 2004, Kevin Seghetti wrote:
> 
> > I am working on a multiple stream jukebox program (plays 3 separate
> > stereo streams out a 5.1 sound card, in this case the EPIA-VIA-M). Each
> > stream uses aplay to play a song, when it finishes it calls aplay again
> > with a new song. I am using dshare to multiplex 3 copies of aplay into
> > the sound card (asound.conf file attached). It plays all 3 streams
> > great. The problem I am having is whichever stream I start first causes
> > the dshare server to spawn, and it doesn't return until all streams have
> > stopped playing (whereas I need it to return when the song finishes so I
> > can start another one on that channel). 
> 
> It's indented. What's wrong with this "auto" behaviour?

Oops, I wasn't clear enough with my description. I call aplay from a
perl script using exec) which is called from another perl script. When
the lower perl script returns I know it is time to start the next song
(by calling the lower perl script again). The problem I am having is
that lower perl script doesn't return when the song ends, only when all
of the songs end (and the server quits). So something about the server
is preventing the lower perl script from returning. 

So I tried dmix instead of dshare, it also didn't seem to work.
 
I noticed in the server source code that it wasn't closing the first 3
file handles (stdin, stdout, & stderr), so I tried changing that to
close those as well, and that fixed dmix (didn't fix dshare, though).

So I got it working for CES, but would prefer to use dshare over dmix
since (I imagine) it will be more efficient. 

Also, someone familiar with the pcm plugin internals should look at the
code I patched (enclosed) and decide if this is a bug (maybe the idea
was to allow the server to print to stdout/stderr, but a proper daemon
should close all inherited file handles). 
     
Now that the pressure is off I can make a test case if desired.

Thanks,
-- 
Kevin Seghetti: E-Mail: [EMAIL PROTECTED], HTTP: www.tenetti.org
GPG public key: http://tenetti.org/phpwiki/index.php/KevinSeghettiGPGKey
Check out www.worldfoundry.org for my GPL'ed 3D video game engine
Copyright is a temporary loan from the public domain, not property

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to