Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7a29dbd
module: alsa: optimize ALSA endpoint logging
Apr 25, 2026
d5ceb3b
fw: api: align debug priorities with AR log levels
Apr 23, 2026
6255224
module: alsa: update tinyalsa library dependency
Apr 25, 2026
c6675fc
fwk: gen_cntr: Reset interrupt counters
Feb 18, 2026
04d2e74
Misaligned memory access fixed by padding the API structure memory
Feb 24, 2026
9bea324
fwk: Always-on voice buffering to DDR in LPI.
Mar 6, 2026
ac22be2
Remove data path control listening on DCM island entry
Mar 12, 2026
3647365
fwk: Add header timestamp support in shared memory for PUSH
Mar 23, 2026
8790657
Add DAM functionality to drain the partial data and DFG support
Mar 25, 2026
0c141e3
fwk: adding h2xml annotation for the header cfg param
Mar 27, 2026
bd1d15b
Media format propagation fix for handling pending zeros due to EOS case
Apr 1, 2026
6c8158f
Handle At-Gap state when DFG moves out of container
Apr 9, 2026
18cf7f9
DAM Changes for downstream SG Stop corner case
Apr 12, 2026
dac19be
Fix in PTC external data port asynchronous graph open handling.
Apr 16, 2026
4baa100
SHMEM Module, Incorrect Batch index after TS discontinuity
Apr 16, 2026
400abf7
Fix invalid address access from buffer pool
Apr 16, 2026
8c1df72
Fix dynamic event handling in pass-through container
Apr 18, 2026
fa7d20a
alsa: fix capture endpoint implementation
May 31, 2026
799ce30
alsa: fix capture thread race condition and synchronization
May 31, 2026
cda4425
fwk: gen_cntr: fix %lu format specifier for uint32_t log args
kumaranu-eng Jun 6, 2026
63c7a44
fwk: spf: modules: enable sync and splitter
Jun 6, 2026
9043b5c
fwk: spf: utils: remove static linking of ARE modules
Jun 6, 2026
8b19227
alsa: source: use pcm_wait in DMA thread and pcm_read in process_source
Jun 6, 2026
84166d7
alsa: sink: enable signal-triggered playback for sink direction
Jun 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions fwk/api/ar_utils/linux/ar_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@


