Skip to content

Conversation

@Cuda-Chen
Copy link
Collaborator

@Cuda-Chen Cuda-Chen commented Jan 2, 2026

Fix the PCM I/O transfer mechanism when allocating memory during frame enqueuing and freeing it upon dequeuing.


Summary by cubic

Fixes PCM TX frame memory handling in virtio-snd by deep-copying enqueued payloads and freeing buffers on dequeue. Prevents audio artifacts and memory leaks during PCM I/O.

  • Bug Fixes
    • Allocate node and its buffer with null checks; copy payload into owned memory.
    • Free node->addr and node when the frame is fully consumed.
    • Ensure the mutex unlocks on allocation failures via a single exit path.
    • Removes payload pointer reuse that caused repeating audio artifacts.

Written for commit d52d30c. Summary will update on new commits.

@Cuda-Chen Cuda-Chen marked this pull request as ready for review January 2, 2026 08:00
@Cuda-Chen Cuda-Chen requested a review from jserv January 2, 2026 08:00
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Fix the PCM I/O transfer mechanism when allocating memory during
frame enqueuing and freeing it upon dequeuing.
@Cuda-Chen Cuda-Chen requested a review from jserv January 2, 2026 08:31
@jserv jserv merged commit bcc3c7b into sysprog21:master Jan 2, 2026
5 checks passed
@jserv
Copy link
Collaborator

jserv commented Jan 2, 2026

Thank @Cuda-Chen for contributing!

@Cuda-Chen Cuda-Chen deleted the fix-tx-mem-manage branch January 2, 2026 08:33
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.

2 participants