* Multiple Sound Streams out of a single card
@ 2003-09-14 3:44 AthlonRob
2003-09-14 6:06 ` Paul Davis
0 siblings, 1 reply; 7+ messages in thread
From: AthlonRob @ 2003-09-14 3:44 UTC (permalink / raw)
To: alsa-devel
Hey list-
I'm wondering exactly how things work, playing multiple streams of audio
out of a single card/chip.
In Windows, I'm able to have WinAmp running in the background and still
hear event sounds from other applications.
In Linux, only one thing can play at a time, without the use of
high-latency audio servers.
Why is this? I understand some alsa drivers support playing multiple
streams.. dependent upon driver support and a certain property of
hardware (which I have been told doesn't exist on the nForce, although
I've read elsewhere it does... and doesn't exist on any i8x0 based
chips).
I only question this because about six months ago I was told, flat out,
that the hardware didn't support playing multiple audio streams at
once. On one machine, I have an i8x0 chip, and on another an nForce
chip (which uses the i8x0 driver). Both play multiple audio streams at
once in Windows, but neither seem capable with either OSS or ALSA
drivers.
Is this a fundamental difference between Windows and ALSA driver
architectures, something the Alsa or OSS people haven't gotten around to
yet, a big mystery, or what? Maybe Windows runs some fairly low-latency
sound server type setup?
Inquiring minds want to know. :-)
Rob
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Multiple Sound Streams out of a single card
2003-09-14 3:44 Multiple Sound Streams out of a single card AthlonRob
@ 2003-09-14 6:06 ` Paul Davis
2003-09-14 15:50 ` AthlonRob
0 siblings, 1 reply; 7+ messages in thread
From: Paul Davis @ 2003-09-14 6:06 UTC (permalink / raw)
To: AthlonRob; +Cc: alsa-devel
>In Windows, I'm able to have WinAmp running in the background and still
>hear event sounds from other applications.
>
>In Linux, only one thing can play at a time, without the use of
>high-latency audio servers.
not true. ALSA now offers the "dmix" plugin layer that allows multiple
applications to write to a PCM device without locks. just tell an ALSA
aware app to use "dmix:0" and both it and many other apps will all be
able to share the device.
>Is this a fundamental difference between Windows and ALSA driver
>architectures, something the Alsa or OSS people haven't gotten around to
>yet, a big mystery, or what? Maybe Windows runs some fairly low-latency
>sound server type setup?
yes, there is a fundamental difference between Windows various driver
architectures and ALSA's. if you had to pick on Windows driver model
that ALSA is more similar to, its would probably be ASIO, though ALSA
is a lot more flexible. ASIO doesn't allow multiple apps to use the
soundcard simultaneously.
and remember that Linux (and Mac OS X) also have JACK, which offers a
service that isn't exactly matched on Windows, though rewire comes
close, sort of.
--p
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Multiple Sound Streams out of a single card
2003-09-14 6:06 ` Paul Davis
@ 2003-09-14 15:50 ` AthlonRob
2003-09-14 16:11 ` AthlonRob
0 siblings, 1 reply; 7+ messages in thread
From: AthlonRob @ 2003-09-14 15:50 UTC (permalink / raw)
To: alsa-devel
On Sat, 2003-09-13 at 23:06, Paul Davis wrote:
> ALSA now offers the "dmix" plugin layer that allows multiple
> applications to write to a PCM device without locks. just tell an ALSA
> aware app to use "dmix:0" and both it and many other apps will all be
> able to share the device.
Wow, it's good to see something like that. :-)
I just tried it, though, and it didn't seem to want to work for me...
With my .asoundrc looking like this:
pcm.main {
type dmix
slave {
pcm default
}
}
I got this, running alsaplayer -d main /path/to/wav/file :
ALSA lib pcm_dmix.c:1184:(_snd_pcm_dmix_open) Unique IPC key is not defined
snd_pcm_open: Invalid argument (main)
Failed to initialize plugin!
Failed to register plugin: /usr/lib/alsaplayer/output/libalsa_out.so
Failed to load output plugin "alsa". Trying defaults.
ALSA lib pcm_dmix.c:1184:(_snd_pcm_dmix_open) Unique IPC key is not defined
snd_pcm_open: Invalid argument (main)
Failed to initialize plugin!
/usr/lib/alsaplayer/output/libalsa_out.so failed to load
If I run alsaplayer -d dmix:0 /path/to/wav/file, I get this:
ALSA lib pcm.c:1908:(snd_pcm_open_noupdate) Unknown PCM 0
ALSA lib pcm_dmix.c:954:(snd_pcm_dmix_open) unable to open slave
snd_pcm_open: No such file or directory (dmix:0)
Failed to initialize plugin!
Failed to register plugin: /usr/lib/alsaplayer/output/libalsa_out.so
Failed to load output plugin "alsa". Trying defaults.
ALSA lib pcm.c:1908:(snd_pcm_open_noupdate) Unknown PCM 0
ALSA lib pcm_dmix.c:954:(snd_pcm_dmix_open) unable to open slave
snd_pcm_open: No such file or directory (dmix:0)
Failed to initialize plugin!
/usr/lib/alsaplayer/output/libalsa_out.so failed to load
So I see it really isn't working for me.
> and remember that Linux (and Mac OS X) also have JACK, which offers a
> service that isn't exactly matched on Windows, though rewire comes
> close, sort of.
I see how the various Linux audio offerings may be superior to what you
can do with Windows, in a real professional setup... but for being able
to play multiple things at once, unless DMIX pans out, Windows may have
us beaten. :-\
Is there a way to force OSS emulation to use the dmix plugin?
:::off to grep the great WWW for dmix info:::
Rob
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Multiple Sound Streams out of a single card
2003-09-14 15:50 ` AthlonRob
@ 2003-09-14 16:11 ` AthlonRob
2003-09-14 16:56 ` Justin Cormack
2003-09-15 17:34 ` Clemens Ladisch
0 siblings, 2 replies; 7+ messages in thread
From: AthlonRob @ 2003-09-14 16:11 UTC (permalink / raw)
To: alsa-devel
On Sun, 2003-09-14 at 08:50, AthlonRob wrote:
> I just tried it, though, and it didn't seem to want to work for me...
Well, I got it working. Alsaplayer doesn't like playing output to alsa,
so I switched to aplay, and fixed my .asoundrc so as to define an IPC
(123? what's up with the IPC?) and to define a slave (hw:0,0). I was
then able to use aplay to play multiple things at once. Yeah! :-)
XMMS crashes and burns when I tell it to use 'main' in the alsa plugin
... I'll have to google about for that, I suppose. Or figure out if I
can get mpg123 to play to alsa.
I'd still like to hear, though, if it is possible to get OSS emulation
to use the dmix plugin...
Rob
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Multiple Sound Streams out of a single card
2003-09-14 16:11 ` AthlonRob
@ 2003-09-14 16:56 ` Justin Cormack
2003-09-15 17:34 ` Clemens Ladisch
1 sibling, 0 replies; 7+ messages in thread
From: Justin Cormack @ 2003-09-14 16:56 UTC (permalink / raw)
To: AthlonRob; +Cc: alsa list
On Sun, 2003-09-14 at 17:11, AthlonRob wrote:
> I'd still like to hear, though, if it is possible to get OSS emulation
> to use the dmix plugin...
unfortunately because oss is a kernel only thing, it all goes through
the kernel and so only uses hw (because plughw and all the other stuff
is userspace).
The way to do it would be to write an oss driver (or alsa driver and use
oss emulation) that simply passes playback to user space where you feed
it into dmix or whatever. But hopefully all tools will support alsa
soon.
Justin
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Multiple Sound Streams out of a single card
2003-09-14 16:11 ` AthlonRob
2003-09-14 16:56 ` Justin Cormack
@ 2003-09-15 17:34 ` Clemens Ladisch
1 sibling, 0 replies; 7+ messages in thread
From: Clemens Ladisch @ 2003-09-15 17:34 UTC (permalink / raw)
To: AthlonRob; +Cc: alsa-devel
AthlonRob wrote:
> I'd still like to hear, though, if it is possible to get OSS emulation
> to use the dmix plugin...
In theory, you can define a pcm named "dsp0" in your .asoundrc and
start your OSS program with the aoss script from the OSS compatibility
package (see the ALSA homepage).
HTH
Clemens
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20030915012209.GA9288@ice_nine.wi.rr.com>]
* Re: Multiple Sound Streams out of a single card
[not found] <20030915012209.GA9288@ice_nine.wi.rr.com>
@ 2003-09-15 2:00 ` Paul Davis
0 siblings, 0 replies; 7+ messages in thread
From: Paul Davis @ 2003-09-15 2:00 UTC (permalink / raw)
To: avan; +Cc: alsa-devel
[ dmix ]
>Unfortunately, this doesn't seem to work with some alsa-native apps
>such as mplayer. Something goes wrong when the driver attempts to
>set the software parameters. Are applications supposed to treat plugins
>like dmix differently? I'm completely unable to use xmms with the alsa
>plugin and dmix (with or without mmap mode). (I'm using latest stable,
>not CVS)
apps need have no idea what "type" of PCM device they are using. the
user can freely switch from "hw:0" to "plughw:0" to "dmix:0" etc. and
the app should just work. if it doesn't, its a bug.
>Have I thanked you for JACK lately?
no, but thats OK :)
--p
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-09-15 17:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-14 3:44 Multiple Sound Streams out of a single card AthlonRob
2003-09-14 6:06 ` Paul Davis
2003-09-14 15:50 ` AthlonRob
2003-09-14 16:11 ` AthlonRob
2003-09-14 16:56 ` Justin Cormack
2003-09-15 17:34 ` Clemens Ladisch
[not found] <20030915012209.GA9288@ice_nine.wi.rr.com>
2003-09-15 2:00 ` Paul Davis
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.