Conversation
tkanfade
force-pushed
the
fix/capture-playback-issues
branch
3 times, most recently
from
September 10, 2026 10:31
90364b0 to
6ca0e1c
Compare
The capture buffer size was hardcoded to 512 bytes, which is too small for the DSP. The DSP rejects every read request and returns no data, causing the capture node to produce silence. Align the buffer size to match the PipeWire quantum size (PW_DEFAULT_CAPTURE_QUANTUM_FRAMES * frame_size) so the DSP always has enough data to serve each read. Also reduce buf_count from 8 to 4 since larger individual buffers need fewer slots. Tested on: LEMANS EVK (IQ-9075) Signed-off-by: Tejas Vijay Kanfade <tkanfade@qti.qualcomm.com>
tkanfade
force-pushed
the
fix/capture-playback-issues
branch
from
September 15, 2026 08:41
6ca0e1c to
afca793
Compare
The audio capture was driven directly from the PipeWire real-time thread which has a strict scheduling deadline. The DSP fills audio data slower than this deadline, causing the real-time thread to miss its deadline repeatedly. Over time PipeWire throttles the capture node resulting in very short recordings. Move the DSP read into a dedicated background thread (pw_pal_reader_thread) with a power-of-two ring buffer in between. The real-time process() callback now only does a fast non-blocking memcpy from the ring buffer and never blocks on the DSP. Tested on: LEMANS EVK (IQ-9075) Signed-off-by: Tejas Vijay Kanfade <tkanfade@qti.qualcomm.com>
When playback starts while capture is already running, the echo cancellation setup takes 13-27 seconds to complete. During this time the playback stream is not yet ready but audio data is already being sent to it, resulting in muted output for that duration. Move the playback stream startup (pal_stream_start + volume set) into a detached background thread (pw_pal_starter_thread). The real-time process() callback sends silence until stream_ready is set, so the RT thread is never blocked waiting for PAL. Also handle the teardown race: if the stream is closed before the starter thread finishes, stop_requested is set so the thread skips the volume call and exits cleanly. Tested on: LEMANS EVK (IQ-9075) Signed-off-by: Tejas Vijay Kanfade <tkanfade@qti.qualcomm.com>
tkanfade
force-pushed
the
fix/capture-playback-issues
branch
from
September 15, 2026 08:52
afca793 to
e48bc13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CRs-Fixed: 4395510, 4395054, 4394776
Three issues fixed:
Fix capture producing silence
The capture buffer size was too small, causing the DSP to
reject every read request and return no data. Aligned the
buffer size to match the PipeWire quantum size so the DSP
always has enough data to serve each read.
Fix incomplete/short recordings
The audio capture was being driven directly from the
PipeWire real-time thread which has a strict scheduling
deadline. The DSP fills audio data slower than this
deadline, causing the real-time thread to miss its
deadline repeatedly. Over time PipeWire throttles the
capture node resulting in very short recordings.
Moved the DSP read into a dedicated background thread
with a ring buffer in between, so the real-time thread
only does a fast memory copy and never blocks.
Fix playback muted when started during active capture
When playback starts while capture is already running,
the echo cancellation setup takes 13-27 seconds to
complete. During this time the playback stream is not
yet ready but audio data is already being sent to it,
resulting in muted output for that duration.
Moved the playback stream startup into a background
thread so the real-time thread is never blocked. Audio
data is held back silently until the stream is ready.
Tested on: LEMANS EVK (IQ-9075)