Qualcomm Enhanced SDK (QESDK) API Reference (11)
-
- 5.3 Enhanced QAPE API
-
- 5.3.1 QAPE Enhanced Manager
- 5.3.1 get_gpu_headroom
- 5.4 Sample code
- 6 Location API (precise positioning)
-
- 6.1 eDGNSS subsystem
- 6.2 RTK subsystem
5.3 Enhanced QAPE API
5.3.1 QAPE Enhanced Manager
The main link enters the constructor of the enhanced QAPE subsystem.
QAPE_enhancedManager()
Parameters
Qesdk
Proven IQesdk interface
Return results
QAPE_enhancedManager
subsystem manager object
5.3.1 get_gpu_headroom
Returns the average/minimum GPU headroom percentage available during the most recent “duration” seconds. Applications use the get_gpu_headroom() API to get feedback on historical application rendering workloads to know whether the workload is GPU-bound on the SoC. This API is designed to help provide GPU performance information for application content and help drive workloads, as well as provide additional APIs to ensure smooth and sustained UX performance (minimize frame drops, reduce UI latency). App can monitor temperature. If the mobile device temperature approaches the thermal limit, a further check is made to see if the workload is GPU-bound to see if reducing the GPU load can help mitigate the thermal state (<= LIGHT), thereby improving persistent performance.
Note:
GPU headroom calculations take into account the maximum GPU frequency scaling when scaling for temperature rise.
Note:
This API only applies to games, as games are considered a GPU-heavy use case. For regular applications, this API returns -1.
5.4 Sample code
Java Example
Java
Need to import
import com.qualcomm.qti.qesdk.Performance.*; import com.qualcomm.qti.qesdk.QesdkStatusException; import com.qualcomm.qti.qesdkIntf.IQesdk;
initialization
IQesdk qesdkManager = Iqesdk.createInstance(getApplicationContext()); int statusId = qesdkManager.init(eventCallbackHandler); QAPEManager perfManager = new QAPEManager(qesdkManager); QAPE_enhancedManager enhancedPerfManager = new QAPE_enhancedManager(qesdkManager); int setPkgStatus = perfManager.set_pkg(getApplicationContext().getPackageName()); int ret = perfManager->set_pkg(pkg_name);
Set callback
IQesdkEventCallBack eventCallbackHandler = new IQesdkEventCallBack() {<!-- --> @Override public void onEvent(int opcode, int[] subsys) {<!-- --> // Handle QESDK event } };
CPU speed up
int retStatus = perfManager.boost_cpu(cpuBoostPercentage);
GPU speedup
retStatus = perfManager.boost_gpu(gpuBoostPercentage);
Prompt for high CPU utilization
retStatus = perfManager.hint_high_cpuutil(tid);
Tips for low CPU utilization
retStatus = perfManager.hint_low_cpuutil(tid);
Tips for low latency
retStatus = perfManager.hint_low_latency(tid);
Prompt thread pipeline
retStatus = perfManager.hint_thread_pipeline(threadIds);
Release thread prompt
retStatus = perfManager.release_thread_hints(0,tid);
Get GPU headroom
retStatus = enhancedPerfManager.get_gpu_headroom(gpuDuration, gpuHeadroomType);
Native example
Native
What to include
#include "qesdk_ndk.h" #include "qesdk_Performance_QAPE.h" #include "qesdk_Performance_QAPE_enhanced.h"
initialization
qesdk_handle_t qesdk_handle = qesdk_init(nativeLicense, len, event_callback_handler); QAPEManager *perfManager = new QAPEManager(); QAPE_enhancedManager *perfEnhManager = new QAPE_enhancedManager(); int intRet = perfManager->init(nativeLicense, len, event_callback_handler); intRet = perfEnhManager->init(nativeLicense, len, event_callback_handler);
Set callback
void event_callback_handler(uint32_t opcode, uint32_t subsys[]) {<!-- --> // Callback to handle QESDK events }
CPU speed up
int ret = perfManager->boost_cpu(nBoostVal);
GPU speedup
ret = perfManager->boost_gpu(nBoostVal);
Prompt for high CPU utilization
ret = perfManager->hint_high_cpuutil(ntid);
Tips for low CPU utilization
ret = perfManager->hint_low_cpuutil(ntid);
Tips for low latency
ret = perfManager->hint_low_latency(ntid);
Prompt thread pipeline
ret = perfManager->hint_thread_pipeline(ntids);
Release thread prompt
ret = perfManager->release_thread_hints(n_hint_category, ntid);
Get GPU headroom
ret = perfEnhManager->get_gpu_headroom(n_past_dur, avg);
6 Location API (precise positioning)
The LocationQESDK Service (LocationQesdkService) provides tracking and correction data injection APIs to applications. Applications can use these APIs to obtain meter- or decimeter-level positions from the underlying GNSS engine.
- The eDGNSS subsystem provides start/stop tracking APIs and callbacks for receiving meter-level positioning.
- The RTK subsystem provides a start/stop tracking API and callbacks for receiving decimeter-level positioning.
Comment
- OEM applications can also use the native NTRIP client configuration API.
- Only one pinpoint request can be activated per application. Multiple requests will cause subsequent requests to overwrite the previous request.
- Applications need to declare the android.permission.ACCESS_FINE_LOCATION user permission in the Android manifest file.
- Common APIs (such as configuration API and correction data injection API) are described in the eDGNSS subsystem chapter and are applicable to both eDGNSS and RTK subsystems.
- Pinpoint updates will stop when the screen is turned off or the app goes into the background. Once the screen is turned on and the app returns to the foreground, location updates will resume.
6.1 eDGNSS Subsystem
The eDGNSS subsystem provides a positioning API for meter-level positioning. For the general API, see General Location API, Callbacks, Enums, and Structures.
PP_eDGNSSManager (creator)
The main link enters the constructor of the eDGNSS precise positioning engine. To call the API in the eDGNSS subsystem, create an instance of the PP_eDGNSSManager class as shown in the example.
IQesdk mQesdkManager = IQesdk.createInstance(this); PP_eDGNSSManager mPpeEdgnssManager = new PP_eDGNSSManager(mQesdkManager);
6.2 RTK Subsystem
The RTK subsystem provides an API for decimeter-level positioning.
This API is used in conjunction with the NTRIP configuration and correction data injection API.
Note
All common APIs (such as Configuration API, Correction Data Injection API, Enumerations and Callbacks) are described in the Common Location API, Callbacks, Enumerations and Structures chapter. Differences are shown where applicable, otherwise the only difference is that the RTK subsystem provides decimeter-level position data.
PP_RTKManager
To call the API in the RTK subsystem, create an instance of the PP_RTKManager class as shown in the example.
IQesdk mQesdkManager = IQesdk.createInstance(this); PP_RTKManager mPpeRtkManager = new PP_RTKManager(mQesdkManager);