Skip to content

Comments

app_mixmonitor: perform directional silence padding after both streams to avoid double-insert#1

Open
alonsoac wants to merge 1 commit intoasterisk-11.25.3from
codex/implement-mixmonitor-frame-counting-and-padding
Open

app_mixmonitor: perform directional silence padding after both streams to avoid double-insert#1
alonsoac wants to merge 1 commit intoasterisk-11.25.3from
codex/implement-mixmonitor-frame-counting-and-padding

Conversation

@alonsoac
Copy link
Owner

Motivation

  • Fix a critical logic bug where padding was applied inside each per-direction write loop, which could double-insert silence when fr_read and fr_write both contained frames in the same audiohook cycle and thus stretch recordings.
  • Keep padding notifications low-noise (one-time per direction) and preserve the end-of-recording summary of total silence inserted.

Description

  • Change mixmonitor_thread to write all read frames and all write frames first (updating counters only after successful ast_writestream calls), and perform at most one balancing pad operation afterwards based on the final counter delta.
  • Add per-datastore counters and flags to struct mixmonitor_ds: read_samples_written, write_samples_written, read_silence_samples_inserted, write_silence_samples_inserted, read_silence_log_shown, and write_silence_log_shown to track totals and one-time logging.
  • Introduce mixmonitor_write_silence() to emit zeroed frames in chunks and mixmonitor_samples_to_ms() to convert sample counts to milliseconds, and update end-of-recording logging to report totals.
  • Ensure writes are skipped on ast_writestream failure and only successful writes advance sample counters.

Testing

  • Attempted a local compile check with make -j2 apps/app_mixmonitor.o, which failed because the source tree requires ./configure to be run before make, so the build could not be completed in this environment.
  • No other automated tests were executed in this environment.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant