[alsa-devel] [PATCH] Add support for gain in softvol plugin

Steve Longerbeam stevel at embeddedalley.com
Thu May 10 21:57:10 CEST 2007


Takashi Iwai wrote:
> At Fri, 04 May 2007 10:33:16 -0700,
> Steve Longerbeam wrote:
>   
>> Steve Longerbeam wrote:
>>     
>>> Jaroslav Kysela wrote:
>>>       
>>>> <snip>
>>>>
>>>> Please, resend your patch with this modification. Thanks.
>>>>   
>>>>         
>>> ok, here it is again, with CARD/DEV defaults moved out of alsa.conf 
>>> and into dsnoop_softvol.conf.
>>>
>>>       
>> I realized I wasn't handling max_dB < 0 (svol->zero_dB_val = 0) in all 
>> cases.
>>
>> Patch attached again along with an interdiff from my last patch.
>>     
>
> Thanks for the patch.  Now I checked this thread.
>
> Some suggestions:
>
> - "Capture SoftVol" doesn't sound like a valid mixer name.
>   "Digital Capture Volume" would be more suitable, IMO.
>
> - The range from -30 to 40dB seems too big.
>
> - We don't need a new definition of dsnoop_softvol PCM there as it's
>   specific to HDA-Intel right now.   Let's define locally like:
>
> # default with dmix+softvol & dsnoop
> HDA-Intel.pcm.default {
> 	@args [ CARD ]
> 	@args.CARD {
> 		type string
> 	}
> 	type asym
> 	playback.pcm {
> 	...
> 	}
> 	capture.pcm {
> 		type plug
> 		slave.pcm {
> 		type softvol
> 			slave.pcm {
> 				@func concat
> 				strings [ "dsnoop:" $CARD ]
> 			}
> 			control {
> 				name "Digital Capture Volume"
> 				card $CARD
> 			}
> 			min_dB -30.0
> 			max_dB 40.0
> 		}
> 	}
> }
>
>
> Takashi
>
>   

Hi Takashi,

Thanks, that's much better. I tried doing that myself a while ago, but I 
must have been doing something wrong because the capture device wasn't 
being recognized. But your version works.

Version 4 of the patch is attached. It's much better, only two modified 
files: pcm_softvol.c and HDA-Intel.conf.

I also reduced the gain range, it's now -30 to +30 dB.

Steve


-------------- next part --------------
A non-text attachment was scrubbed...
Name: softvol-gain.4.patch
Type: text/x-patch
Size: 11923 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20070510/01775f01/attachment-0001.patch 


More information about the Alsa-devel mailing list