Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: alsa-devel@lists.sourceforge.net
Subject: Feature request: PCM volume control per snd_pcm_open().
Date: Mon, 03 Nov 2003 11:30:56 +0000	[thread overview]
Message-ID: <3FA63C70.5050203@superbug.demon.co.uk> (raw)

Hi,

When playing some audio from multiple sources to the same sound card, 
one would like to have: -

PCM1 -> Volume1 -> MixerA -> PCM Volume -> Mixer B -> Speakers.
PCM2 -> Volume2 -----^

But currently one has: -
PCM1 -> MixerA -> PCM Volume -> MixerB -> Speakers.
PCM2 ----^

MixerA is a harware mixer on Multi-open cards, and dmix software mixer 
on Single-open cards.
MixerB is normally the Mixer in the AC97 chip.
PCM1 is audio from application 1
PCM2 is audio from application 2
Volume1 should be controlled by application1, and changing the Volume1 
should only effect the volume of the sound coming from application2

Suggested API: -
fd = snd_pcm_open("front")
set all the hw and sw values. (Sample rate etc.)

Then, anytime during playback of sound, one can call: -
snd_pcm_volume(fd, VOL) where VOL is the dB value to set.

Then alsa-lib will do software volume control on every snd_pcm_write() call.
The default value for snd_pcm_volume will be 0 dB, so that the software 
volume function would then be a "no operation".

One might want to expand this so that one has a VOL level for each 
channel in the PCM.

I think that this sort of api would make life a lot easier for 
applications that only want to adjust the volume of their own output, 
and don't want to talk to the entire mixer with all it's multitude of 
controls.

Summary: -
Provide an api call so an application can adjust the audio volume of 
it's own output without effecting other application's volume settings.

Cheers
James



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/

                 reply	other threads:[~2003-11-03 11:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3FA63C70.5050203@superbug.demon.co.uk \
    --to=james@superbug.demon.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox