audio: replace DEBUG_CAPTURE with traces
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
Jan 21, 2026 at 15:29 UTC
28e90447bcc90bb405a615103144957376aba721
2 files changed
+10
-13
audio/audio-mixeng-be.c
+7
-13
@@ -30,7 +30,6 @@
30
#include "audio_int.h"
31
32
/* #define DEBUG_OUT */
33
-/* #define DEBUG_CAPTURE */
33
34
#define SW_NAME(sw) (sw)->name ? (sw)->name : "unknown"
35
@@ -249,9 +248,8 @@ static void audio_notify_capture (CaptureVoiceOut *cap, audcnotification_e cmd)
248
{
249
struct capture_callback *cb;
250
252
-#ifdef DEBUG_CAPTURE
253
- dolog ("notification %d sent\n", cmd);
254
-#endif
251
+ trace_audio_notify_capture(cmd);
252
+
253
for (cb = cap->cb_head.lh_first; cb; cb = cb->entries.le_next) {
254
cb->ops.notify (cb->opaque, cmd);
255
}
@@ -333,12 +331,10 @@ static int audio_attach_capture (HWVoiceOut *hw)
331
sw->rate = st_rate_start (sw->info.freq, hw_cap->info.freq);
332
QLIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
333
QLIST_INSERT_HEAD (&hw->cap_head, sc, entries);
336
-#ifdef DEBUG_CAPTURE
337
- sw->name = g_strdup_printf ("for %p %d,%d,%d",
338
- hw, sw->info.freq, sw->info.bits,
339
- sw->info.nchannels);
340
- dolog ("Added %s active = %d\n", sw->name, sw->active);
341
-#endif
334
+ sw->name = g_strdup_printf("for %p %d,%s,%d",
335
+ hw, sw->info.freq, AudioFormat_str(sw->info.af),
336
+ sw->info.nchannels);
337
+ trace_audio_capture_attach(sw->name, sw->active);
338
if (sw->active) {
339
audio_capture_maybe_changed (cap, 1);
340
}
@@ -1707,10 +1703,8 @@ static void audio_mixeng_backend_del_capture(
1703
1704
while (sw) {
1705
SWVoiceCap *sc = (SWVoiceCap *) sw;
1710
-#ifdef DEBUG_CAPTURE
1711
- dolog ("freeing %s\n", sw->name);
1712
-#endif
1706
1707
+ trace_audio_capture_free_sw(sw->name);
1708
sw1 = sw->entries.le_next;
1709
if (sw->rate) {
1710
st_rate_stop (sw->rate);
audio/trace-events
+3
@@ -58,10 +58,13 @@ audio_be_set_active_out(void *sw, bool on) "sw=%p, on=%d"
58
audio_timer_start(int interval) "interval %d ms"
59
audio_timer_stop(void) ""
60
audio_timer_delayed(int interval) "interval %d ms"
61
+audio_notify_capture(int cmd) "notification %d sent"
62
+audio_capture_attach(const char *name, bool active) "capture %s active=%d"
63
64
# audio-mixeng-be.c
65
audio_get_avail(const char *name, size_t live, uint32_t frontend_frames) "%s: get_avail live %zu frontend frames %u"
66
audio_run_poll(const char *msg, int64_t elapsed_us) "Elapsed since last %s: %" PRId64 " us"
67
+audio_capture_free_sw(const char *name) "freeing %s"
68
69
# audio_template.h
70
audio_open_out(const char *name, int freq, int nchannels, int fmt) "open %s, freq %d, nchannels %d, fmt %d"