I had an interesting chat with pulseaudio's Lennart some time ago, it might interest some of you here. IMHO that Lennart seems to acknowledge this problem in pulseaudio, but also says that this could be fixed by a modification in the alsa modules (by removing all hardware volume control in alsa so that pulseaudio would take over the channel and automatically expose software amplification by scaling), and he also seems to be trying to find people asking for a fix so as to justify the work into adding softvol dB-gain to pulseaudio on top of the already existing hardware-vol dB-gain that alsa usually provides. I guess that people here and from other distros could show him that there's demand for such a fix, by commenting as much as possible on pulseaudio's corresponding bug at http://pulseaudio.org/ticket/423 and letting him know of how many people are being affected, and maybe asking pulseaudio to expose the already existing software amplification scaling to the UI, together with some dynamic range compression to avoid signal clipping. Cheers, Marcus ----- >Dear Lennart, > >I've been looking at the source code of module-alsa-source (at >http://www.pulseaudio.org/browser/branches/glitch-free/src/modules/module-alsa-source.c?rev=2308 ) >trying to understand how I could produce a +20dB software gain or so to my alsa microphone. > >Looking around lines 649 (source_get_volume_cb) and 686 (source_set_volume_cb, http://www.pulseaudio.org/browser/branches/glitch-free/src/modules/module-alsa-source.c?rev=2308#L686 ), >it seems that there is some kind of volume normalization being produced via PA_VOLUME_NORM. Do >you think if I modified PA_VOLUME_NORM, changing it to a larger value, then source_set_volume_cb >would accept larger volumes for the alsa microphone? Or is this a global parameter that would >produce out of range samples all around? > >Or is there something simpler to do (like using some volume amplifier plugin between the alsa mic >source and pulse mixer), or some pulse configuration that I could use instead (maybe something >related to ladspa, but I cannot find a pulseaudio ladspa source plugin, only a module-ladspa-sink). > >Thanks in advance, >M. ----- >> Dear Lennart, > > >I don*t think that simply scaling all PCM data with 20dB is such a >good idea, due to clipping and stuff. If you want this, then we should >add some dynamic range compression code first. > >> I've been looking at the source code of module-alsa-source (at >> http://www.pulseaudio.org/browser/branches/glitch-free/src/modules/module-alsa-source.c?rev=2308 ) >> trying to understand how I could produce a +20dB software gain or so to my >> alsa microphone. >> >> Looking around lines 649 (*source_get_volume_cb*) and 686 (* >> source_set_volume_cb*, >> http://www.pulseaudio.org/browser/branches/glitch-free/src/modules/module-alsa-source.c?rev=2308#L686 ), >> it seems that there is some kind of volume normalization being produced via >> PA_VOLUME_NORM. Do you think if I modified PA_VOLUME_NORM, changing it to a >> larger value, then source_set_volume_cb would accept larger volumes for the >> alsa microphone? Or is this a global parameter that would produce out of >> range samples all around? > >For ALSA we limit ourselves to what the hardware provides. We don't do >software volume adjustments if the hardware provides us with a certain >minimal set of featzres. > >If software volume control is done, PA will alow you to do >amplification by scaling. However, this is not exposed in the UI due >to the reasons mentioned above. If you really want this, then the >easiest way to make use of this is probably to hack the ALSA modules >to never make use of hw volume control and always do it in >software. Of course, that would be a hack, but should be OK. > >Eventually I hope to "extend" the hw provided volume scale in >software. We need this because for some hw the lowest volume setting >is not silence -- however users expect it to be. If we add this we >will also be able to provide software amplification on all devices >easily while still relying on the basic hw volume control stuff. > >Lennart > >-- >Lennart Poettering Red Hat, Inc. >lennart [at] poettering [dot] net ICQ# 11060553 >http://0pointer.net/lennart/ GnuPG 0x1A015CC4