Forums - Bug in Hexagon SDK doc, example code to set module parameter from HLOS

2 posts / 0 new
Last post
Bug in Hexagon SDK doc, example code to set module parameter from HLOS
hotaabhijit777
Join Date: 30 Jan 21
Posts: 1
Posted: Sat, 2021-01-30 02:09

There seems to be a mistake in the Hexagin SDK document that needs to be corrected.

In the documengt page detailing the steps to carry out audio calibration for predefined / custom modules, there is an example provided to set modue paramters --> file:///C:/Qualcomm/Hexagon_SDK/3.5.2/docs/Audio/audio_calibration_using_app.html#Set%20data%20of%20one%20parameter.

int[] param_data = [0x4000, 0x8000]; // volume1 and volume 2
String value = b64encode(param_data);

String key= "cal_persist=0;cal_devid=2;cal_apptype=69936;cal_caltype=0;cal_samplerate=48000;cal_topoid=0x10000001;cal_moduleid=0x10001111;cal_paramid=0x10001112;";
key = key + "cal_data=";
key = key + param_data;
AudioManager aManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
aManager.setParameters(key);

 

The example intends to take the param data set, encode it in base64, and add it to the set of kv pairs to be set by the acdb-loader helper functions triggered via audiomanager API. The "cal_data" value should be set as the encoded data string. However, the example incorrectly sets it to the integer value itself (param_data)

  •  

The correct code should be something like this (tried and tested):

int[] param_data = [0x4000, 0x8000]; // volume1 and volume 2
String value = b64encode(param_data);

String key= "cal_persist=0;cal_devid=2;cal_apptype=69936;cal_caltype=0;cal_samplerate=48000;cal_topoid=0x10000001;cal_moduleid=0x10001111;cal_paramid=0x10001112;";
key = key + "cal_data=";
key = key + value;
AudioManager aManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
aManager.setParameters(key);

- Abhijit Hota

  • Up0
  • Down0
hsinih
Join Date: 22 May 19
Posts: 3
Posted: Thu, 2021-02-18 12:08

Hello Abhijit,

Thank you for bringing this to our attention. We will make the change in the upcoming release.

Thanks,

Hsin-I

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.