// Legacy debug priority messages
#define DBG_LOW_PRIO AR_HIGH_PRIO /**< Low priority debug message. */
#define DBG_MED_PRIO AR_HIGH_PRIO /**< Medium priority debug message. */
#define DBG_LOW_PRIO AR_LOW_PRIO /**< Low priority debug message. */
#define DBG_MED_PRIO AR_MED_PRIO /**< Medium priority debug message. */
#define DBG_HIGH_PRIO AR_HIGH_PRIO /**< High priority debug message. */
#define DBG_ERROR_PRIO AR_ERROR_PRIO /**< Error priority debug message. */
#define DBG_FATAL_PRIO AR_HIGH_PRIO /**< Fatal priority debug message. */
#define DBG_FATAL_PRIO AR_FATAL_PRIO /**< Fatal priority debug message. */
#define MSG_LEGACY_ERROR DBG_ERROR_PRIO
#define MSG_LEGACY_HIGH DBG_HIGH_PRIO
#define MSG_LEGACY_MED DBG_MED_PRIO
Expand Down Expand Up @@ -122,14 +122,26 @@
do { \
if (ar_log_debugmsg_enable) \
{ \
static const char *msg_tag = AR_MSG_TAG; \
static const char filename[] = LOCAL_FILE_NAME; \
static const uint32_t line_no = __LINE__; \
ar_log( xx_ss_mask, msg_tag, filename, __FUNCTION__, line_no, xx_fmt, ##__VA_ARGS__); \
if (DBG_FATAL_PRIO == (xx_ss_mask)) \
{ \
assert(0); \
} \
else if (DBG_ERROR_PRIO == (xx_ss_mask)) \
{ \
AR_LOG_ERR(AR_MSG_TAG, xx_fmt, ##__VA_ARGS__) \
} \
else if (DBG_HIGH_PRIO == (xx_ss_mask)) \
{ \
AR_LOG_INFO(AR_MSG_TAG, xx_fmt, ##__VA_ARGS__) \
} \
else if (DBG_MED_PRIO == (xx_ss_mask)) \
{ \
AR_LOG_DEBUG(AR_MSG_TAG, xx_fmt, ##__VA_ARGS__) \
} \
else if (DBG_LOW_PRIO == (xx_ss_mask)) \
{ \
AR_LOG_VERBOSE(AR_MSG_TAG, xx_fmt, ##__VA_ARGS__) \
} \
} \
} while(0)
#endif //if defined (ARSPF_PLATFORM_LRH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ALSA_DEVICE_CFLAGS_64 += -march=armv8-a+crypto
ALSA_DEVICE_SHARED_LIBS := \
liblx-osal \
libar-gpr \
libtinyalsa
liboss_tinyalsa

ALSA_DEVICE_HEADER_LIBS := \
libspf_api \
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "alsa_device_api.h"
#include "capi_cmn.h"
#include "alsa_device_driver.h"
#include "posal_nmutex.h"
#include "posal_condvar.h"

/*=====================================================================
Macros
Expand All @@ -28,10 +30,10 @@
#define min(A,B) ((A) < (B) ? (A) : (B))
#endif

/* Number of CAPI Framework extension needed
Note: this module is not defined as Signal Triggered Module */
#define ALSA_DEVICE_NUM_FRAMEWORK_EXTENSIONS_SOURCE 1
#define ALSA_DEVICE_NUM_FRAMEWORK_EXTENSIONS_SINK 0
/* Number of CAPI Framework extensions needed — both source and sink declare FWK_EXTN_STM */
#define ALSA_DEVICE_NUM_FRAMEWORK_EXTENSIONS 1

#define ALSA_DEVICE_DMA_THREAD_STACK_SIZE 8192

/* Number of milliseconds in a second*/
#define NUM_MS_PER_SEC 1000
Expand Down Expand Up @@ -105,15 +107,19 @@ typedef struct capi_alsa_device
void * signal_ptr; // Signal ptr for STM
uint32_t enable_stm;

/* Thread management for source direction */
/* Thread management for DMA wait thread (used by both source and sink) */
posal_thread_t dma_wait_thread; // Thread handle for DMA waiting
bool_t is_thread_running; // Thread running state
bool_t exit_thread; // Thread exit flag

/* Buffer to store the data read form ALSA driver in wait thread */
int8_t *read_buffer; // Buffer to hold one period of captured data
/* Intermediate buffer for deinterleaved capture path (interleaved staging) */
int8_t *read_buffer; // Intermediate buffer for deinterleaved conversion
uint32_t read_buffer_size; // Size of read buffer in bytes
bool_t data_ready; // Flag: data available in read buffer
bool_t data_ready; // Flag: pcm_wait has returned, period is available

/* Synchronization between DMA thread and process_sink/source */
posal_nmutex_t data_ready_lock; // Protects data_ready
posal_condvar_t process_done_cond; // Signaled by process_sink/source after pcm_write/read completes
} capi_alsa_device_t;

/*------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ar_result_t alsa_device_driver_set_cfg(alsa_device_driver_t *alsa_device_driver_
if (alsa_device_cfg_ptr->bit_width == 32)
config->format = PCM_FORMAT_S32_LE;
else if (alsa_device_cfg_ptr->bit_width == 24)
config->format = PCM_FORMAT_S24_3LE;
config->format = PCM_FORMAT_S24_LE;
else if (alsa_device_cfg_ptr->bit_width == 16)
config->format = PCM_FORMAT_S16_LE;

Expand Down Expand Up @@ -85,6 +85,11 @@ ar_result_t alsa_device_driver_open(alsa_device_driver_t *alsa_device_driver_ptr
AR_MSG(DBG_ERROR_PRIO, "ALSA_DEVICE_DRIVER: Unable to open PCM device %u (%s)\n",
alsa_device_driver_ptr->device_id,
pcm_get_error(alsa_device_driver_ptr->pcm));
if (alsa_device_driver_ptr->pcm)
{
pcm_close(alsa_device_driver_ptr->pcm);
alsa_device_driver_ptr->pcm = NULL;
}
return AR_EFAILED;
}

Expand Down Expand Up @@ -146,7 +151,7 @@ ar_result_t alsa_device_driver_read(alsa_device_driver_t *alsa_device_driver_ptr
return AR_EFAILED;
}

AR_MSG(DBG_HIGH_PRIO, "ALSA_DEVICE_DRIVER: pcm_read success, bytes: %d", num_bytes);
AR_MSG(DBG_LOW_PRIO, "ALSA_DEVICE_DRIVER: pcm_read success, bytes: %d", num_bytes);
return AR_EOK;
}

Expand All @@ -159,7 +164,7 @@ ar_result_t alsa_device_driver_write(alsa_device_driver_t *alsa_device_driver_pt
return AR_EFAILED;
}

//AR_MSG(DBG_HIGH_PRIO, "ALSA_DEVICE_DRIVER: pcm write success \n");
AR_MSG(DBG_LOW_PRIO, "ALSA_DEVICE_DRIVER: pcm write success \n");

return AR_EOK;
}
Expand All @@ -184,9 +189,11 @@ ar_result_t alsa_device_driver_close(alsa_device_driver_t *alsa_device_driver_pt
{
AR_MSG(DBG_ERROR_PRIO, "ALSA_DEVICE_DRIVER: pcm close failed with error: %s\n",
pcm_get_error(alsa_device_driver_ptr->pcm));
alsa_device_driver_ptr->pcm = NULL;
return AR_EFAILED;
}

alsa_device_driver_ptr->pcm = NULL;
AR_MSG(DBG_HIGH_PRIO, "ALSA_DEVICE_DRIVER: pcm close success.\n");

return AR_EOK;
Expand Down
14 changes: 9 additions & 5 deletions fwk/spf/apm/ext/multi_client/src/apm_multi_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,14 +1103,16 @@ ar_result_t apm_multi_client_update_sg_calibration_state(apm_t *apm_info_ptr)
{
ar_result_t result = AR_EOK;
apm_sub_graph_t *sub_graph_node_ptr = NULL;
spf_list_node_t *temp_cached_ptr;

spf_list_node_t *curr_ptr = apm_info_ptr->curr_cmd_ctrl_ptr->db_default_set_cfg_cmd_ctrl.parsed_sg_list_ptr;

gpr_packet_t *packet_curr_client = (gpr_packet_t *)apm_info_ptr->curr_cmd_ctrl_ptr->cmd_msg.payload_ptr;

while (NULL != curr_ptr)
{
uint32_t sub_graph_id = *((uint32_t *)(curr_ptr->obj_ptr));
spf_list_node_t *next_curr_ptr = curr_ptr->next_ptr;

uint32_t sub_graph_id = *((uint32_t *)(curr_ptr->obj_ptr));

result =
apm_db_get_sub_graph_node(&apm_info_ptr->graph_info, sub_graph_id, &sub_graph_node_ptr, APM_DB_OBJ_QUERY);
Expand All @@ -1135,14 +1137,16 @@ ar_result_t apm_multi_client_update_sg_calibration_state(apm_t *apm_info_ptr)
packet_curr_client->src_port,
sub_graph_id);

temp_cached_ptr = curr_ptr;
uint32_t * temp_cached_obj_ptr = (uint32_t *)(curr_ptr->obj_ptr);

apm_db_remove_node_from_list(&apm_info_ptr->curr_cmd_ctrl_ptr->db_default_set_cfg_cmd_ctrl.parsed_sg_list_ptr,
(void *)(curr_ptr->obj_ptr),
&apm_info_ptr->curr_cmd_ctrl_ptr->db_default_set_cfg_cmd_ctrl.num_subgraph_node);

posal_memory_free(temp_cached_ptr->obj_ptr);
curr_ptr = curr_ptr->next_ptr;
posal_memory_free((void*)temp_cached_obj_ptr);
temp_cached_obj_ptr = NULL;

curr_ptr = next_curr_ptr;
}

return result;
Expand Down
8 changes: 6 additions & 2 deletions fwk/spf/apm/ext/multi_client/src/apm_multi_client_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ ar_result_t apm_multi_client_free_conn(apm_t *apm_info_ptr, apm_sub_graph_t *sub

while (conn_cfg_list_ptr)
{
spf_list_node_t *next_conn_cfg_list_ptr = conn_cfg_list_ptr->next_ptr;

apm_module_data_port_conn_t *conn_cfg_ptr = (apm_module_data_port_conn_t *)conn_cfg_list_ptr->obj_ptr;

// All the connection from this SG should be removed either originating or ending
Expand Down Expand Up @@ -322,7 +324,7 @@ ar_result_t apm_multi_client_free_conn(apm_t *apm_info_ptr, apm_sub_graph_t *sub
conn_cfg_ptr = NULL;
}

LIST_ADVANCE(conn_cfg_list_ptr);
conn_cfg_list_ptr = next_conn_cfg_list_ptr;
}

return result;
Expand All @@ -340,6 +342,8 @@ ar_result_t apm_multi_client_free_ctrl_link(apm_t *apm_info_ptr, apm_sub_graph_t

while (ctrl_link_cfg_list_ptr)
{
spf_list_node_t *next_ctrl_link_cfg_list_ptr = ctrl_link_cfg_list_ptr->next_ptr;

apm_module_ctrl_port_conn_t *ctrl_link_cfg_ptr = (apm_module_ctrl_port_conn_t *)ctrl_link_cfg_list_ptr->obj_ptr;

// All the connection from this SG should be removed either originating or ending
Expand Down Expand Up @@ -373,7 +377,7 @@ ar_result_t apm_multi_client_free_ctrl_link(apm_t *apm_info_ptr, apm_sub_graph_t
ctrl_link_cfg_ptr = NULL;
}

LIST_ADVANCE(ctrl_link_cfg_list_ptr);
ctrl_link_cfg_list_ptr = next_ctrl_link_cfg_list_ptr;
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ ar_result_t cu_register_module_events(cu_base_t *me_ptr, gpr_packet_t *packet_pt
ar_result_t cu_register_module_events_v2(cu_base_t *me_ptr, gpr_packet_t *packet_ptr);
ar_result_t cu_handle_cntr_events_reg_dereg(cu_base_t *me_ptr, topo_reg_event_t *reg_event_payload_ptr, bool_t is_register);
ar_result_t cu_raise_container_events_to_clients(cu_base_t *me_ptr, uint32_t event_id, int8_t *payload_ptr, uint32_t payload_size);
ar_result_t cu_handle_md_tracking_internal_event(cu_base_t * me_ptr, gpr_packet_t *packet_ptr, spf_cfg_data_type_t cfg_type);

ar_result_t cu_graph_connect(cu_base_t *me_ptr);
ar_result_t cu_graph_control_connect(cu_base_t *me_ptr);
Expand Down
48 changes: 48 additions & 0 deletions fwk/spf/containers/cmn/container_utils/core/src/cu_cmd_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1779,3 +1779,51 @@ ar_result_t cu_process_cmd_queue(cu_base_t *me_ptr)
me_ptr->flags.apm_cmd_context = FALSE;
return result;
}
ar_result_t cu_handle_md_tracking_internal_event(cu_base_t *me_ptr, gpr_packet_t *packet_ptr, spf_cfg_data_type_t cfg_type)
{
ar_result_t result = AR_EOK;

// Validate packet pointer
if (NULL == packet_ptr)
{
CU_MSG(me_ptr->gu_ptr->log_id, DBG_ERROR_PRIO, "invalid packet_ptr received.");
return AR_EBADPARAM;
}

module_cmn_md_tracking_md_event_rsp_handle_t *tracking_event_ptr = GPR_PKT_GET_PAYLOAD(module_cmn_md_tracking_md_event_rsp_handle_t, packet_ptr);

switch (tracking_event_ptr->tracking_rsp_cfg)
{
case TRACKING_MD_EVENT_RSP_SET_CFG:
{

uint8_t *param_data_ptr = (uint8_t *)(tracking_event_ptr + 1);

result = cu_set_get_cfgs_packed_loop(me_ptr,
param_data_ptr,
packet_ptr->dst_port,
tracking_event_ptr->tracking_event_payload_size,
TRUE, /* is_set_cfg */
FALSE, /*is_out_of_band*/
FALSE, /*is_deregister*/
cfg_type);

CU_MSG(me_ptr->gu_ptr->log_id, DBG_HIGH_PRIO, "done tracking MD event with result %lu", result);

__gpr_cmd_free(packet_ptr);
break;

}
default:
{
result = CAPI_EBADPARAM;
CU_MSG(me_ptr->gu_ptr->log_id, DBG_ERROR_PRIO, "Unsupported Tracking event RSP CFG: %lu", tracking_event_ptr->tracking_rsp_cfg);

__gpr_cmd_free(packet_ptr);
break;
}
}


return result;
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ uint32_t cu_gpr_callback(gpr_packet_t *packet, void *callback_data)
case IMCL_INTER_PROC_TRIGGER_MSG_GPR:
case IMCL_INTER_PROC_POLLING_MSG_GPR:
case IMCL_INTER_PROC_PEER_STATE_UPDATE:
case EVENT_ID_MODULE_CMN_METADATA_CUSTOM_TRACKING_EVENT:
// for polling message, first push to cmd Q. from there, we'll open the message and push to the ctrl port
// Q
// which will be polled at process boundary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,8 @@ GEN_TOPO_STATIC ar_result_t gen_topo_check_copy_between_modules(gen_topo_t *
// Only try to propogate media fomrat if the next port state is started because MF will only be propogated if the
// port state is started this will avoid infinite loop in GC.
// Ref Test Case: dtmf_gen_cfg_cmd_seq_1 , dtmf_gen_cfg_cmd_seq_2 & dtmf_gen_cfg_cmd_seq_3
if ((0 == next_bufs_ptr[0].actual_data_len) && (TOPO_PORT_STATE_STARTED == next_in_port_ptr->common.state))
if ((0 == next_bufs_ptr[0].actual_data_len) && (TOPO_PORT_STATE_STARTED == next_in_port_ptr->common.state)
&& (0 == next_module_ptr->pending_zeros_at_eos))
{
gen_topo_propagate_media_fmt_from_module(topo_ptr, TRUE /* is_data_path*/, module_list_ptr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1437,13 +1437,17 @@ gen_topo_data_need_t gen_topo_in_port_needs_data(gen_topo_t *topo_ptr, gen_topo_
else
#endif
{
// if there's a flushing EOS stuck, input is optional
if (in_port_ptr->common.sdata.flags.marker_eos)
// if there's a flushing EOS or DFG stuck, input is optional
/* Fix for DFG:
Ideally checking just for end_of_frame should be sufficient for DFG.
Since end_of_frame has wider scope threfore to limit the fix, DFG MD is looked up.*/
if (in_port_ptr->common.sdata.flags.marker_eos ||
(in_port_ptr->common.sdata.flags.end_of_frame && gen_topo_md_list_has_dfg(in_port_ptr->common.sdata.metadata_list_ptr)))
{
#ifdef TRIGGER_DEBUG_DEEP
TOPO_MSG(topo_ptr->gu.log_id,
DBG_LOW_PRIO,
" Module 0x%lX: Input port id:0x%lx, port has EOS. need data optionally",
" Module 0x%lX: Input port id:0x%lx, port has EOS or DFG. need data optionally",
in_port_ptr->gu.cmn.module_ptr->module_instance_id,
in_port_ptr->gu.cmn.id);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ ar_result_t gen_topo_validate_metadata_eof(gen_topo_module_t *module_ptr);
void gen_topo_populate_metadata_for_peer_cntr(gen_topo_t * gen_topo_ptr,
gu_ext_out_port_t * ext_out_port_ptr,
module_cmn_md_list_t **md_list_pptr,
module_cmn_md_list_t **out_md_list_pptr,
bool_t * out_buf_has_flushing_eos_ptr);
module_cmn_md_list_t **out_md_list_pptr,
bool_t * out_buf_has_flushing_eos_dfg_ptr);

ar_result_t gen_topo_check_realloc_md_list_in_peer_heap_id(uint32_t log_id,
gu_ext_out_port_t * ext_out_port_ptr,
Expand Down
Loading
Loading