aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2018-06-22 11:16:13 +0200
committerThierry Bultel <thierry.bultel@iot.bzh>2018-06-22 11:24:40 +0200
commit30b321a440472b99efc5480a0b76fa50def4cc08 (patch)
tree55ef2705e62412587904fa785e97400cac7dfe4a
parent407cfbe3a6b5a200c290bb3d471145e60ef306ac (diff)
alsa-utils-dump: added log upon failing parameters retrieval
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
-rw-r--r--plugins/alsa/alsa-utils-dump.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/alsa/alsa-utils-dump.c b/plugins/alsa/alsa-utils-dump.c
index c9bd3d4..953f005 100644
--- a/plugins/alsa/alsa-utils-dump.c
+++ b/plugins/alsa/alsa-utils-dump.c
@@ -70,18 +70,22 @@ OnErrorExit:
return NULL;
}
-PUBLIC void AlsaDumpFormats(SoftMixerT *mixer, snd_pcm_t *pcmHandle) {
+PUBLIC void AlsaDumpFormats(SoftMixerT *mixer, snd_pcm_t *pcm) {
char string[32];
+ int ret;
snd_pcm_format_t format;
snd_pcm_hw_params_t *pxmHwParams;
- // retrieve hadware config from PCM
+ // retrieve hardware config from PCM
snd_pcm_hw_params_alloca(&pxmHwParams);
- snd_pcm_hw_params_any(pcmHandle, pxmHwParams);
+ ret = snd_pcm_hw_params_any(pcm, pxmHwParams);
+ if (ret < 0) {
+ AFB_ApiError(mixer->api, "FAILED to read params of PCM %s\n", snd_pcm_name(pcm));
+ }
- AFB_ApiNotice(mixer->api, "Available formats: PCM=%s", ALSA_PCM_UID(pcmHandle, string));
+ AFB_ApiNotice(mixer->api, "Available formats: PCM=%s", ALSA_PCM_UID(pcm, string));
for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
- if (snd_pcm_hw_params_test_format(pcmHandle, pxmHwParams, format) == 0) {
+ if (snd_pcm_hw_params_test_format(pcm, pxmHwParams, format) == 0) {
AFB_ApiNotice(mixer->api, "- %s", snd_pcm_format_name(format));
}
}