@samitouri / QOSamiQemu / commits / c6dfd07805

audio: replace remaining dolog() and AUD_log

Use warn_report/error_report and trace instead. 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 22, 2026 at 11:49 UTC c6dfd07805fc787d4e76fc7c02ed7307973df162
3 files changed +15 -19
audio/audio-mixeng-be.c
+6 -8
@@ -654,7 +654,7 @@ static size_t audio_mixeng_backend_write(AudioBackend *be, SWVoiceOut *sw,
654 hw = sw->hw;
655
656 if (!hw->enabled) {
657 - dolog("Writing to disabled voice %s\n", SW_NAME(sw));
657 + warn_report("audio: Writing to disabled voice %s", SW_NAME(sw));
658 return 0;
659 }
660
@@ -677,7 +677,7 @@ static size_t audio_mixeng_backend_read(AudioBackend *be,
677 hw = sw->hw;
678
679 if (!hw->enabled) {
680 - dolog("Reading from disabled voice %s\n", SW_NAME(sw));
680 + warn_report("audio: Reading from disabled voice %s", SW_NAME(sw));
681 return 0;
682 }
683
@@ -874,9 +874,8 @@ static void audio_capture_mix_and_clear(HWVoiceOut *hw, size_t rpos,
874 sw->empty = sw->total_hw_samples_mixed == 0;
875
876 if (to_read - frames_in) {
877 - dolog("Could not mix %zu frames into a capture "
878 - "buffer, mixed %zu\n",
879 - to_read, frames_in);
877 + audio_bug("Could not mix %zu frames into a capture "
878 + "buffer, mixed %zu", to_read, frames_in);
879 break;
880 }
881 n -= to_read;
@@ -1561,7 +1560,7 @@ static CaptureVoiceOut *audio_mixeng_backend_add_capture(
1560 }
1561
1562 if (!audio_get_pdo_out(s->dev)->mixing_engine) {
1564 - dolog("Can't capture with mixeng disabled\n");
1563 + error_report("audio: Can't capture with mixeng disabled");
1564 return NULL;
1565 }
1566
@@ -1754,8 +1753,7 @@ size_t audio_rate_peek_bytes(RateCtl *rate, struct audio_pcm_info *info)
1753 void audio_rate_add_bytes(RateCtl *rate, size_t bytes_used)
1754 {
1755 if (rate->peeked_frames < 0 || rate->peeked_frames > 65536) {
1757 - AUD_log(NULL, "Resetting rate control (%" PRId64 " frames)\n",
1758 - rate->peeked_frames);
1756 + trace_audio_rate_reset(rate->peeked_frames);
1757 audio_rate_start(rate);
1758 }
1759
audio/audio_template.h
+8 -11
@@ -47,21 +47,19 @@ static void glue(audio_init_nb_voices_, TYPE)(AudioMixengBackend *s,
47 if (glue(s->nb_hw_voices_, TYPE) > max_voices) {
48 if (!max_voices) {
49 #ifdef DAC
50 - dolog("Driver `%s' does not support " NAME "\n", k->name);
50 + warn_report("audio: Driver '%s' does not support " NAME, k->name);
51 #endif
52 } else {
53 - dolog("Driver `%s' does not support %d " NAME " voices, max %d\n",
54 - k->name,
55 - glue(s->nb_hw_voices_, TYPE),
56 - max_voices);
53 + warn_report("audio: Driver '%s' does not support %d " NAME " voices, max %d",
54 + k->name, glue(s->nb_hw_voices_, TYPE), max_voices);
55 }
56 glue(s->nb_hw_voices_, TYPE) = max_voices;
57 }
58
59 if (glue(s->nb_hw_voices_, TYPE) < min_voices) {
62 - dolog("Bogus number of " NAME " voices %d, setting to %d\n",
63 - glue(s->nb_hw_voices_, TYPE),
64 - min_voices);
60 + warn_report("audio: Bogus number of " NAME " voices %d, setting to %d",
61 + glue(s->nb_hw_voices_, TYPE),
62 + min_voices);
63 }
64
65 if (!voice_size && max_voices) {
@@ -443,7 +441,7 @@ static SW *glue(audio_pcm_create_voice_pair_, TYPE)(
441
442 hw = glue(audio_pcm_hw_add_, TYPE)(s, &hw_as);
443 if (!hw) {
446 - dolog("Could not create a backend for voice `%s'\n", sw_name);
444 + error_report("audio: Could not create a backend for voice '%s'", sw_name);
445 goto err1;
446 }
447
@@ -537,8 +535,7 @@ static SW *glue(audio_mixeng_backend_open_, TYPE) (
535 HW *hw = sw->hw;
536
537 if (!hw) {
540 - dolog("Internal logic error: voice `%s' has no backend\n",
541 - SW_NAME(sw));
538 + audio_bug("Internal logic error: voice '%s' has no backend", SW_NAME(sw));
539 goto fail;
540 }
541
audio/trace-events
+1
@@ -70,6 +70,7 @@ audio_sw_write(const char *name, size_t size, size_t written, size_t total_mixed
70 audio_get_free(const char *name, size_t live, size_t dead, uint32_t frontend_frames) "%s: get_free live %zu dead %zu frontend frames %u"
71 audio_out_disable(void) "Disabling voice"
72 audio_out_played(size_t played) "played=%zu"
73 +audio_rate_reset(int64_t frames) "Resetting rate control (%" PRId64 " frames)"
74
75 # audio_template.h
76 audio_open_out(const char *name, int freq, int nchannels, int fmt) "open %s, freq %d, nchannels %d, fmt %d"