You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.7 KiB
45 lines
1.7 KiB
#pragma once |
|
|
|
#include <stdint.h> |
|
|
|
#ifdef __cplusplus |
|
extern "C" { |
|
#endif |
|
|
|
/* Только метаданные: PCM и содержимое сообщений не записываются. */ |
|
enum audio_diag_stage { |
|
AUDIO_DIAG_LOOP, AUDIO_DIAG_READ, AUDIO_DIAG_WRITE, AUDIO_DIAG_MAP, |
|
AUDIO_DIAG_SUBMIT, AUDIO_DIAG_DUPLEX, AUDIO_DIAG_CALLBACK, |
|
AUDIO_DIAG_FEED, AUDIO_DIAG_PULL, AUDIO_DIAG_STAGE_COUNT |
|
}; |
|
enum audio_diag_kind { |
|
AUDIO_DIAG_ENTER, AUDIO_DIAG_LEAVE, AUDIO_DIAG_OPEN, AUDIO_DIAG_CLOSE, |
|
AUDIO_DIAG_NOTIFY, AUDIO_DIAG_BACKEND_STARTED, AUDIO_DIAG_HOLE, AUDIO_DIAG_UNFILLED, AUDIO_DIAG_CAPTURE_DROP, |
|
AUDIO_DIAG_NO_PROGRESS, AUDIO_DIAG_BACKEND_UNDERRUN, AUDIO_DIAG_BACKEND_OVERFLOW, AUDIO_DIAG_ERROR, AUDIO_DIAG_LABEL, AUDIO_DIAG_LOG, |
|
AUDIO_DIAG_CAPTURE_CLOCK, AUDIO_DIAG_PLAYBACK_CLOCK |
|
}; |
|
|
|
struct audio_capture_timing { |
|
int64_t first_us, latency_us, converter_us; |
|
unsigned frames, rate; |
|
int measured, missing; |
|
}; |
|
|
|
struct audio_playback_timing { |
|
int64_t latency_us, converter_us; |
|
unsigned frames, rate; |
|
int measured; |
|
}; |
|
|
|
/* start/stop — управляющий поток; перед stop все producers должны быть остановлены. */ |
|
void audio_diag_start(void); |
|
void audio_diag_stop(void); |
|
void audio_diag_event(const void* device, int kind, int stage, int64_t value, int64_t detail); |
|
void audio_diag_label(const void* device, uint64_t id, const char* name); |
|
void audio_diag_log(const void* log, unsigned int level, const char* message); |
|
void audio_diag_capture_clock(const void* device, const struct audio_capture_timing* timing); |
|
void audio_diag_playback_clock(const void* device, const struct audio_playback_timing* timing); |
|
|
|
#ifdef __cplusplus |
|
} |
|
#endif
|
|
|