Skip to content

Upstream#98

Open
ffrancis123 wants to merge 24 commits into
AudioReach:masterfrom
ffrancis123:upstream
Open

Upstream#98
ffrancis123 wants to merge 24 commits into
AudioReach:masterfrom
ffrancis123:upstream

Conversation

@ffrancis123

Copy link
Copy Markdown
Contributor

Commits included:
module: alsa: optimize ALSA endpoint logging
fw: api: align debug priorities with AR log levels
module: alsa: update tinyalsa library dependency
fwk: gen_cntr: Reset interrupt counters
Misaligned memory access fixed by padding the API structure memory
fwk: Always-on voice buffering to DDR in LPI.
Remove data path control listening on DCM island entry
fwk: Add header timestamp support in shared memory for PUSH
Add DAM functionality to drain the partial data and DFG support
fwk: adding h2xml annotation for the header cfg param
Media format propagation fix for handling pending zeros due to EOS case
Handle At-Gap state when DFG moves out of container
DAM Changes for downstream SG Stop corner case
Fix in PTC external data port asynchronous graph open handling.
SHMEM Module, Incorrect Batch index after TS discontinuity
Fix invalid address access from buffer pool
Fix dynamic event handling in pass-through container
alsa: fix capture endpoint implementation
alsa: fix capture thread race condition and synchronization
fwk: gen_cntr: fix %lu format specifier for uint32_t log args
fwk: spf: modules: enable sync and splitter
fwk: spf: utils: remove static linking of ARE modules
alsa: source: use pcm_wait in DMA thread and pcm_read in process_source
alsa: sink: enable signal-triggered playback for sink direction

Lijo Cyriac George and others added 10 commits July 14, 2026 17:57
Adjust log priority to reduce verbosity in process calls.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Map DBG_* priorities to appropriate AR log levels and
route messages through AR_LOG_* macros.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
update shared library dependency from libtinyalsa to liboss_tinyalsa

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Signal miss after enabling DMA in callback.
Reset and raised interrupts after handling completes.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Misaligned memory access fixed by padding the API structure memory

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Audio DAM module buffers incoming PCM in LPI and drains it in batches
to a downstream endpoint that writes into an HLOS-provided DDR
shared circular buffer. HLOS reads from DDR asynchronously
and uses watermark events to coordinate writer progress.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
The data path control listening functionality has been removed from
the Duty Cycle Manager (DCM) island entry path. This code block was
specifically designed for IoT use cases and is not required for the
general implementation.

When entering island mode, the container now skips the call to
gen_cntr_listen_to_controls(), which previously registered listeners
for both control commands and data triggers. The control listening
step should only be performed for IoT applications, but the current
implementation lacks the necessary generalization to conditionally
enable this behavior.

This change prevents unnecessary wakeups from data triggers during
island entry, improving power efficiency for non-IoT use cases.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Add support for header data along with PCM in the shared memory
buffer used by the PUSH module.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
This change adds support for partial batch drain and DFG metadata
handling in the Audio DAM buffer module. It refactors EOS handling,
introduces configuration fields and error checks, and improves
device-switch handling for partial batch drain scenarios.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Add h2xml annotations for
header cfg param so the header configuration
parameter is described correctly in calibration tooling.

Update shmem push mode timestamp handling to generate UTC-based
timestamps for the header payload. The change:

- adds state to track the UTC time module
- allocates and resets the module when timestamp headers are enabled
- queries network UTC time and converts the local timestamp before
  writing the payload
- frees the UTC time module during module cleanup

This fixes incomplete timestamp handling in push mode and ensures the
exported header carries UTC-aligned time information.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
@ffrancis123
ffrancis123 requested review from a team July 14, 2026 12:32
hkadamba and others added 14 commits July 15, 2026 07:27
Prevent media format propagation when the downstream module still
has pending zeros to emit for EOS handling.

The data path previously treated an empty downstream buffer as
enough to propagate media format as long as the input port was
started. In the EOS zero-padding case, that allowed propagation to
happen while the next module still had pending output to drain.

Add a check for pending_zeros_at_eos before propagating media
format. This avoids advancing media format state too early and
fixes incorrect handling around EOS-driven zero output.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Treat DFG metadata like flushing EOS so it can propagate across
containers even when the peer holds a partial frame.

Update trigger policy handling to allow processing when DFG is
paired with end_of_frame, matching existing flushing EOS behavior.

Propagate DFG state through peer metadata and reset logic to ensure
proper output reset and correct at-gap state transition.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Handle AON buffering stop and reset corner cases

Fix DAM and shmem push-mode handling for downstream SG stop scenarios
seen with AON buffering.
Reset DAM output state fully on port stop, drop stale partial data,
and improve batch completion and metadata signaling behavior.
In shmem push mode, finalize active batches cleanly across resets
to keep valid data visible and downstream state consistent.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Handle AON buffering stop, reset, and PTC async open corner cases
Tighten DAM and shmem push-mode handling for downstream SG stop
scenarios observed during AON buffering.

Fix race conditions in PTC external data port asynchronous graph
open handling by preventing background threads from referencing
invalid port indices, avoiding possible data corruption.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Maintain correct header-based batch tracking across timestamp
discontinuities in shmem push-mode writes.

Fixes incorrect header updates triggered by timestamp discontinuity
handling.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Prevent invalid list-node access while removing cached subgraph,
data-link, and control-link entries during multi-client cleanup.
Fixes list traversal during multi-client cleanup

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Process pending framework events in the pass-through container
while an asynchronous command is still active.

Detect active command context before clearing triggers so
module-raised dynamic events are handled in the data path
at the correct time.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Fix resource leaks, lifecycle ordering, and data path correctness issues
in the ALSA device source endpoint. Ensure proper teardown sequencing,
correct 24-bit PCM format handling, and consistent interleaving between
the advertised media format and the capture process path.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Prevent concurrent access to read_buffer between the DMA wait thread
and process_source by introducing a mutex and condition variable. The
DMA thread now waits for process_source to consume read_buffer before
issuing the next pcm_read, eliminating the data race on data_ready and
the buffer overwrite observed with back-to-back pcm_read completions
due to ALSA buffer accumulation.

Also sync int_samples_per_period with the actual period_size negotiated
by the ALSA driver after pcm_open, keeping the framework threshold and
DMA read size consistent when hardware rounds the requested period size.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
%lu expects unsigned long (8 bytes on 64-bit LP64), but the arguments
are uint32_t (4 bytes). This causes the logger to read 8 bytes off the
va_args stack, producing garbage values in the "Output buffer is too
small" error message. Fix both occurrences to use %u.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Register sync, priority_sync and splitter with AMDB
by switching to BUILD_ARE_MODULES.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Remove sync, priority_sync and splitter from libspf_utils
static dependencies as they are now registered as ARE modules.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Replace blocking pcm_read in DMA thread with pcm_wait to only poll
for hardware buffer availability. Move pcm_read to process_source
where it reads directly into the output buffer, eliminating the
intermediate read_buffer copy for the interleaved case.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Declare FWK_EXTN_STM for both source and sink, open PCM and launch
DMA wait thread for sink in STM_CTRL handler. Add pcm_prepare
recovery on pcm_wait failure and fix DMA thread serialization with
process_sink.

Signed-off-by: ffrancis <ffrancis@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant