From 60901d26b753c3c59dec16043536d21d5b063b8a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 3 Dec 2020 21:29:21 +0100 Subject: [PATCH] ALSA: improve debug output --- libs/backends/alsa/alsa_audiobackend.cc | 4 ++++ libs/backends/alsa/zita-alsa-pcmi.cc | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index dcb5bb6da5..042ea82258 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -903,11 +903,15 @@ AlsaAudioBackend::_start (bool for_latency_measurement) } #ifndef NDEBUG + fprintf (stdout, " --[[ ALSA Device %s\n", alsa_device.c_str()); _pcmi->printinfo (); + fprintf (stdout, " --]]\n"); #else /* If any debug parameter is set, print info */ if (getenv ("ZITA_ALSA_PCMI_DEBUG")) { + fprintf (stdout, " --[[ ALSA Device %s\n", alsa_device.c_str()); _pcmi->printinfo (); + fprintf (stdout, " --]]\n"); } #endif diff --git a/libs/backends/alsa/zita-alsa-pcmi.cc b/libs/backends/alsa/zita-alsa-pcmi.cc index 57e4789379..de5c2b8aa8 100644 --- a/libs/backends/alsa/zita-alsa-pcmi.cc +++ b/libs/backends/alsa/zita-alsa-pcmi.cc @@ -362,7 +362,7 @@ int Alsa_pcmi::capt_done (int len) void Alsa_pcmi::printinfo (void) { - fprintf (stdout, "playback :"); + fprintf (stdout, "playback"); if (_play_handle) { fprintf (stdout, "\n nchan : %d\n", _play_nchan); @@ -370,9 +370,11 @@ void Alsa_pcmi::printinfo (void) fprintf (stdout, " fsize : %ld\n", _fsize); fprintf (stdout, " nfrag : %d\n", _real_nfrag); fprintf (stdout, " format : %s\n", snd_pcm_format_name (_play_format)); + } else { + fprintf (stdout, " : not enabled\n"); } - else fprintf (stdout, " not enabled\n"); - fprintf (stdout, "capture :"); + + fprintf (stdout, "capture"); if (_capt_handle) { fprintf (stdout, "\n nchan : %d\n", _capt_nchan); @@ -381,8 +383,9 @@ void Alsa_pcmi::printinfo (void) fprintf (stdout, " nfrag : %d\n", _capt_nfrag); fprintf (stdout, " format : %s\n", snd_pcm_format_name (_capt_format)); if (_play_handle) fprintf (stdout, "%s\n", _synced ? "synced" : "not synced"); + } else { + fprintf (stdout, " : not enabled\n"); } - else fprintf (stdout, " not enabled\n"); }