From 5f3578ec65db7de2ba0c50854a1a3bf512334f4e Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Tue, 15 Mar 2016 22:59:12 +0100 Subject: [PATCH] [alsa] Some extra logging for debugging --- src/laudio_alsa.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/laudio_alsa.c b/src/laudio_alsa.c index 2fbc060e..17b0b79f 100644 --- a/src/laudio_alsa.c +++ b/src/laudio_alsa.c @@ -86,6 +86,8 @@ laudio_alsa_xrun_recover(int err) /* Buffer underrun */ if (err == -EPIPE) { + DPRINTF(E_WARN, L_LAUDIO, "PCM buffer underrun\n"); + pcm_last_error = 0; ret = snd_pcm_prepare(hdl); @@ -343,6 +345,8 @@ laudio_alsa_set_volume(int vol) static int laudio_alsa_start(uint64_t cur_pos, uint64_t next_pkt) { + snd_output_t *output; + char *debug_pcm_cfg; int ret; ret = snd_pcm_prepare(hdl); @@ -382,6 +386,19 @@ laudio_alsa_start(uint64_t cur_pos, uint64_t next_pkt) return -1; } + // Dump PCM config data for E_DBG logging + ret = snd_output_buffer_open(&output); + if (ret == 0) + { + if (snd_pcm_dump_setup(hdl, output) == 0) + { + snd_output_buffer_string(output, &debug_pcm_cfg); + DPRINTF(E_DBG, L_LAUDIO, "Dump of sound device config:\n%s\n", debug_pcm_cfg); + } + + snd_output_close(output); + } + update_status(LAUDIO_STARTED); return 0;