mirror of https://github.com/thesofproject/sof.git
volume: fix fadeout curve shape
Fadeout curve had inaccurate shape due to incorrect computation of ramp function. Suggested by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
This commit is contained in:
parent
278ecc5b74
commit
40a6fc7dab
|
@ -241,6 +241,13 @@ static inline int32_t volume_windows_fade_ramp(struct vol_data *cd, int32_t ramp
|
||||||
return cd->tvolume[channel];
|
return cd->tvolume[channel];
|
||||||
|
|
||||||
time_ratio = (((int64_t)ramp_time) << 30) / (cd->initial_ramp << 3);
|
time_ratio = (((int64_t)ramp_time) << 30) / (cd->initial_ramp << 3);
|
||||||
|
if (volume_delta < 0) {
|
||||||
|
time_ratio = (1 << 30) - time_ratio;
|
||||||
|
pow_value = volume_pow_175(time_ratio);
|
||||||
|
return cd->tvolume[channel] - Q_MULTSR_32X32((int64_t)volume_delta,
|
||||||
|
pow_value, 16, 30, 16);
|
||||||
|
}
|
||||||
|
|
||||||
pow_value = volume_pow_175(time_ratio);
|
pow_value = volume_pow_175(time_ratio);
|
||||||
return cd->rvolume[channel] + Q_MULTSR_32X32((int64_t)volume_delta, pow_value, 16, 30, 16);
|
return cd->rvolume[channel] + Q_MULTSR_32X32((int64_t)volume_delta, pow_value, 16, 30, 16);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue