linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* software mixing in alsa
@ 2005-05-17  9:56 Karel Kulhavy
  2005-05-17 10:08 ` Jan Spitalnik
  0 siblings, 1 reply; 25+ messages in thread
From: Karel Kulhavy @ 2005-05-17  9:56 UTC (permalink / raw)
  To: linux-kernel

Hello

http://www.math.tu-berlin.de/~sbartels/alsa/driver/driver.html says
"For example, there is currently ongoing work to allow mixing multiple
inputs to the pcm devices."

Does ALSA already support software mixing? If I run xmms with alsa
output plugin and then mpg123 into it, I get 'can't open /dev/dsp'
message.

Kernel version is 2.6.11-gentoo-r5

CL<


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17  9:56 software mixing in alsa Karel Kulhavy
@ 2005-05-17 10:08 ` Jan Spitalnik
  2005-05-17 14:13   ` Karel Kulhavy
  0 siblings, 1 reply; 25+ messages in thread
From: Jan Spitalnik @ 2005-05-17 10:08 UTC (permalink / raw)
  To: Karel Kulhavy; +Cc: linux-kernel

Dne út 17. května 2005 11:56 Karel Kulhavy napsal(a):
> Hello
>
> http://www.math.tu-berlin.de/~sbartels/alsa/driver/driver.html says
> "For example, there is currently ongoing work to allow mixing multiple
> inputs to the pcm devices."
>

Hi,

yes, ALSA can mix multiple inputs with its dmix plugin.
http://alsa.opensrc.org/index.php?page=DmixPlugin

bye,
	spity

-- 
Jan Spitalnik
jan@spitalnik.net


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 10:08 ` Jan Spitalnik
@ 2005-05-17 14:13   ` Karel Kulhavy
  2005-05-17 18:32     ` Lee Revell
  0 siblings, 1 reply; 25+ messages in thread
From: Karel Kulhavy @ 2005-05-17 14:13 UTC (permalink / raw)
  To: Jan Spitalnik; +Cc: linux-kernel

On Tue, May 17, 2005 at 12:08:03PM +0200, Jan Spitalnik wrote:
> Dne út 17. května 2005 11:56 Karel Kulhavy napsal(a):
> > Hello
> >
> > http://www.math.tu-berlin.de/~sbartels/alsa/driver/driver.html says
> > "For example, there is currently ongoing work to allow mixing multiple
> > inputs to the pcm devices."
> >
> 
> Hi,
> 
> yes, ALSA can mix multiple inputs with its dmix plugin.
> http://alsa.opensrc.org/index.php?page=DmixPlugin

Thanks for your reply.  I have proceeded according to this "Dmix Howto",
however it doesn't work. I have proceeded successfully up to the command
"aoss mpg123 some.mp3". When I run this, mp3 is played very fast, in
about 1-2 seconds (normal pitch, but skipping very fast forward).

mpg123 Version 0.59s-r9 (2000/Oct/27)
aoss doesn't have --version option
alsaplayer 0.99.76

The document doesn't contain any contact where to send bugreports that
the course described actually doesn't work.

Any other idea how to make Skype & XMMS run at the same time on Linux?

CL<

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 14:13   ` Karel Kulhavy
@ 2005-05-17 18:32     ` Lee Revell
  2005-05-17 19:24       ` Karel Kulhavy
  2005-05-17 19:28       ` Michal Schmidt
  0 siblings, 2 replies; 25+ messages in thread
From: Lee Revell @ 2005-05-17 18:32 UTC (permalink / raw)
  To: Karel Kulhavy; +Cc: Jan Spitalnik, linux-kernel

On Tue, 2005-05-17 at 16:13 +0200, Karel Kulhavy wrote:
> On Tue, May 17, 2005 at 12:08:03PM +0200, Jan Spitalnik wrote:
> > Dne út 17. května 2005 11:56 Karel Kulhavy napsal(a):
> > > Hello
> > >
> > > http://www.math.tu-berlin.de/~sbartels/alsa/driver/driver.html says
> > > "For example, there is currently ongoing work to allow mixing multiple
> > > inputs to the pcm devices."
> > >
> > 
> > Hi,
> > 
> > yes, ALSA can mix multiple inputs with its dmix plugin.
> > http://alsa.opensrc.org/index.php?page=DmixPlugin
> 
> Thanks for your reply.  I have proceeded according to this "Dmix Howto",
> however it doesn't work. I have proceeded successfully up to the command
> "aoss mpg123 some.mp3". When I run this, mp3 is played very fast, in
> about 1-2 seconds (normal pitch, but skipping very fast forward).
> 
> mpg123 Version 0.59s-r9 (2000/Oct/27)
> aoss doesn't have --version option
> alsaplayer 0.99.76
> 
> The document doesn't contain any contact where to send bugreports that
> the course described actually doesn't work.
> 
> Any other idea how to make Skype & XMMS run at the same time on Linux?

Yes, get the Skype developers to add proper ALSA support.  If Doom 3
could do it, so can they.

mpg123 is an open source application so there's no excuse for it not to
support ALSA in 2005.

Finally, these questions are all OT for LKML.  Try alsa-user at
lists.sf.net and alsa-devel at lists.sf.net.  Also there's a bug
reporting system, linked from http://www.alsa-project.org.

Lee


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 18:32     ` Lee Revell
@ 2005-05-17 19:24       ` Karel Kulhavy
  2005-05-17 19:32         ` Lee Revell
                           ` (2 more replies)
  2005-05-17 19:28       ` Michal Schmidt
  1 sibling, 3 replies; 25+ messages in thread
From: Karel Kulhavy @ 2005-05-17 19:24 UTC (permalink / raw)
  To: Lee Revell; +Cc: linux-kernel

Lee Revell wrote:

> Finally, these questions are all OT for LKML.  Try alsa-user at
> lists.sf.net and alsa-devel at lists.sf.net.  Also there's a bug

ALSA is a part of Linux kernel, right? This is linux-kernel. Why
is it OT here? Doesn't make sense for me.

CL<

> Lee

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 18:32     ` Lee Revell
  2005-05-17 19:24       ` Karel Kulhavy
@ 2005-05-17 19:28       ` Michal Schmidt
  2005-05-17 21:04         ` Karel Kulhavy
  1 sibling, 1 reply; 25+ messages in thread
From: Michal Schmidt @ 2005-05-17 19:28 UTC (permalink / raw)
  To: Lee Revell; +Cc: Karel Kulhavy, Jan Spitalnik, linux-kernel

Lee Revell wrote:
> mpg123 is an open source application so there's no excuse for it not to
> support ALSA in 2005.

Its COPYING file says:
   This software may be distributed freely, provided that it is
   distributed in its entirety, without modifications, ...
This doesn't look like an open source license at all.
That's why Debian puts mpg123 in non-free.

Karel, you may want to try mpg321 instead. It already has ALSA support.

Michal

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 19:24       ` Karel Kulhavy
@ 2005-05-17 19:32         ` Lee Revell
  2005-05-17 20:27         ` Valdis.Kletnieks
  2005-05-18  9:22         ` Pavel Machek
  2 siblings, 0 replies; 25+ messages in thread
From: Lee Revell @ 2005-05-17 19:32 UTC (permalink / raw)
  To: Karel Kulhavy; +Cc: linux-kernel

On Tue, 2005-05-17 at 21:24 +0200, Karel Kulhavy wrote:
> Lee Revell wrote:
> 
> > Finally, these questions are all OT for LKML.  Try alsa-user at
> > lists.sf.net and alsa-devel at lists.sf.net.  Also there's a bug
> 
> ALSA is a part of Linux kernel, right? This is linux-kernel. Why
> is it OT here? Doesn't make sense for me.

Well, sort of.  The parts of ALSA you are interested in (software mixing
and volume control) are implemented in userspace.  They live in
alsa-lib.

You should at least cc: alsa-devel (non-subscribers can post) when
posting ALSA related questions to LKML.

Lee


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 19:24       ` Karel Kulhavy
  2005-05-17 19:32         ` Lee Revell
@ 2005-05-17 20:27         ` Valdis.Kletnieks
  2005-05-17 20:36           ` Lee Revell
                             ` (2 more replies)
  2005-05-18  9:22         ` Pavel Machek
  2 siblings, 3 replies; 25+ messages in thread
From: Valdis.Kletnieks @ 2005-05-17 20:27 UTC (permalink / raw)
  To: Karel Kulhavy; +Cc: Lee Revell, linux-kernel

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

On Tue, 17 May 2005 21:24:12 +0200, Karel Kulhavy said:
> Lee Revell wrote:
> 
> > Finally, these questions are all OT for LKML.  Try alsa-user at
> > lists.sf.net and alsa-devel at lists.sf.net.  Also there's a bug
> 
> ALSA is a part of Linux kernel, right? This is linux-kernel. Why
> is it OT here? Doesn't make sense for me.

I was hoping somebody would explain how to get 'dmix' plugin working in the
kernel - then I could get rid of esd ;)  (Note that running something in
userspace that accepts connections, runs dmix on them, and then creates one
thing spewing to /dev/pcm isn't a solution - I've already *got* esd, warts and all)

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 20:27         ` Valdis.Kletnieks
@ 2005-05-17 20:36           ` Lee Revell
  2005-05-18 13:32             ` Karel Kulhavy
  2005-05-18  6:30           ` ross
  2005-05-18 13:48           ` Takashi Iwai
  2 siblings, 1 reply; 25+ messages in thread
