[alsa-devel] [Sound-open-firmware] [PATCH v4 02/14] ASoC: SOF: Add Sound Open Firmware KControl support

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Thu Feb 14 15:35:48 CET 2019


On 2/14/19 3:30 AM, Takashi Iwai wrote:
> On Wed, 13 Feb 2019 23:07:22 +0100,
> Pierre-Louis Bossart wrote:
>>
>> +int snd_sof_bytes_ext_put(struct snd_kcontrol *kcontrol,
>> +			  const unsigned int __user *binary_data,
>> +			  unsigned int size)
>> +{
>> +	struct soc_bytes_ext *be =
>> +		(struct soc_bytes_ext *)kcontrol->private_value;
>> +	struct snd_sof_control *scontrol = be->dobj.private;
>> +	struct snd_sof_dev *sdev = scontrol->sdev;
>> +	struct sof_ipc_ctrl_data *cdata = scontrol->control_data;
>> +	struct snd_ctl_tlv header;
>> +	const struct snd_ctl_tlv __user *tlvd =
>> +		(const struct snd_ctl_tlv __user *)binary_data;
> ....
> 
> Do we keep supporting TLV-typed ext access in SOF?
> This seems to be disliked nowadays (since it's a sort of abuse of TLV
> API), and we agreed for dropping / reducing it.

I started working on a replacement of the TLV w/ the hw-dep and showed 
it could be introduced fairly easily in the topology with minor changes 
to the kernel interfaces.

https://github.com/plbossart/sound/commits/proto/hwdep
https://github.com/plbossart/alsa-lib/tree/proto/hwdep

However the big open is linking this hw-dep element in DAPM, so that 
it's handled in the same way as existing controls - specifically that 
the state is restored on resume. That part looked really invasive and 
complicated. I was even tempted to consider flipping the approach and 
define a new control that would expose a hw-dep interface to reuse a lot 
of the DAPM integration.

In short, we know the TLV is not the path forward, and as soon as we 
have a replacement we'll switch. For now we have no alternative.


More information about the Alsa-devel mailing list