You are not logged in.
Hi
I have alsa sound platform and i am wondering if it is possible to control the volume of each application? I know it is possible with pulseaudio and OSS.
If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau
Registered Linux User: #559057
Offline
I think this is possible through ALSA's "dmix", but I'm not entirely certain. (http://alsa.opensrc.org/Dmix#Default_PCM_device)
You're probably better off handling per-application volume through another sound platform such as the two you mentioned, JACK, aRTS, or something.
Offline
arts was used in kde3. Now the standard is pulseaudio. Pulseaudio does what you look for. With jack you can achieve that, but since jack is intended for professional audio, it is going to be a tedious task.
Offline
Thanks. I just thought that there is some way to handle it. Maybe i will try it.
If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau
Registered Linux User: #559057
Offline
I think it should work with the plug softvol if you can have your application send the audio to different plugs with different softvol.
Offline
I think it should work with the plug softvol if you can have your application send the audio to different plugs with different softvol.
What plugin or app should i use then, if any?
If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau
Registered Linux User: #559057
Offline
Hi,
below I dump .asoundrc I used some time ago. It allows to play
e.g. two audio streams at the same time with different volume:
aplay -D tnsrch1 someaudio.wav
aplay -D magnet1 otheraudio.wav
The .asoundrc has been created for a sound card with 4 capture and 4 playback channels.
pcm.!default pcm.channel1
pcm.snd_card0 {
type hw
card 0
device 0
}
ctl.snd_card0 {
type hw
card 0
device 0
}
pcm.dmix0 {
type dmix
ipc_key 1024
ipc_key_add_uid true
slave.pcm "snd_card0"
slave {
period_time 0
period_size 1024
buffer_size 4096
rate 48000
channels 4
format S32_LE
}
bindings {
0 0
1 1
2 2
3 3
}
}
ctl.dmix0 {
type hw
card 0
device 0
}
pcm.dsnoop0 {
type dsnoop
ipc_key 2048
ipc_key_add_uid true
slave.pcm "snd_card0"
slave {
period_time 0
period_size 1024
buffer_size 4096
rate 48000
channels 4
}
bindings {
0 0
1 1
2 2
3 3
}
}
ctl.dsnoop0 {
type hw
card 0
device 0
}
pcm.channel1 {
type asym
playback.pcm {
type plug
slave.pcm "dmix0"
ttable.0.0 1
}
capture.pcm {
type plug
slave.pcm "dsnoop0"
ttable.0.0 1
}
}
ctl.channel1 {
type hw
card 0
device 0
}
pcm.channel2 {
type asym
playback.pcm {
type plug
slave.pcm "dmix0"
ttable.0.1 1
}
capture.pcm {
type plug
slave.pcm "dsnoop0"
ttable.0.1 1
}
}
ctl.channel2 {
type hw
card 0
device 0
}
pcm.channel3 {
type asym
playback.pcm {
type plug
slave.pcm "dmix0"
ttable.0.2 1
}
capture.pcm {
type plug
slave.pcm "dsnoop0"
ttable.0.2 1
}
}
ctl.channel3 {
type hw
card 0
device 0
}
pcm.channel4 {
type asym
playback.pcm {
type plug
slave.pcm "dmix0"
ttable.0.3 1
}
capture.pcm {
type plug
slave.pcm "dsnoop0"
ttable.0.3 1
}
}
ctl.channel4 {
type hw
card 0
device 0
}
############################################################################
# Rufen port 2110
############################################################################
pcm.rufen {
type plug
slave.pcm "dmix0"
ttable.0.0 1
ttable.0.1 1
ttable.0.2 1
ttable.0.3 1
}
############################################################################
# Beam-Warnungen port 2001
############################################################################
pcm.beam {
type plug
slave.pcm "dmix0"
ttable.0.0 1
ttable.0.1 1
ttable.0.2 1
ttable.0.3 1
}
############################################################################
# Magnet-Warnungen port 2003
# Magnet-Warnung channel, with software controls for each channel
# channel "magnet" should be the destination for magnet currentannopuncements
# "Magnet<N>" should be used to switch a channel on or off by setting the
# volume e.g.: amixer set Magnet1 80%
############################################################################
pcm.magnet1 {
type softvol
slave.pcm "channel1"
control {
name "Magnet1"
card 0
}
}
pcm.magnet2 {
type softvol
slave.pcm "channel2"
control {
name "Magnet2"
card 0
}
}
pcm.magnet3 {
type softvol
slave.pcm "channel3"
control {
name "Magnet3"
card 0
}
}
pcm.magnet_multi {
type multi
slaves.a.pcm "magnet1"
slaves.a.channels 1
slaves.b.pcm "magnet2"
slaves.b.channels 1
slaves.c.pcm "magnet3"
slaves.c.channels 1
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave b
bindings.1.channel 0
bindings.2.slave c
bindings.2.channel 0
}
pcm.magnet {
type plug
slave.pcm "magnet_multi"
ttable.0.0 1
ttable.0.1 1
ttable.0.2 1
}
############################################################################
# Tunnel search port 2010
# Tunnes search channel, with software controls for each channel
# channel "tnsrch" should be the destination for tunnel search annopuncements
# "Tnsrch<N>" should be used to switch a channel on or offf by setting the
# volume e.g.: amixer set Tnsrch1 0%
############################################################################
pcm.tnsrch1 {
type softvol
slave.pcm "channel1"
control {
name "Tnsrch1"
card 0
}
}
pcm.tnsrch2 {
type softvol
slave.pcm "channel2"
control {
name "Tnsrch2"
card 0
}
}
pcm.tnsrch3 {
type softvol
slave.pcm "channel3"
control {
name "Tnsrch3"
card 0
}
}
pcm.tnsrch_multi {
type multi
slaves.a.pcm "tnsrch1"
slaves.a.channels 1
slaves.b.pcm "tnsrch2"
slaves.b.channels 1
slaves.c.pcm "tnsrch3"
slaves.c.channels 1
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave b
bindings.1.channel 0
bindings.2.slave c
bindings.2.channel 0
}
pcm.tnsrch {
type plug
slave.pcm "tnsrch_multi"
ttable.0.0 1
ttable.0.1 1
ttable.0.2 1
}
Offline
control the volume of each application
Each app is supposed to contain its own volume control. If not, if the app allows you to specify the output PCM, then you can set up the PCM in ~/.asoundrc
Softvol can be convenient, but is not necessary - the ttable lines can control volume.
Offline