Support for volume controls in SOF plugin#9446
Conversation
2665f76 to
261ac41
Compare
|
@ranj063 in Internal Intel CI System/merge/build west compilation failed probably due to lack of ';' |
261ac41 to
c0459d0
Compare
| struct ipc *ipc = ipc_get(); | ||
|
|
||
| /* copy the extension from the message reply */ | ||
| reply->extension.dat = msg_reply.extension; |
There was a problem hiding this comment.
this change will affect the "normal" on-DSP use-case?
| /* skip kcontrols for now */ | ||
| if (tplg_create_controls(ctx, ctx->widget->num_kcontrols, | ||
| tplg_ctl, ctx->hdr->payload_size, &volume) < 0) { | ||
| tplg_ctl, ctx->hdr->payload_size, comp_info) < 0) { |
There was a problem hiding this comment.
usually when a parameter is changed the function should be changed too, unless the parameter is ignored there
There was a problem hiding this comment.
@lyakh this parameter has been unused so far. It will only be used in the following patch
| uint64_t q31val = ((uint64_t)val) << 15; | ||
|
|
||
| ctl->volume_table[i] = q31val > SOF_IPC4_VOL_ZERO_DB ? | ||
| SOF_IPC4_VOL_ZERO_DB : q31val; |
There was a problem hiding this comment.
is some kind of a MIN() macro available?
There was a problem hiding this comment.
This code is copied as is from the linux driver. Is it OK to leave it as is for the sake of consistency?
kv2019i
left a comment
There was a problem hiding this comment.
Minor comments inline, but no blockers really.
| struct ipc *ipc = ipc_get(); | ||
|
|
||
| /* copy the extension from the message reply */ | ||
| reply->extension.dat = msg_reply.extension; |
| if (err < 0) { | ||
| SNDERR("error: invalid name for IPC rx mq %s\n", plug->tplg_file); | ||
| goto error; | ||
| } |
There was a problem hiding this comment.
This is a bit surprising to see the msg queue implementation change as part of this commit -- so to support volume controls, you need to change the IPC machinery quite a bit.
There was a problem hiding this comment.
@kv2019i the msg queue implementation has not been changed in this commit. The original implementation never worked. So it has been fixed to work here
There was a problem hiding this comment.
Ack @ranj063 . Info like this is important to catch in the git commit messages as they are the permenant history and vital info anyone who needs to maintain this code later on. I see you already update the commit, so good with me.
Add the logic to copy the data to/from the mailbox when CONFIG_LIBRARY is enabled with the set_large_config and get_large_config IPCs. Also, make sure to copy the data to the mailbox along with the replay message. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for parsing just the topology file from the command line for kcontrols, modify the signature of plug_parse_conf() to add an argument to specify it. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Fix the read/write integer operations for IPC4 and the IPC messages queues in the plugin kcontrol. Convert the bytes/enum ops implementation to stubs. Support for these will be added later. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Initialize the shared memory for the global context during init so that it can be used to store the kcontrol info during topology parsing. Move the glb_ctx field from struct snd_sof_pcm to struct snd_sof_plug so that it can be accessed during topology parsing. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This will be used to store the module id and instance ID when creating the volume controls. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
c0459d0 to
525d875
Compare
Define the callback for setting up kcontrols in the plugin. Add a few new fields in struct plug_shm_ctl to store the module info and the volume table for converting mixer values to linear volume gain. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
…s for playback This will be useful to test volume controls with the plugin. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
525d875 to
d5e2a94
Compare


This PR adds the support for parsing kcontrols in the IPC4 topology and the kcontrol IO ops to volume controls in the plugin topology.