mirror of https://github.com/thesofproject/sof.git
Volume: Fix for gain ramp step macro value
This patch fixes the calculation of macro VOL_RAMP_STEP_CONST that is used in linear step size calculation. The previous version calculated incorrectly the value as inverse. However with used ramp update rate of 1000 us there were no issues seen because the value and inverse were both 1.0. The bug would have triggered with with a faster or slower ramp update rate. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
parent
e0a9afe6a7
commit
e525c177b5
|
@ -77,10 +77,11 @@ struct sof_ipc_ctrl_value_chan;
|
|||
* Volume gain ramp step as Q1.16 is computed with equation
|
||||
* step = VOL_RAMP_STEP_CONST / SOF_TKN_VOLUME_RAMP_STEP_MS. This
|
||||
* macro defines as Q1.16 value the constant term
|
||||
* (1000 / VOL_RAMP_UPDATE) for step calculation.
|
||||
* VOL_RAMP_UPDATE / 1000.0 for step calculation. The value 1000
|
||||
* is used to to convert microseconds to milliseconds.
|
||||
*/
|
||||
#define VOL_RAMP_STEP_CONST \
|
||||
Q_CONVERT_FLOAT(1000.0 / VOL_RAMP_UPDATE_US, VOL_QXY_Y)
|
||||
Q_CONVERT_FLOAT(VOL_RAMP_UPDATE_US / 1000.0, VOL_QXY_Y)
|
||||
|
||||
/**
|
||||
* \brief Volume maximum value.
|
||||
|
|
Loading…
Reference in New Issue