chore #14740: capture diagnostics logging
Add diagnostic logging (no behaviour change) to distinguish, from one instrumented Windows test call, whether an auto-detected call records nothing because the wrong process tree was targeted, packets arrive but are flagged silent, or process loopback failed to start and the fallback hit the wrong device: - Log one line on every successful WASAPI stream open (initial and reopen): endpoint description (process tree pid + exe name for loopback, friendly name/id/role for device endpoints), rate and channels. - output_source_with_fallback: Info line when the primary target starts OK; the existing fallback Warn line now also names DefaultRender explicitly. - New CaptureStats (crates/audio/src/stats.rs), shared by the Windows and Linux capture loops: counts packets, frames, packets flagged silent, and the peak absolute sample value, reported every 10 s and once more when a stream stops. Plain counters updated inline on the audio thread; no locks, no extra threads. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,14 +48,17 @@ impl CaptureSource for FallbackSource {
|
||||
|
||||
let mut source = (self.factory)(self.target.clone());
|
||||
let format = match source.start(forward(&on_data)) {
|
||||
Ok(format) => format,
|
||||
Ok(format) => {
|
||||
log::info!("output target {:?} started", self.target);
|
||||
format
|
||||
}
|
||||
Err(err) => {
|
||||
let OutputTarget::Process { root_pid } = self.target else {
|
||||
return Err(err);
|
||||
};
|
||||
log::warn!(
|
||||
"process loopback for pid {root_pid} failed ({err}), \
|
||||
recording the default output instead"
|
||||
falling back to DefaultRender"
|
||||
);
|
||||
source = (self.factory)(OutputTarget::DefaultRender);
|
||||
source.start(forward(&on_data))?
|
||||
|
||||
Reference in New Issue
Block a user