[alsa-devel] compress: adding support for hardware dependent params
Hi,
We have a requirement, where we need to set a number of hardware specific parameters for compressed offload use-cases, before starting a stream. As these parameters need to be set once for the entire session, we would like to explore the best way to set these additional parameters somewhere before calling trigger() function. Below are few of the proposed solutions that we could think of at this point for getting this done-
1. Adding new IOCTL call: Add a new ioctl control in compress-offload.c file to handle hardware specific parameters setting. This new ioctl control will call into soc-compress.c and eventually call into platform driver ioctl to set those hardware specific parameters. In this case, we will add a new structure, let's say "snd_compr_hw_ctrl_params", with the same fields as "snd_compr_metadata" struct.
2. Adding a function hw_dependant_hw_params(), which will be called after hw_params() and before prepare() function. The new function will eventually call into the platform driver to get the hardware specific parameters set. Once implemented, this would look something like- hw_params(); hw_dependant_hw_params(); prepare();
3. Add a function "hw_dependant_hw_params()", as _part_ of the hw_params() function. This new function will be called after the (existing) generic parameters are set. So once implemented, the proposed function calls would look like- hw_params() { generic_hw_params(); hw_dependant_hw_params(); } prepare();
We would like to get feedback on these proposed solutions and get a discussion going to see how best these requirements can be fitted in the current Compressed ALSA framework (for mainlining).
Thanks and Regards, Banajit Goswami
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
We have a requirement, where we need to set a number of hardware specific parameters for compressed offload use-cases, before starting a stream. As these parameters need to be set once for the entire session, we would like to explore the best way to set these additional parameters somewhere before calling trigger() function.
I think you need to provide more context here. The compressed API provides a fair amount of information on the parameters needed to handle the stream - maybe too much in most cases -, I don't really get the rationale for hardware-specific parameters needed specifically for compressed data that you wouldn't need for PCM. I am also not clear on how we are going to agree on new hw_params that are hardware specific. Shouldn't this sort of requirement be handled through a control interface?
participants (2)
-
Banajit Goswami
-
Pierre-Louis Bossart