Browse Source

Report PCM mode, exact tempo and frame phase in call diagnostics

master
evgeny 4 days ago
parent
commit
22a03c5880
  1. 7
      src/call/call_audio.c
  2. 5
      src/call/call_jitter.cpp

7
src/call/call_audio.c

@ -628,9 +628,12 @@ int call_audio_get_stats(uint64_t call_id, int* buffer_ms, int* tempo_x100,
!!(events & 1), !!(events & 2), !!(events & 4), !!(events & 16), !!(events & 8));
if (ok) DEBUG_DEBUG(DEBUG_CATEGORY_CALL,
"call_jitter: call=%llu depth=%dms reserve=%dms encoded=%dms processing=%dms spread=%lldms pcm=%d "
"tempo=%d waiting=%d catching_up=%d resumed=%d underruns=%u",
"tempo=%d waiting=%d catching_up=%d resumed=%d underruns=%u "
"dsp=%d tempo_ppm=%d phase_samples=%u cuts=%llu stretch_in_out=%llu/%llu",
(unsigned long long)call_id, diagnostics.depth_ms, diagnostics.reserve_ms, diagnostics.encoded_ms,
diagnostics.processing_ms, (long long)diagnostics.arrival_spread_ms, diagnostics.pcm_samples,
diagnostics.tempo_x100, diagnostics.waiting, diagnostics.catching_up, diagnostics.resumed, diagnostics.underruns);
diagnostics.tempo_x100, diagnostics.waiting, diagnostics.catching_up, diagnostics.resumed, diagnostics.underruns,
diagnostics.delay_mode, diagnostics.tempo_ppm, diagnostics.phase_samples, (unsigned long long)diagnostics.cut_samples,
(unsigned long long)diagnostics.stretch_entries, (unsigned long long)diagnostics.stretch_exits);
return ok ? 0 : -1;
}

5
src/call/call_jitter.cpp

@ -177,6 +177,11 @@ int call_jitter_pull(struct call_jitter* j, int16_t* out, int max_samples) {
j->diagnostics.catching_up = state.tempo > 1.05;
j->diagnostics.waiting = n < max_samples;
j->diagnostics.pcm_samples = n;
j->diagnostics.delay_mode = (int)state.mode;
j->diagnostics.tempo_ppm = (int)std::lround(state.tempo * 1000000);
j->diagnostics.phase_samples = state.phase;
j->diagnostics.cut_samples = state.cuts;
j->diagnostics.stretch_entries = state.entered; j->diagnostics.stretch_exits = state.exited;
}
return n;
}

Loading…
Cancel
Save