mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-15 07:00:02 -05:00
Add support for gain in softvol plugin
This patch allows for gain in the softvol plugin, in addition to attenuation. The plugin now has a "max_dB" parameter (up to 50 dB) as well as the original "min_dB" parameter (down to -51 dB). max_dB defaults to 0 dB, so unless max_dB is specified in a device conf, the behavior of the plugin will be the same as before (attenuation only). HDA-Intel.conf is also modified to use softvol for its default capture. So now, capture is filtered through softvol (range -30 to +30 dB) before being passed on to dsnoop as before. The softvol plugin allows a range of -51 to +50 dB, so max_dB could be increased to 50. But eventually samples are going to get clipped. At 40 dB I was beginning to get clipping when recording a sample sound at a "reasonably soft" volume using a digital mic on the stac9205 HDA codec. The motivation for this work is that some HDA codecs have no hardware gain control for some paths. For instance, the stac9205 has support for digital mics, but there is no gain control widget for this signal before it is placed on the Azalia link (only a mute). Therefore gain can only be accomplished via software. Signed-off-by: Steve Longerbeam <stevel@embeddedalley.com>
This commit is contained in:
parent
577959ec87
commit
63e4c591f9
2 changed files with 104 additions and 33 deletions
|
|
@ -44,8 +44,18 @@ HDA-Intel.pcm.default {
|
|||
capture.pcm {
|
||||
type plug
|
||||
slave.pcm {
|
||||
@func concat
|
||||
strings [ "dsnoop:" $CARD ]
|
||||
type softvol
|
||||
slave.pcm {
|
||||
@func concat
|
||||
strings [ "dsnoop:" $CARD ]
|
||||
}
|
||||
control {
|
||||
name "Digital Capture Volume"
|
||||
card $CARD
|
||||
}
|
||||
min_dB -30.0
|
||||
max_dB 30.0
|
||||
resolution 121
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue