[alsa-devel] [PATCH 8/8] ASoC: rsnd: Add Volume Ramp support

Kuninori Morimoto kuninori.morimoto.gx at gmail.com
Thu Oct 30 01:28:19 CET 2014


Hi Mark

> > Current "DVC Out Ramp Period" wants to have direct value of register.
> > But, upstream want to have time like this ?
> 
> Yes, please - much easier for users.

OK, will try again

> >    000:  1 time
> >    ...
> >    031:  0.5 time
> >    ...
> >    3FE:  4.1 x 10^-7 time
> >    3FF:  Mute
> 
> > Maybe I can used inverted value for it ?
> 
> That sounds like it'd address part of it, though I'm still not 100% sure
> what the effect of this control is - is it the final value or something
> (0.5*programmed volume for example)?

In easy explain,
we can set "Volume Ramp Period" (= it will be "time" instead),
and "Volume scale". see below...

/*
 * we already have default Volume here.
 * I use it as "volume X"
 */

/*
 * This sample want to use "Volume Up"
 * Mute -> volume X
 */

/*
 * target volume for "start" is Mute.
 * volume X x 0 time = volume 0
 */
amixer set "DVC Out Ramp" 0%		// Mute as default

/*
 * We want to Volume up in 15sec
 */
amixer set "DVC Out Ramp Period" 15000

/*
 * Start sound playback with Volume Ramp
 */
amixer set "DVC Out Ramp Enable" on
aplay xxx.wav &

/*
 * Volume up. Mute -> volume X
 * Current Volume = Mute =
 *    volume X x 0 time = volume 0
 * Set next target volume
 *    volume X x 1 time = volume X
 */
amixer set "DVC Out Ramp" 100%		// to Volume 100%

/*
 * Back to Mute again
 * Current Volume =
 *    volume X x 1 time = volume X
 * Set next target volume
 *    volume X x 0 time = volume 0
 */
amixer set "DVC Out Ramp" 0%		// to Mute


Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list