Hexagon DSP系列记录——DSP工作模式设置

Posted lligen-dai

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hexagon DSP系列记录——DSP工作模式设置相关的知识,希望对你有一定的参考价值。

Remote file system

The Remote File System is used by the loader on the Hexagon DSP to read shared object files. The shared object files are stored on the HLOS’s file system.
通过编译生成的DSP动态库有两种动态加载方式

  1. within a FastRPC invocation
    即使用rpcmem_xxx接口的方式,该方式底层依赖libadsprpc.so,默认查找路径 /vendor/lib/rfsa/dsp;/vendor/dsp,可以使用DSP_LIBRARY_PATH人为指定查找路径。
  2. outside of a FastRPC invocation
    For non-rpc started threads (calling dlopen from static DSP code), a daemon (/vendor/bin/adsprpcd) will provide the context for requests back to the android environment. Audio modules are loaded this way.(说是在Audio modules里头有用到,但我没找到怎么用的)

DSP DCVS(dynamic clock voltage scaling)

看这几个单词就感觉是性能功耗相关
sm8150支持DCVS v2,sm8250支持DCVS v3,
接口对应HAP_power_xxxx
支持performance/owersave mode等模式,或不指定。
具体设置方法参考:
file:///E:/Qualcomm/Hexagon_SDK/3.5.2/docs/Hap_power_set_dcvs_2.html
PERFORMANCE_MODE:

//Vote

/* Populate request structure */
int retVal;
HAP_power_request_t request;
memset(&request, 0, sizeof(HAP_power_request_t)); //Important to clear the structure if only selected fields are updated.
request.type = HAP_power_set_DCVS_v2;
request.dcvs_v2.dcvs_enable = TRUE;
request.dcvs_v2.dcvs_option = HAP_DCVS_V2_PERFORMANCE_MODE;
request.dcvs_v2.set_latency = TRUE;
request.dcvs_v2.latency = 1000;
request.dcvs_v2.set_dcvs_params = TRUE;
request.dcvs_v2.dcvs_params.min_corner = HAP_DCVS_VCORNER_SVS;
request.dcvs_v2.dcvs_params.max_corner = HAP_DCVS_VCORNER_TURBO;
request.dcvs_v2.dcvs_params.target_corner = HAP_DCVS_VCORNER_NOM;
/* Call HAP_power_set API with the updated request structure */
retVal = HAP_power_set(NULL, &request);
...
/* 
 * Processing block 
 */
...
//To remove the vote keeping DCVS enabled.
memset(&request, 0, sizeof(HAP_power_request_t)); //Remove all votes.
request.type = HAP_power_set_DCVS_v2;
request.dcvs_v2.dcvs_enable = TRUE;
request.dcvs_v2.dcvs_option = HAP_DCVS_V2_PERFORMANCE_MODE; //Enable DCVS
retVal = HAP_power_set(NULL, &request);

POWER_SAVER_MODE:

//Vote

/* Populate request structure with dcvs_v2 request*/
int retVal;
HAP_power_request_t request;
memset(&request, 0, sizeof(HAP_power_request_t)); //Important to clear the structure if only selected fields are updated.
request.type = HAP_power_set_DCVS_v2;
request.dcvs_v2.dcvs_enable = TRUE;
request.dcvs_v2.dcvs_option = HAP_DCVS_V2_POWER_SAVER_MODE;
request.dcvs_v2.set_dcvs_params = TRUE;
request.dcvs_v2.dcvs_params.min_corner = HAP_DCVS_VCORNER_SVS;
request.dcvs_v2.dcvs_params.max_corner = HAP_DCVS_VCORNER_TURBO;
request.dcvs_v2.dcvs_params.target_corner = HAP_DCVS_VCORNER_DISABLE; //no vote
/* Call HAP_power_set API with the updated request structure */
retVal = HAP_power_set(NULL, &request);
...
/* 
 * Processing block 
 */
...
//To remove the dcvs_v2 vote keeping DCVS enabled.
memset(&request, 0, sizeof(HAP_power_request_t)); //Remove all votes.
request.type = HAP_power_set_DCVS_v2;
request.dcvs_v2.dcvs_enable = TRUE;
request.dcvs_v2.dcvs_option = HAP_DCVS_V2_POWER_SAVER_MODE; //Enable DCVS
retVal = HAP_power_set(NULL, &request);

以上是关于Hexagon DSP系列记录——DSP工作模式设置的主要内容,如果未能解决你的问题,请参考以下文章

Hexagon DSP系列记录——写Hexagon DSP程序流程

Hexagon DSP系列记录——写Hexagon DSP程序流程

Hexagon DSP系列记录

Hexagon DSP系列记录

Hexagon DSP系列记录——DSP LOG输出

Hexagon DSP系列记录——DSP LOG输出