Skip to content

Dmic volume test - #2441

Closed
juimonen wants to merge 5 commits into
thesofproject:cml-010-drop-stablefrom
juimonen:dmic_volume_test
Closed

juimonen wants to merge 5 commits into
thesofproject:cml-010-drop-stablefrom
juimonen:dmic_volume_test

Conversation

@juimonen

Copy link
Copy Markdown

No description provided.

This patch fixes the issue of audio left muted after a cycle
of mute and unmute commands. The additional improvements are
applying of gain ramp for mute that helps to avoid annoying click
sounds. Also since the driver issues both volume and switch
commands back to back the duplicate scheduling of ramp update is
prevented if there is already a ramp happening. The old ramp
will operate based on new step and direction if it was changed.

Some variable names were changed in function volume_set_chan()
for better readability. The impacted trace print commands were
also updated to not split strings unnecessarily.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
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 patch ensures that a ramp will happen in beginning of
streaming even if the driver control sequence would not launch
it by successive volume requests for mute and actual volume.

Also a check is added into volume ramp update to prevent a volume
command in component idle state to schedule repeatedly ramp
updates. In that case the volume can be set immediately to ramp
end value.

Also the ramp is updated for active channels only. There's no need to
update for the maximum channels count.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The earlier version of ramp step calculation was more complex than
necessary and there was no way to ensure the max. topology defined
ramp time happens in beginning of streaming so the step equation
was rewritten. The step value is rounded for better match with
topology defined ramp length.

Normally the ramp is constant rate type where the topology define
time happens for vol min-max transition. A smaller transition is
completed in less time.

The constant rate mode is not used for the first copy() triggered
ramp to ensure the ramp from vol min to used volume takes the
entire topology defined time. This mode is also as earlier used
for legacy kernels where the vol min/max information is not passed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch removes a trivial function vol_update() and alters
vol_sync_host() to update all channels the same time into the
host data structure instead of per channel updates. There is no
other change to component operation.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@lgirdwood

Copy link
Copy Markdown
Member

@juimonen merge into master? please also provide a PR description.

@juimonen

Copy link
Copy Markdown
Author

@lgirdwood, no sorry, this is for 010-drop-stable, cherry-picked patches from master.

I made this just for help in testing to fix #2438. If it helps, these should be added to 010-drop-stable branch.

@sys-pt1s

Copy link
Copy Markdown

Can one of the admins verify this patch?

@kv2019i

kv2019i commented Apr 20, 2022

Copy link
Copy Markdown
Collaborator

Over a year without activity, closing.

@kv2019i kv2019i closed this Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants