[alsa-devel] [PATCH 2/4] snd-usb-6fire: add individual volume control for analog channels

Torsten Schenk torsten.schenk at zoho.com
Thu Jan 12 10:02:58 CET 2012


On Thu, 12 Jan 2012 07:42:19 +0100Takashi Iwai <tiwai at suse.de> wrote:
> At Thu, 12 Jan 2012 00:15:56 +0100,> Torsten Schenk wrote:> > > >  /*> > - * calculated with $value\[i\] = 128 \cdot sqrt[3]{\frac{i}{128}}$> > - * this is done because the linear values cause rapid degredation> > - * of volume in the uppermost region.> > - */> > -static const u8 log_volume_table[128] = {> > -	0x00, 0x19, 0x20, 0x24, 0x28, 0x2b, 0x2e, 0x30, 0x32, 0x34,> > -	0x36, 0x38, 0x3a, 0x3b, 0x3d, 0x3e, 0x40, 0x41, 0x42, 0x43,> > -	0x44, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e,> > -	0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x53, 0x54, 0x55, 0x56,> > -	0x56, 0x57, 0x58, 0x58, 0x59, 0x5a, 0x5b, 0x5b, 0x5c, 0x5c,> > -	0x5d, 0x5e, 0x5e, 0x5f, 0x60, 0x60, 0x61, 0x61, 0x62, 0x62,> > -	0x63, 0x63, 0x64, 0x65, 0x65, 0x66, 0x66, 0x67, 0x67, 0x68,> > -	0x68, 0x69, 0x69, 0x6a, 0x6a, 0x6b, 0x6b, 0x6c, 0x6c, 0x6c,> > -	0x6d, 0x6d, 0x6e, 0x6e, 0x6f, 0x6f, 0x70, 0x70, 0x70, 0x71,> > -	0x71, 0x72, 0x72, 0x73, 0x73, 0x73, 0x74, 0x74, 0x75, 0x75,> > -	0x75, 0x76, 0x76, 0x77, 0x77, 0x77, 0x78, 0x78, 0x78, 0x79,> > -	0x79, 0x7a, 0x7a, 0x7a, 0x7b, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c,> > -	0x7d, 0x7d, 0x7d, 0x7e, 0x7e, 0x7e, 0x7f, 0x7f };> > So, with the new implementation, you don't need the linear -> dB> conversion?I decided to change the volume slider behaviour because of theadditional information I got on the DAC. On the other hand it seemsreasonable to do that in a separate patch. I could do so in my nextsubmit.
> > >  		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,> > -		.info = usb6fire_control_master_vol_info,> > -		.get = usb6fire_control_master_vol_get,> > -		.put = usb6fire_control_master_vol_put> > +		.info = usb6fire_control_output_vol_info,> > +		.get = usb6fire_control_output_vol_get,> > +		.put = usb6fire_control_output_vol_put,> > +		.private_value = 1> >  	},> >  	{> >  		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,> > +		.name = "Output 5/6 Playback Volume",> > +		.index = 0,> > +		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,> > +		.info = usb6fire_control_output_vol_info,> > +		.get = usb6fire_control_output_vol_get,> > +		.put = usb6fire_control_output_vol_put,> > +		.private_value = 2> > +	}> > +};> > Add the terminator in this patch.  I know you fixed in the last patch> but, In general, try not to introduce a bug in each commit.  Otherwise> it'll make bisection difficult.That's right, I've overseen this problem in the first place andstumbled upon it after patch 2 and 3 have already been sent.
Thanks,Torsten



More information about the Alsa-devel mailing list