From: Marc-André Lureau <[email protected]> Use warn_report/error_report and trace instead.
Reviewed-by: Mark Cave-Ayland <[email protected]> Reviewed-by: Akihiko Odaki <[email protected]> Signed-off-by: Marc-André Lureau <[email protected]> --- audio/audio_template.h | 19 ++++++++----------- audio/audio-mixeng-be.c | 14 ++++++-------- audio/trace-events | 1 + 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/audio/audio_template.h b/audio/audio_template.h index 9dde36738bc..760aaf5f31f 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -47,21 +47,19 @@ static void glue(audio_init_nb_voices_, TYPE)(AudioMixengBackend *s, if (glue(s->nb_hw_voices_, TYPE) > max_voices) { if (!max_voices) { #ifdef DAC - dolog("Driver `%s' does not support " NAME "\n", k->name); + warn_report("audio: Driver '%s' does not support " NAME, k->name); #endif } else { - dolog("Driver `%s' does not support %d " NAME " voices, max %d\n", - k->name, - glue(s->nb_hw_voices_, TYPE), - max_voices); + warn_report("audio: Driver '%s' does not support %d " NAME " voices, max %d", + k->name, glue(s->nb_hw_voices_, TYPE), max_voices); } glue(s->nb_hw_voices_, TYPE) = max_voices; } if (glue(s->nb_hw_voices_, TYPE) < min_voices) { - dolog("Bogus number of " NAME " voices %d, setting to %d\n", - glue(s->nb_hw_voices_, TYPE), - min_voices); + warn_report("audio: Bogus number of " NAME " voices %d, setting to %d", + glue(s->nb_hw_voices_, TYPE), + min_voices); } if (!voice_size && max_voices) { @@ -443,7 +441,7 @@ static SW *glue(audio_pcm_create_voice_pair_, TYPE)( hw = glue(audio_pcm_hw_add_, TYPE)(s, &hw_as); if (!hw) { - dolog("Could not create a backend for voice `%s'\n", sw_name); + error_report("audio: Could not create a backend for voice '%s'", sw_name); goto err1; } @@ -537,8 +535,7 @@ static SW *glue(audio_mixeng_backend_open_, TYPE) ( HW *hw = sw->hw; if (!hw) { - dolog("Internal logic error: voice `%s' has no backend\n", - SW_NAME(sw)); + audio_bug("Internal logic error: voice '%s' has no backend", SW_NAME(sw)); goto fail; } diff --git a/audio/audio-mixeng-be.c b/audio/audio-mixeng-be.c index 45bcfb74338..87e5a2fc3af 100644 --- a/audio/audio-mixeng-be.c +++ b/audio/audio-mixeng-be.c @@ -654,7 +654,7 @@ static size_t audio_mixeng_backend_write(AudioBackend *be, SWVoiceOut *sw, hw = sw->hw; if (!hw->enabled) { - dolog("Writing to disabled voice %s\n", SW_NAME(sw)); + warn_report("audio: Writing to disabled voice %s", SW_NAME(sw)); return 0; } @@ -677,7 +677,7 @@ static size_t audio_mixeng_backend_read(AudioBackend *be, hw = sw->hw; if (!hw->enabled) { - dolog("Reading from disabled voice %s\n", SW_NAME(sw)); + warn_report("audio: Reading from disabled voice %s", SW_NAME(sw)); return 0; } @@ -874,9 +874,8 @@ static void audio_capture_mix_and_clear(HWVoiceOut *hw, size_t rpos, sw->empty = sw->total_hw_samples_mixed == 0; if (to_read - frames_in) { - dolog("Could not mix %zu frames into a capture " - "buffer, mixed %zu\n", - to_read, frames_in); + audio_bug("Could not mix %zu frames into a capture " + "buffer, mixed %zu", to_read, frames_in); break; } n -= to_read; @@ -1561,7 +1560,7 @@ static CaptureVoiceOut *audio_mixeng_backend_add_capture( } if (!audio_get_pdo_out(s->dev)->mixing_engine) { - dolog("Can't capture with mixeng disabled\n"); + error_report("audio: Can't capture with mixeng disabled"); return NULL; } @@ -1754,8 +1753,7 @@ size_t audio_rate_peek_bytes(RateCtl *rate, struct audio_pcm_info *info) void audio_rate_add_bytes(RateCtl *rate, size_t bytes_used) { if (rate->peeked_frames < 0 || rate->peeked_frames > 65536) { - AUD_log(NULL, "Resetting rate control (%" PRId64 " frames)\n", - rate->peeked_frames); + trace_audio_rate_reset(rate->peeked_frames); audio_rate_start(rate); } diff --git a/audio/trace-events b/audio/trace-events index ed04792d508..222e73c7e88 100644 --- a/audio/trace-events +++ b/audio/trace-events @@ -70,6 +70,7 @@ audio_sw_write(const char *name, size_t size, size_t written, size_t total_mixed 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" audio_out_disable(void) "Disabling voice" audio_out_played(size_t played) "played=%zu" +audio_rate_reset(int64_t frames) "Resetting rate control (%" PRId64 " frames)" # audio_template.h audio_open_out(const char *name, int freq, int nchannels, int fmt) "open %s, freq %d, nchannels %d, fmt %d" -- 2.53.0