From: Lee Revell @ 2005-05-17 20:36 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Karel Kulhavy, linux-kernel

On Tue, 2005-05-17 at 16:27 -0400, Valdis.Kletnieks@vt.edu wrote:
> On Tue, 17 May 2005 21:24:12 +0200, Karel Kulhavy said:
> > Lee Revell wrote:
> > 
> > > Finally, these questions are all OT for LKML.  Try alsa-user at
> > > lists.sf.net and alsa-devel at lists.sf.net.  Also there's a bug
> > 
> > ALSA is a part of Linux kernel, right? This is linux-kernel. Why
> > is it OT here? Doesn't make sense for me.
> 
> I was hoping somebody would explain how to get 'dmix' plugin working in the
> kernel - then I could get rid of esd ;)  (Note that running something in
> userspace that accepts connections, runs dmix on them, and then creates one
> thing spewing to /dev/pcm isn't a solution - I've already *got* esd, warts and all)

I don't understand your message very well.  The dmix plugin is part of
alsa-lib, which is part of userspace.  From the application's point of
view, it does not matter whether the mixing happens in kernel or not.
ALSA follows the philosophy of doing as little as possible in the
kernel, and since mixing and volume control work fine in userspace,
that's where they live.

Lee 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 19:28       ` Michal Schmidt
@ 2005-05-17 21:04         ` Karel Kulhavy
  2005-05-17 21:36           ` Lee Revell
  0 siblings, 1 reply; 25+ messages in thread
From: Karel Kulhavy @ 2005-05-17 21:04 UTC (permalink / raw)
  To: Michal Schmidt; +Cc: linux-kernel

On Tue, May 17, 2005 at 09:28:03PM +0200, Michal Schmidt wrote:
> Lee Revell wrote:
> >mpg123 is an open source application so there's no excuse for it not to
> >support ALSA in 2005.
> 
> Its COPYING file says:
>   This software may be distributed freely, provided that it is
>   distributed in its entirety, without modifications, ...
> This doesn't look like an open source license at all.
> That's why Debian puts mpg123 in non-free.
> 
> Karel, you may want to try mpg321 instead. It already has ALSA support.

Tried with the same result: fast forward.

CL<
> 
> Michal

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 21:04         ` Karel Kulhavy
@ 2005-05-17 21:36           ` Lee Revell
  2005-05-17 23:32             ` Lee Revell
  0 siblings, 1 reply; 25+ messages in thread
From: Lee Revell @ 2005-05-17 21:36 UTC (permalink / raw)
  To: Karel Kulhavy; +Cc: Michal Schmidt, linux-kernel

On Tue, 2005-05-17 at 23:04 +0200, Karel Kulhavy wrote:
> On Tue, May 17, 2005 at 09:28:03PM +0200, Michal Schmidt wrote:
> > Lee Revell wrote:
> > >mpg123 is an open source application so there's no excuse for it not to
> > >support ALSA in 2005.
> > 
> > Its COPYING file says:
> >   This software may be distributed freely, provided that it is
> >   distributed in its entirety, without modifications, ...
> > This doesn't look like an open source license at all.
> > That's why Debian puts mpg123 in non-free.
> > 
> > Karel, you may want to try mpg321 instead. It already has ALSA support.
> 
> Tried with the same result: fast forward.
> 

Then the problem is probably with your ALSA configuration, or (less
likely) an ALSA bug.  I suspect your MP3s are 44100 KHz and they are
being played at 48000 KHz.  Please try ALSA CVS, there have been many
improvements since the version in the kernel.  If the problem persists,
report it on the alsa-user list.

Lee


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 21:36           ` Lee Revell
@ 2005-05-17 23:32             ` Lee Revell
  2005-05-18 13:44               ` Takashi Iwai
  0 siblings, 1 reply; 25+ messages in thread
From: Lee Revell @ 2005-05-17 23:32 UTC (permalink / raw)
  To: Karel Kulhavy; +Cc: Michal Schmidt, linux-kernel

On Tue, 2005-05-17 at 17:36 -0400, Lee Revell wrote:
> On Tue, 2005-05-17 at 23:04 +0200, Karel Kulhavy wrote:
> > On Tue, May 17, 2005 at 09:28:03PM +0200, Michal Schmidt wrote:
> > > Lee Revell wrote:
> > > >mpg123 is an open source application so there's no excuse for it not to
> > > >support ALSA in 2005.
> > > 
> > > Its COPYING file says:
> > >   This software may be distributed freely, provided that it is
> > >   distributed in its entirety, without modifications, ...
> > > This doesn't look like an open source license at all.
> > > That's why Debian puts mpg123 in non-free.
> > > 
> > > Karel, you may want to try mpg321 instead. It already has ALSA support.
> > 
> > Tried with the same result: fast forward.
> > 
> 
> Then the problem is probably with your ALSA configuration, or (less
> likely) an ALSA bug.  I suspect your MP3s are 44100 KHz and they are
> being played at 48000 KHz.

OK, I found this bug report that describes the same problem:

https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1098

The short answer is that you need to have mpg321 use the "plug:dmix"
device.

Lee


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 20:27         ` Valdis.Kletnieks
  2005-05-17 20:36           ` Lee Revell
@ 2005-05-18  6:30           ` ross
  2005-05-18  8:42             ` Lee Revell
                               ` (2 more replies)
  2005-05-18 13:48           ` Takashi Iwai
  2 siblings, 3 replies; 25+ messages in thread
From: ross @ 2005-05-18  6:30 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Karel Kulhavy, Lee Revell, linux-kernel

On Tue, May 17, 2005 at 04:27:44PM -0400, Valdis.Kletnieks@vt.edu wrote:
> I was hoping somebody would explain how to get 'dmix' plugin working in the
> kernel - then I could get rid of esd ;)  (Note that running something in
> userspace that accepts connections, runs dmix on them, and then creates one
> thing spewing to /dev/pcm isn't a solution - I've already *got* esd, warts and all)


In all honesty - don't bother.  esd does the job better, faster, more
flexibly, and without the hassle.

I have spent many hours attempting to get a usable dmix setup working
and I just don't think its possible (at least not with my hardware).

I use esd for all "consumer" level audio apps, and jackd for all
professional audio apps.  This is by far the simplest way to manage
audio - I wouldn't waste your time with dmix.  After all, what could
you do with dmix that you can't do with esd??


-- 
Ross Vandegrift
ross@lug.udel.edu

"The good Christian should beware of mathematicians, and all those who
make empty prophecies. The danger already exists that the mathematicians
have made a covenant with the devil to darken the spirit and to confine
man in the bonds of Hell."
	--St. Augustine, De Genesi ad Litteram, Book II, xviii, 37

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-18  6:30           ` ross
@ 2005-05-18  8:42             ` Lee Revell
  2005-05-18 13:21             ` Karel Kulhavy
  2005-05-18 13:50             ` Nix
  2 siblings, 0 replies; 25+ messages in thread
From: Lee Revell @ 2005-05-18  8:42 UTC (permalink / raw)
  To: ross; +Cc: Valdis.Kletnieks, Karel Kulhavy, linux-kernel

On Wed, 2005-05-18 at 02:30 -0400, ross@lug.udel.edu wrote:
> On Tue, May 17, 2005 at 04:27:44PM -0400, Valdis.Kletnieks@vt.edu wrote:
> > I was hoping somebody would explain how to get 'dmix' plugin working in the
> > kernel - then I could get rid of esd ;)  (Note that running something in
> > userspace that accepts connections, runs dmix on them, and then creates one
> > thing spewing to /dev/pcm isn't a solution - I've already *got* esd, warts and all)
> 
> 
> In all honesty - don't bother.  esd does the job better, faster, more
> flexibly, and without the hassle.
> 

This problem is fixed with the upcoming ALSA 1.0.9 release - dmix will
"just work".  It's been a big area of development lately.

Lee


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 19:24       ` Karel Kulhavy
  2005-05-17 19:32         ` Lee Revell
  2005-05-17 20:27         ` Valdis.Kletnieks
@ 2005-05-18  9:22         ` Pavel Machek
  2 siblings, 0 replies; 25+ messages in thread
From: Pavel Machek @ 2005-05-18  9:22 UTC (permalink / raw)
  To: Karel Kulhavy; +Cc: Lee Revell, linux-kernel

Hi!

> > Finally, these questions are all OT for LKML.  Try alsa-user at
> > lists.sf.net and alsa-devel at lists.sf.net.  Also there's a bug
> 
> ALSA is a part of Linux kernel, right? This is linux-kernel. Why
> is it OT here? Doesn't make sense for me.

You should use most specific list available. That's what they are
for. And it seems to me half of your problems is in userspace, so it
is indeed off-topic here.
								Pavel

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-18  6:30           ` ross
  2005-05-18  8:42             ` Lee Revell
@ 2005-05-18 13:21             ` Karel Kulhavy
  2005-05-18 13:50             ` Nix
  2 siblings, 0 replies; 25+ messages in thread
From: Karel Kulhavy @ 2005-05-18 13:21 UTC (permalink / raw)
  To: ross; +Cc: linux-kernel

On Wed, May 18, 2005 at 02:30:14AM -0400, ross@jose.lug.udel.edu wrote:
> On Tue, May 17, 2005 at 04:27:44PM -0400, Valdis.Kletnieks@vt.edu wrote:
> > I was hoping somebody would explain how to get 'dmix' plugin working in the
> > kernel - then I could get rid of esd ;)  (Note that running something in
> > userspace that accepts connections, runs dmix on them, and then creates one
> > thing spewing to /dev/pcm isn't a solution - I've already *got* esd, warts and all)
> 
> 
> In all honesty - don't bother.  esd does the job better, faster, more
> flexibly, and without the hassle.

Is there some generic in-kernel support for mixing? I couldn't make
any of the userspace programs work.

I tried esd and it does the same as without esd - only one app gets to
the sound and the other waits.  The only difference was only (horrible)
increase in sound latency.

Installed esd in gentoo by emerge, then added into the startiup scripts,
/etc/init.d/esd start, switched xmms over to esd and skype on start said
"using esd". 

I would like to just run two sound programs concurrently. (Linux is a
time-sharing operating system, right?) I am not interested in a delay
line sound effect.

I also tried artsd and jack, but didn't succeed too.

CL<

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 20:36           ` Lee Revell
@ 2005-05-18 13:32             ` Karel Kulhavy
  2005-05-18 13:53               ` Jaroslav Kysela
  0 siblings, 1 reply; 25+ messages in thread
From: Karel Kulhavy @ 2005-05-18 13:32 UTC (permalink / raw)
  To: Lee Revell; +Cc: linux-kernel

On Tue, May 17, 2005 at 04:36:30PM -0400, Lee Revell wrote:

[...]

> alsa-lib, which is part of userspace.  From the application's point of
> view, it does not matter whether the mixing happens in kernel or not.
> ALSA follows the philosophy of doing as little as possible in the
> kernel, and since mixing and volume control work fine in userspace,
> that's where they live.

Mixing is IMHO action that should be in kernel because

1) needs realtime scheduling to keep latency down
2) needs tight cooperation with the hardware to prevent dropouts
on underruns
3) Is a trivial linear algorithm involving memory blocks and linear
   arithmetic, no complicated computations that are difficult to
   check for BugFree(TM) so shouldn't present a great risk on kernel
   stability
4) Fits into the kernel philosophy. Kernel is a program meant to provide
   time-sharing access to limited hardware resource. Sound card is a
   limited hardware resource.
5) From the knowledge of the exact hardware, the mixing routine in
   kernel can know maximum allowable levels etc. to prevent clipping.
   

CL<

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 23:32             ` Lee Revell
@ 2005-05-18 13:44               ` Takashi Iwai
  0 siblings, 0 replies; 25+ messages in thread
From: Takashi Iwai @ 2005-05-18 13:44 UTC (permalink / raw)
  To: Lee Revell; +Cc: Karel Kulhavy, Michal Schmidt, linux-kernel

At Tue, 17 May 2005 19:32:22 -0400,
Lee Revell wrote:
> 
> On Tue, 2005-05-17 at 17:36 -0400, Lee Revell wrote:
> > On Tue, 2005-05-17 at 23:04 +0200, Karel Kulhavy wrote:
> > > On Tue, May 17, 2005 at 09:28:03PM +0200, Michal Schmidt wrote:
> > > > Lee Revell wrote:
> > > > >mpg123 is an open source application so there's no excuse for it not to
> > > > >support ALSA in 2005.
> > > > 
> > > > Its COPYING file says:
> > > >   This software may be distributed freely, provided that it is
> > > >   distributed in its entirety, without modifications, ...
> > > > This doesn't look like an open source license at all.
> > > > That's why Debian puts mpg123 in non-free.
> > > > 
> > > > Karel, you may want to try mpg321 instead. It already has ALSA support.
> > > 
> > > Tried with the same result: fast forward.
> > > 
> > 
> > Then the problem is probably with your ALSA configuration, or (less
> > likely) an ALSA bug.  I suspect your MP3s are 44100 KHz and they are
> > being played at 48000 KHz.
> 
> OK, I found this bug report that describes the same problem:
> 
> https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1098

This sounds similar, but I guess it's different.

> The short answer is that you need to have mpg321 use the "plug:dmix"
> device.

The recent libao opens "default" PCM.  So, dmix should work without
any changes when you install ALSA 1.0.9(rc3).


Takashi

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-17 20:27         ` Valdis.Kletnieks
  2005-05-17 20:36           ` Lee Revell
  2005-05-18  6:30           ` ross
@ 2005-05-18 13:48           ` Takashi Iwai
  2005-05-18 14:38             ` Pierre Ossman
  2 siblings, 1 reply; 25+ messages in thread
From: Takashi Iwai @ 2005-05-18 13:48 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Karel Kulhavy, Lee Revell, linux-kernel

At Tue, 17 May 2005 16:27:44 -0400,
Valdis.Kletnieks@vt.edu wrote:
> 
> On Tue, 17 May 2005 21:24:12 +0200, Karel Kulhavy said:
> > Lee Revell wrote:
> > 
> > > Finally, these questions are all OT for LKML.  Try alsa-user at
> > > lists.sf.net and alsa-devel at lists.sf.net.  Also there's a bug
> > 
> > ALSA is a part of Linux kernel, right? This is linux-kernel. Why
> > is it OT here? Doesn't make sense for me.
> 
> I was hoping somebody would explain how to get 'dmix' plugin working in the
> kernel - then I could get rid of esd ;)

esd is working fine together with dmix.  You should try the latest
versions (of esd and alsa-lib).  The old version of esd might have a
bug.

arts had a problem, but got fixed in the recent version of alsa-lib.


Takashi

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-18  6:30           ` ross
  2005-05-18  8:42             ` Lee Revell
  2005-05-18 13:21             ` Karel Kulhavy
@ 2005-05-18 13:50             ` Nix
  2 siblings, 0 replies; 25+ messages in thread
From: Nix @ 2005-05-18 13:50 UTC (permalink / raw)
  To: ross; +Cc: linux-kernel

On 18 May 2005, ross@lug.udel.edu uttered the following:
> I use esd for all "consumer" level audio apps, and jackd for all
> professional audio apps.  This is by far the simplest way to manage
> audio

In my experience, polypaudio replaces esd with something both simpler
and more powerful. (Oh, and without esd's *horrible* stutter,
interruption, mis-authentication, and code cleanliness problems.)

(For the professional stuff there is no replacement for JACK, I agree.)

-- 
`End users are just test loads for verifying that the system works, kind of
 like resistors in an electrical circuit.' - Kaz Kylheku in c.o.l.d.s

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-18 13:32             ` Karel Kulhavy
@ 2005-05-18 13:53               ` Jaroslav Kysela
  2005-05-18 17:47                 ` Lee Revell
  0 siblings, 1 reply; 25+ messages in thread
From: Jaroslav Kysela @ 2005-05-18 13:53 UTC (permalink / raw)
  To: Karel Kulhavy; +Cc: Lee Revell, linux-kernel

On Wed, 18 May 2005, Karel Kulhavy wrote:

> On Tue, May 17, 2005 at 04:36:30PM -0400, Lee Revell wrote:
> 
> [...]
> 
> > alsa-lib, which is part of userspace.  From the application's point of
> > view, it does not matter whether the mixing happens in kernel or not.
> > ALSA follows the philosophy of doing as little as possible in the
> > kernel, and since mixing and volume control work fine in userspace,
> > that's where they live.
> 
> Mixing is IMHO action that should be in kernel because
> 
> 1) needs realtime scheduling to keep latency down

With a realtime scheduler and properly written drivers (no "schedule"  
gaps) you'll reach same results. For x86 we use special instructions like
xchg and locking-free algorithm in dmix, so the latency is SAME for all 
concurent apps with minimal overhead..

> 2) needs tight cooperation with the hardware to prevent dropouts
> on underruns

Yes, but having the code which computes something in interrupt is not 
sane.

> 3) Is a trivial linear algorithm involving memory blocks and linear
>    arithmetic, no complicated computations that are difficult to
>    check for BugFree(TM) so shouldn't present a great risk on kernel
>    stability

You need to write complete new virtual layer or use a new special driver 
which connect to real soundcard. Thats a lot of new code - it's better to 
do it safely in the user space.

> 4) Fits into the kernel philosophy. Kernel is a program meant to provide
>    time-sharing access to limited hardware resource. Sound card is a
>    limited hardware resource.

Why X drivers aren't in kernel, too? Because they're big and kernel should
drive the real bottom of hardware (interrupts, DMA, memory mapping), but
abstraction (which sound mixing _IS_) should be implemented in the user 
space. Otherwise we will end up with a huge kernel implementing nearly 
everything...

> 5) From the knowledge of the exact hardware, the mixing routine in
>    kernel can know maximum allowable levels etc. to prevent clipping.

You can obtain all necessary info in the userspace as well.

We should definitely fix the dmix bugs. Or, if you want, you might buy
an accelerated soundcard which supports multiple streams in hardware.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-18 13:48           ` Takashi Iwai
@ 2005-05-18 14:38             ` Pierre Ossman
  2005-05-18 18:25               ` Lee Revell
  2005-05-19 15:10               ` Valdis.Kletnieks
  0 siblings, 2 replies; 25+ messages in thread
From: Pierre Ossman @ 2005-05-18 14:38 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Valdis.Kletnieks, Karel Kulhavy, Lee Revell, linux-kernel

Takashi Iwai wrote:
> 
> esd is working fine together with dmix.  You should try the latest
> versions (of esd and alsa-lib).  The old version of esd might have a
> bug.
> 

I'd beg to differ. I have to apply the patch made by you to avoid
getting a lot of distortions with esound and dmix:

http://bugzilla.gnome.org/show_bug.cgi?id=140803

Checking in the cvs, this still hasn't been commited.

Rgds
Pierre

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-18 13:53               ` Jaroslav Kysela
@ 2005-05-18 17:47                 ` Lee Revell
  0 siblings, 0 replies; 25+ messages in thread
From: Lee Revell @ 2005-05-18 17:47 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Karel Kulhavy, linux-kernel

On Wed, 2005-05-18 at 15:53 +0200, Jaroslav Kysela wrote:
> On Wed, 18 May 2005, Karel Kulhavy wrote:
> 
> > On Tue, May 17, 2005 at 04:36:30PM -0400, Lee Revell wrote:
> > 
> > [...]
> > 
> > > alsa-lib, which is part of userspace.  From the application's point of
> > > view, it does not matter whether the mixing happens in kernel or not.
> > > ALSA follows the philosophy of doing as little as possible in the
> > > kernel, and since mixing and volume control work fine in userspace,
> > > that's where they live.
> > 
> > Mixing is IMHO action that should be in kernel because
> > 
> > 1) needs realtime scheduling to keep latency down
> 
> With a realtime scheduler and properly written drivers (no "schedule"  
> gaps) you'll reach same results. For x86 we use special instructions like
> xchg and locking-free algorithm in dmix, so the latency is SAME for all 
> concurent apps with minimal overhead..

Also doing it in userspace lets us use SSE/MMX.

Lee


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-18 14:38             ` Pierre Ossman
@ 2005-05-18 18:25               ` Lee Revell
  2005-05-19 15:10               ` Valdis.Kletnieks
  1 sibling, 0 replies; 25+ messages in thread
