Skip to content

Conversation

@zhuyingjiang
Copy link

The driver currently passes the volume ramp type and length
topology tokens to firmware. The min/max fields are left zeros
(would be derived from TLV volume scale). This PR send the
linear volume min/max value to the firmware. So firmware can
use these values and current volume for any transition.
fix #922
Signed-off-by: Zhu Yingjiang yingjiang.zhu@linux.intel.com

singalsu
singalsu previously approved these changes Jun 4, 2019
Copy link

@singalsu singalsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this to work OK, thanks @zhuyingjiang!

I'll publish next the FW side PR to utilize this information. The code snippet to shorten the ramp will be needed for backwards compatibility after this only with old kernels those do not provide this information.

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The units are completely unclear, "min" and "max" could be interpreted in various ways. I strongly suggest you add a suffix so that reviewers understand what physical values are being handled. From what I understand, you pass the min/max on a linear scale after a conversion from values stored in the topology file (and I am not sure about the units there).

list_for_each_entry(scontrol, &sdev->kcontrol_list, list) {
if (scontrol->comp_id == swidget->comp_id) {
volume->min_value =
scontrol->volume_table[scontrol->min];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so scontrol->min and scontrol->max are in what units? dB, steps?

Copy link
Author

@zhuyingjiang zhuyingjiang Jun 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart it is in step, and from the struct:
struct snd_soc_tplg_mixer_control {
struct snd_soc_tplg_ctl_hdr hdr;
__le32 size; /* in bytes of this structure */
__le32 min;
__le32 max;
__le32 platform_max;
__le32 invert;
__le32 num_channels;
struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
struct snd_soc_tplg_private priv;
} __attribute__((packed));

OK, I will change to min_volume_step, and max_volume_step.

@zhuyingjiang zhuyingjiang force-pushed the topic/pass-volume-min-max-linear-value-to-FW branch from 84a4b9c to 218fa07 Compare June 5, 2019 04:13
@zhuyingjiang zhuyingjiang changed the title [RFC] ASoC: SOF: topology: pass volume min/max linear value to FW ASoC: SOF: topology: pass volume min/max linear value to FW Jun 5, 2019
@zhuyingjiang zhuyingjiang requested review from plbossart and singalsu and removed request for plbossart June 5, 2019 04:20
singalsu
singalsu previously approved these changes Jun 5, 2019
Copy link

@singalsu singalsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The previous version works OK for me, I didn't retest because this was just rename of two fields.

@singalsu
Copy link

singalsu commented Jun 5, 2019

The FW side PR is in thesofproject/sof#1523 .

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good but please try and improve the code indentation to make it readable.
Also fix the commit message
The driver currently passes the volume ramp type and length
topology tokens to firmware, but the min and max volume are not set. This patch provides a correction to convert the information from the topology file and pass the linear volume min/max value to the firmware to improve transitions.

add two units min_volume_step and max_volume_step to the snd_sof_control
struct, for the min and max step of the volume_table.

Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
The driver currently passes the volume ramp type and length
topology tokens to firmware, but the min and max volume are
not set. This patch provides a correction to convert the
information from the topology file and pass the linear volume
min/max value to the firmware to improve transitions.

Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
@zhuyingjiang zhuyingjiang force-pushed the topic/pass-volume-min-max-linear-value-to-FW branch from 218fa07 to 2f94c43 Compare June 10, 2019 06:20
@zhuyingjiang
Copy link
Author

zhuyingjiang commented Jun 10, 2019

@plbossart Updated the indention and the commit message.

Copy link

@singalsu singalsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@plbossart plbossart merged commit 24d854a into thesofproject:topic/sof-dev Jun 11, 2019
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.

Pass volume min/max linear values from actual volume scale to firmware

3 participants