Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Giuliano Pochini <pochini@shiny.it>
To: Ove Kaaven <ovek@transgaming.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: PCM hw mixing with volume
Date: Thu, 11 Mar 2004 10:24:27 +0100 (CET)	[thread overview]
Message-ID: <XFMail.20040311102427.pochini@shiny.it> (raw)
In-Reply-To: <1078937796.18056.355.camel@renegade>


On 10-Mar-2004 Ove Kaaven wrote:

>> Uhm... I think first of all we need a way to know how many
>> virtual channels are available (hw and sw)
>
> For the EMU10K1, snd_pcm_info_get_subdevices_count() and
> snd_pcm_info_get_subdevices_avail() works for me. But I suppose you're
> right that this isn't a good abstraction.

It isn't good because the app wants a virtually unlimited
number of channels. I was thinking of something like this:

sndhandler=PrepareToPlay(sound);
SetVolume(sndhandler, -10);
SetPan(sndhandler, 0);
or SetPosition(sndhandler, x, y, z);
SetEffect(sndhandler, foo, bar);
Start(sndhandler);

The application shouldn't have to take care of the actual
number of virtual channels the card provides other than at
initialization, eg.:

AllocSfx("hw:0,0,2", 8); /* alloc 8 vchannels starting from subdev 2 */

Then Start() will play the sound using the allocated channels
in a LRU way of something similar.


>> set_volume() should be something more generic. Think about 5.1 .
>
> I think 3D position controls or pan controls would be more appropriate
> than a more flexible volume control. Or perhaps the stream might just be
> 6-channel in the first place...

It should be possible to mix them, SFX and background music.


>> Also, the API should lay above the PCM API because, if the
>> card hasn't the required capabilities, that layer will emulate
>> it using the PCM API. Also, in some cases (eg. the Echoaudio
>> Mia and probably hdsp), that mixing feature is already
>> supported by the driver through the normal PCM and control APIs.
>
> Good point, but I wonder how 3D effects could be applied to sounds
> loaded into the card's onboard memory (via the suggested wavetable API).
> Perhaps that won't be a very important feature though.

PrepareToPlay() loads the sample and Start() plays it. It's pretty
indipendent on how the sound will be actually played (through the
PCM API of the sequencer API or whatever). As you just reminded me
some cards have onboard memory that holds MIDI instruments. It can
be used for generic sound effects as well.


>> We can define a small set of standard effects, or we can do something
>> like the control API.
>
> As far as I'm concerned, as long as the API can do what I need, it
> doesn't matter much what it looks like. DirectSound does allow
> individual drivers to implement custom device-specific effects, but I
> don't expect to really want that. Standard effects are good enough.

Stardard effects are simple, but a more generic interface is
expandable. It's like OSS control interface vs ALSA control interface.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

  reply	other threads:[~2004-03-11  9:24 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-07 14:51 PCM hw mixing with volume Ove Kaaven
2004-03-07 16:36 ` Manuel Jander
2004-03-07 16:41 ` Jaroslav Kysela
2004-03-08 16:20 ` Paul Davis
2004-03-08 21:29   ` Ove Kaaven
2004-03-09 14:26     ` Paul Davis
2004-03-09 14:59       ` Takashi Iwai
2004-03-09 17:31         ` USB audio devices Jaroslav Kysela
2004-03-10  8:26           ` Clemens Ladisch
2004-03-10  9:08             ` Jaroslav Kysela
2004-03-10  9:41               ` Takashi Iwai
2004-03-10 20:04                 ` Karsten Wiese
2004-03-11  0:13                   ` Patrick Shirkey
2004-03-11  8:09                   ` Clemens Ladisch
2004-03-10  9:41               ` Clemens Ladisch
2004-03-10 16:34             ` Takashi Iwai
2004-03-10 17:46               ` Clemens Ladisch
2004-03-11  8:14             ` Clemens Ladisch
2004-03-09 17:25       ` PCM hw mixing with volume Ove Kaaven
2004-03-09 20:24         ` Manuel Jander
2004-03-10  9:46         ` Giuliano Pochini
2004-03-10 14:16           ` Ove Kaaven
2004-03-10 14:40             ` Ove Kaaven
2004-03-10 14:53               ` Paul Davis
2004-03-10 15:08             ` Takashi Iwai
2004-03-10 16:05               ` Ove Kaaven
2004-03-10 15:55             ` Giuliano Pochini
2004-03-10 16:56               ` Ove Kaaven
2004-03-11  9:24                 ` Giuliano Pochini [this message]
2004-03-10 17:28               ` Takashi Iwai
2004-03-10 18:47             ` James Courtier-Dutton
2004-03-11  5:15               ` Manuel Jander
2004-03-11  7:13                 ` snd_intel8x0 fails after ACPI sleep gte654n
2004-03-13 18:13                   ` Christoph Lukas
2004-03-11  5:00             ` PCM hw mixing with volume Manuel Jander

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=XFMail.20040311102427.pochini@shiny.it \
    --to=pochini@shiny.it \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=ovek@transgaming.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox