alsa-lib Virtual Volume control
I'm trying to create a virtual volume control that acts as a Line Playback Volume (or master, if you prefer). I modified control_hw.c in order to intercept r/w operations on the following controls:
PCM out volume
Monitor mixer
Virtual volume
On writes to PCM-out it has to write the values modified by vvol. That's ok, but how can I make alsa-lib to not deliver the events about PCM out when they are generated by a write to vvol ? I also need to keep the settings of the virtual mixer and PCM out controls somewhere and system-wide. Is it fine to add two fake controls to store them ?
--
Giuliano.
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Hi,
seems that I overlooked this post.
At Thu, 22 Sep 2005 17:36:52 +0200 (CEST),
Quoted 7 lines · Giuliano Pochini
I'm trying to create a virtual volume control that acts as a Line Playback Volume (or master, if you prefer). I modified
control_hw.cin order to intercept r/w operations on the following controls:
Quoted 7 lines
PCM out volume
Monitor mixer
Virtual volumeOn writes to PCM-out it has to write the values modified by vvol. That's ok, but how can I make alsa-lib to not deliver the events about PCM out when they are generated by a write to vvol ?
I don't understand the question well, especially the relation among the controls above. Which controls are "real" controls and which are virtual? What kind of behavior is expected by each?
Quoted 3 lines
I also need to keep the settings of the virtual mixer and PCM out controls somewhere and system-wide. Is it fine to add two fake controls to store them ?
I've been thinking of other ways, but concluded that creating user-defined controls is the easiest way, so far.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
Quoted 9 lines · On 17-Oct-2005 Takashi Iwai wrote:
Quoted 9 lines
I'm trying to create a virtual volume control that acts as a Line Playback Volume (or master, if you prefer). I modified
control_hw.cin order to intercept r/w operations on the following controls:PCM out volume
Monitor mixer
Virtual volume
Quoted 7 lines
Quoted 3 lines
On writes to PCM-out it has to write the values modified by vvol. That's ok, but how can I make alsa-lib to not deliver the events about PCM out when they are generated by a write to vvol ?
I don't understand the question well, especially the relation among the controls above. Which controls are "real" controls and which are virtual? What kind of behavior is expected by each?
They all become virtual because the real values of hw controls are not available for the user anymore. The user accesses to v_controls instead. "Virtual volume" (v_vol) is the software control I wish to add, without removing pcm and monitor volumes. All gains are expressed in dB. pcmvol and monitor (without the v_) are the real hw controls. Briefly, I want to do the following:
v_vol.read(out) {
return v_vol.gain[out]
}
v_vol.write(out, gain) {
v_vol.gain[out]=gain;
/**** do not deliver monitor and pcmout events here !! ****/
// v_vol acts as a master volume, so we tweak all output gains to simulate it
for-each-input {
monitor.write(out, in, v_monitor.gain[out][in] + v_vol.gain[out]);
}
pcmvol.write(out, v_pcmvol.gain[out] + v_vol.gain[out]);
}v_pcmvol.read(out) {
return v_pcmvol.gain[out];
}v_pcmvol.write(out, gain) {
v_pcmvol.gain[out]=gain;
pcmvol.write(out, v_pcmvol.gain[out] + v_vol.gain[out]);
}v_monitor.read(out, in) {
return v_monitor.gain[out][in];
}v_monitor.write(out, in, gain) {
v_monitor.gain[out][in]=gain;
monitor.write(out, in, v_monitor.gain[out][in] + v_vol.gain[out]);
}--
Giuliano.
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl