Hexagon SDK capi_v2 examples not working on APQ8096 Open-Q 820 board
I am trying to get the capi_v2_gain and capi_v2_passthru to work on the APQ8096 Open-Q 820 board.
So far I've been successful to get the APPI Fir example in the SDK 3.2 to run on the board and we can perform an Live tuning through QACT,
following the guide from SDK documents : QACT Lite : Testing the Audio Module on Target
When I follow same instructions and change the MTP acdb files to include the capi_v2 modules and create topology and use it in the headphone path then we are unsuccessful.
When I try to start the music when we have pushed the capi_v2_gain, then no audio plays and for capi_v2_passthru then the device restarts.
In the ads logcat, we can see that ACDB-LOADER Failed to fetch the lookup information of the device 0000000A
which is the headphone device.
01-01 01:46:17.537 766 766 I AudioPolicyManagerCustom: FLAG None hence request for a primary output
01-01 01:46:17.538 766 2079 I AudioPolicyManagerCustom: FLAG None hence request for a primary output
01-01 01:46:17.543 766 2078 D compress_voip: voice_extn_compress_voip_out_get_parameters: enter
01-01 01:46:17.657 766 984 D audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=8
01-01 01:46:17.657 766 984 D audio_hw_extn: audio_extn_set_anc_parameters: anc_enabled:0
01-01 01:46:17.658 766 984 D audio_hw_spkr_prot: audio_extn_fbsp_set_parameters: Speaker protection disabled
01-01 01:46:17.665 766 984 D audio_hw_primary: start_output_stream: enter: stream(0xe7f7f000)usecase(1: low-latency-playback) devices(0x8)
01-01 01:46:17.666 430 1886 E ANDR-PERF-RESOURCEQS: Failed to apply optimization [4, 0]
01-01 01:46:17.667 766 984 D audio_hw_primary: select_devices for use case (low-latency-playback)
01-01 01:46:17.667 766 984 D audio_hw_primary: select_devices: out_snd_device(8: headphones) in_snd_device(0: )
01-01 01:46:17.667 766 984 I msm8974_platform: platform_check_and_set_codec_backend_cfg:becf: afe: bitwidth 16, samplerate 48000 channels 2, backend_idx 2 usecase = 1 device (headphones)
01-01 01:46:17.667 766 984 D msm8974_platform: platform_can_split_snd_device: snd_device(8) num devices(1) new_snd_devices(8192)
01-01 01:46:17.667 766 984 I msm8974_platform: platform_check_and_set_codec_backend_cfg: new_snd_devices[0] is 8
01-01 01:46:17.667 766 984 I msm8974_platform: platform_check_codec_backend_cfg:becf: afe: bitwidth 16, samplerate 48000 channels 2, backend_idx 2 usecase = 1 device (headphones)
01-01 01:46:17.667 766 984 I msm8974_platform: platform_check_codec_backend_cfg:becf: afe: Codec selected backend: 2 updated bit width: 16 and sample rate: 48000
01-01 01:46:17.667 766 984 D audio_hw_primary: check_usecases_codec_backend:becf: force routing 0
01-01 01:46:17.667 766 984 E msm8974_platform: platform_check_backends_match: Invalid snd_device =
01-01 01:46:17.667 766 984 D audio_hw_primary: check_usecases_codec_backend:becf: (40) check_usecases curr device: headphones, usecase device: backends match 0
01-01 01:46:17.667 766 984 D audio_hw_primary: check_usecases_codec_backend:becf: check_usecases num.of Usecases to switch 0
01-01 01:46:17.667 766 984 D hardware_info: hw_info_append_hw_type : device_name = headphones
01-01 01:46:17.667 766 984 D msm8974_platform: platform_can_split_snd_device: snd_device(8) num devices(0) new_snd_devices(0)
01-01 01:46:17.668 766 984 D audio_hw_primary: enable_snd_device: snd_device(8: headphones)
01-01 01:46:17.668 766 984 D aud_dev_arbi: acquireOneDevice: device owner for device 8 is 1
01-01 01:46:17.676 766 984 I audio_hw_primary: select_devices Selected apptype: 69937
01-01 01:46:17.676 766 984 I audio_hw_utils: audio_extn_utils_send_app_type_cfg PLAYBACK app_type 69937, acdb_dev_id 10, sample_rate 48000
01-01 01:46:17.677 766 984 I audio_hw_utils: audio_extn_utils_send_app_type_cfg:becf: adm: app_type 69936, acdb_dev_id 10, sample_rate 48000
01-01 01:46:17.678 766 984 D msm8974_platform: platform_can_split_snd_device: snd_device(8) num devices(1) new_snd_devices(-412679194)
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_audio_cal, acdb_id = 10, path = 0, app id = 0x11131, sample rate = 48000
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_asm_topology
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_adm_topology
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_audtable
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE_SIZE
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> AUDIO_SET_AUDPROC_CAL
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_audvoltable
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_GAIN_DEP_STEP_TABLE, vol index 0
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> AUDIO_SET_VOL_CAL cal type = 12
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_audstrmtable
01-01 01:46:17.act678 766 984 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TABLE_V2
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> audstrm_cal->cal_type.cal_data.cal_size = 16
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_afe_topology
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_TOPOLOGY_ID
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> GET_AFE_TOPOLOGY_ID for adcd_id 10, Topology Id 112fc
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_afe_cal
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> ACDB_CMD_GET_AFE_COMMON_TABLE
01-01 01:46:17.678 766 984 D : Failed to fetch the lookup information of the device 0000000A
01-01 01:46:17.678 766 984 E ACDB-LOADER: Error: ACDB AFE returned = -19
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> AUDIO_SET_AFE_CAL
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> send_hw_delay : acdb_id = 10 path = 0
01-01 01:46:17.678 766 984 D ACDB-LOADER: ACDB -> ACDB_AVSYNC_INFO: ACDB_CMD_GET_DEVICE_PROPERTY
01-01 01:46:17.678 766 984 D audio_hw_primary: enable_audio_route: apply mixer and update path: low-latency-playback headphones
01-01 01:46:17.680 766 984 D audio_hw_primary: select_devices: done
01-01 01:46:17.682 766 984 D msm8974_platform: platform_set_channel_map mixer_ctl_name:Playback Channel Map15
01-01 01:46:17.682 766 984 D msm8974_platform: platform_set_channel_map: set mapping(1 2 0 0 0 0 0 0) for channel:2
01-01 01:46:17.756 766 984 D audio_hw_primary: start_output_stream: exit
01-01 01:46:18.155 603 683 E libnav : CablComputeBacklightLevel(): UpdateType = DifferentSceneUpdate
01-01 01:46:18.994 766 1338 I AudioPolicyManagerCustom: FLAG None hence request for a primary output
01-01 01:46:18.997 766 2078 I AudioPolicyManagerCustom: FLAG None hence request for a primary output
- And from the mini-dm log we can see that the capi_v2_gain module is accessed
48.313 d1:CAPI V2 GAIN: Number of ports set, input: 1, output: 1 0390 ..\..\..\src\capi_v2_gain.c
[08500/02] 04:48.313 d1:CAPI V2 GAIN: Recevied event callback pointer 0378 ..\..\..\src\capi_v2_gain.c
[08500/02] 04:48.312 AMDB_GET: Module (0, 0x10011001, 0x0) from entry-type 0x30, is_static 0, to_be_loaded 0, interface 2 0461 adsp_amdb.cpp
…
7 MtMx #0 cmd [1572872] (MapRoutings) handler: i/p port id = 1, num o/p ports = 1 2053 MixerSvc_MsgHandlers.cpp
[08500/02] 04:48.317 a7:CAPI V2 GAIN: media format update, sampling freq 44100, num channels 2, bits per sample 16 0342 ..\..\..\src\capi_v2_gain.c
[08500/02] 04:48.317 MtMx #0 cmd [1572872] (MapRoutings) handler: o/p port id = 1 2129 MixerSvc_MsgHandlers.cpp
[08500/00] 04:48.317 AudioStreamMgr: Rec cmd 0x10dab at [Addr=0x407, Port=0x101] 0087 AudioStreamMgr_AprIf.cpp
[08500/02] 04:48.317 a7:<<is_supported_media_type>> Dual Mic data passed. 0082 ..\..\..\src\capi_v2_gain.c
[08500/02] 04:48.317 PCC1A audproc_svc: PP KPPS vote changed from 0 to 1000. 4161 audproc_appi_topo.cpp
…
[08500/02] 04:48.320 a7:CAPI V2 GAIN: enable/disable <0x1> 0203 ..\..\..\src\capi_v2_gain.c
[08500/02] 04:48.320 a7:CAPI V2 GAIN: set master gain <0x3fff> 0233 ..\..\..\src\capi_v2_gain.c
- So the set_properties and set_parameters functions of the capi_v2 module are called,
- But the Process function is never called
The id of the module is 0x10011fff
and when I search for 10011fff in the mini-dm log I see these lines
[08500/03] 04:48.312 elite_cmn_topo_db_is_module_present: an active topology 10011fff was not found with provided bitmask 8. 0564 EliteCmnTopology_db.cpp
[08500/02] 04:48.312 ADM: ADM_CMD_DEVICE_OPEN, dev_num_ch = 2, dev_ch_mapping = 1, 2, 0, 0, 0, 0, 0, 0 3084 AudDevMgr.cpp
[08500/02] 04:48.312 ADM: device_perf_mode is [0] & COPP Buffer Num Frames is [5] & COPP Buffer Duration is [4] ms 3156 AudDevMgr.cpp
[08500/02] 04:48.312 ADM: As part of Rx ADM_CMD_DEVICE_OPEN, issuing CREATE_COPP cmd, topologyID: 0x10011fff, sampling rate 44100 3167 AudDevMgr.cpp
[08500/02] 04:48.312 audproc_svc: Creating 0217 audproc_svc.cpp
[08500/02] 04:48.312 PCC1A audproc_svc: Set output media Begin: keepInputFreq: 0, outputFreq: 44100, useNativeNumChannels: 1, outputChannels: 2, useNativeBitsPerSample: 1, outputBitsPerSample: 0 0206 audproc_paramhandler.cpp
[08500/02] 04:48.312 audproc_svc: Setting output media End 0248 audproc_paramhandler.cpp
[08500/00] 04:48.312 Q CREATE: Q=0xb0786b30 NumItems=64 0098 qurt_elite_queue.cpp
[08500/00] 04:48.312 Q CREATE: Q=0xb0786da0 NumItems=64 0098 qurt_elite_queue.cpp
[08500/00] 04:48.312 Q CREATE: Q=0xb0787010 NumItems=8 0098 qurt_elite_queue.cpp
[08500/03] 04:48.312 elite_cmn_topo_db_is_module_present: an active topo_id 10011fff was found with provided bitmask 1. but mod_id 10775 was not found. 0517 EliteCmnTopology_db.cpp
[08500/03] 04:48.312 elite_cmn_topo_db_is_module_present: an active topo_id 10011fff was found with provided bitmask 1. but mod_id 108da was not found. 0517 EliteCmnTopology_db.cpp
[08500/03] 04:48.312 elite_cmn_topo_db_is_module_present: an active topo_id 10011fff was found with provided bitmask 1. but mod_id 1077b was not found. 0517 EliteCmnTopology_db.cpp
[08500/03] 04:48.312 PCC1A audproc_svc: Topology 10011fff is not present in legacy database 1993 audproc_svc.cpp
[08500/02] 04:48.312 elite_cmn_topo_db_get_topology: an active topo_id 10011fff was found with provided bitmask 1. actual_size: 20, handle: 79, node @0xB06C71D4, new_ref_count: 2 0309 EliteCmnTopology_db.cpp
…
[08500/02] 04:48.315 PCC1A audproc_svc: Parse Media type Begin 0078 audproc_msghandler.cpp
[08500/03] 04:48.315 elite_cmn_topo_db_is_module_present: an active topology 10314 was not found with provided bitmask 8. 0564 EliteCmnTopology_db.cpp
[08500/02] 04:48.315 PCC1A audproc_svc: Parse Media type End 0107 audproc_msghandler.cpp
[08500/03] 04:48.315 elite_cmn_topo_db_is_module_present: an active topology 10011fff was not found with provided bitmask 8. 0564 EliteCmnTopology_db.cpp
[08500/02] 04:48.315 PCC1A: Input MediaFmt: Number of channels: 2, Sampling rate: 44100 ,Bits per sample: 16, Is Interleaved: 0, Is Signed: 1, Bitstream format: 69029 0260 audproc_paramhandler.cpp
I am not sure what the problem is and what we are doing wrong. We are working with a customer to make our own capi_v2 module so it is a big problem that we cannot test the module on the development board.
Do you guys have any suggestions or solutions?
Thanks!
*/
Did you ever find a solution here? I’m in a similar situation now - trying to get existing PP based module working and receiving similar errors in logcat (I still need to check mini-dm though) *and* would like to implement my own module in capi_v2.
Hi,
From the shared logs - CAPI V2 GAIN is loaded with the module id 0x10011001,
[08500/02] 04:48.313 d1:CAPI V2 GAIN: Recevied event callback pointer 0378 ..\..\..\src\capi_v2_gain.c
[08500/02] 04:48.312 AMDB_GET: Module (0, 0x10011001, 0x0) from entry-type 0x30, is_static 0, to_be_loaded 0, interface 2 0461 adsp_amdb.cpp
The topology whatever you configured is with topo_id 10011fff and mod_id 10775 from the below logs.
[08500/03] 04:48.312 elite_cmn_topo_db_is_module_present: an active topo_id 10011fff was found with provided bitmask 1. but mod_id 10775 was not found. 0517 EliteCmnTopology_db.cpp
Suspecting while creating the topology, some how you added different module.
Can you please check this and follow the steps properly.
thanks,
-tharun