13
0

ALSA: improve debug output

This commit is contained in:
Robin Gareus 2020-12-03 21:29:21 +01:00
parent b79520d316
commit 60901d26b7
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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");
}