From: Lee Revell @ 2005-05-18 18:25 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Takashi Iwai, Valdis.Kletnieks, Karel Kulhavy, linux-kernel

On Wed, 2005-05-18 at 16:38 +0200, Pierre Ossman wrote:
> Takashi Iwai wrote:
> > 
> > esd is working fine together with dmix.  You should try the latest
> > versions (of esd and alsa-lib).  The old version of esd might have a
> > bug.
> > 
> 
> I'd beg to differ. I have to apply the patch made by you to avoid
> getting a lot of distortions with esound and dmix:
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=140803
> 
> Checking in the cvs, this still hasn't been commited.

You really need to bug the Gnome developers about it.  Takashi-san
posted the patch in January, and the bug is still listed as NEW.

Lee


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: software mixing in alsa
  2005-05-18 14:38             ` Pierre Ossman
  2005-05-18 18:25               ` Lee Revell
@ 2005-05-19 15:10               ` Valdis.Kletnieks
  1 sibling, 0 replies; 25+ messages in thread
From: Valdis.Kletnieks @ 2005-05-19 15:10 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Takashi Iwai, Karel Kulhavy, Lee Revell, linux-kernel

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

On Wed, 18 May 2005 16:38:01 +0200, Pierre Ossman said:

> I'd beg to differ. I have to apply the patch made by you to avoid
> getting a lot of distortions with esound and dmix:
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=140803
> 
> Checking in the cvs, this still hasn't been commited.

I owe Takashi a beer for creating the patch, and Pierre for bringing it
to my attention - it solves the issue I was seeing on Fedora Core where
alsa 1.0.9rc2 was hosing up esd.

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2005-05-19 15:38 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-17  9:56 software mixing in alsa Karel Kulhavy
2005-05-17 10:08 ` Jan Spitalnik
2005-05-17 14:13   ` Karel Kulhavy
2005-05-17 18:32     ` Lee Revell
2005-05-17 19:24       ` Karel Kulhavy
2005-05-17 19:32         ` Lee Revell
2005-05-17 20:27         ` Valdis.Kletnieks
2005-05-17 20:36           ` Lee Revell
2005-05-18 13:32             ` Karel Kulhavy
2005-05-18 13:53               ` Jaroslav Kysela
2005-05-18 17:47                 ` Lee Revell
2005-05-18  6:30           ` ross
2005-05-18  8:42             ` Lee Revell
2005-05-18 13:21             ` Karel Kulhavy
2005-05-18 13:50             ` Nix
2005-05-18 13:48           ` Takashi Iwai
2005-05-18 14:38             ` Pierre Ossman
2005-05-18 18:25               ` Lee Revell
2005-05-19 15:10               ` Valdis.Kletnieks
2005-05-18  9:22         ` Pavel Machek
2005-05-17 19:28       ` Michal Schmidt
2005-05-17 21:04         ` Karel Kulhavy
2005-05-17 21:36           ` Lee Revell
2005-05-17 23:32             ` Lee Revell
2005-05-18 13:44               ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).