summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2018-06-22 11:29:49 +0200
committerThierry Bultel <thierry.bultel@iot.bzh>2018-06-22 11:29:49 +0200
commitcf7b396370ae1ca0de597a5f8a5baf5012a46b6d (patch)
tree6859b5962ab8d0c19566897ac6f86b0477189ad2
parent38f7eb2d7bad24276cd40f0a4766fc1b8d72bfbb (diff)
alsa-plug-vol: code & log cleanup
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
-rw-r--r--plugins/alsa/alsa-plug-vol.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/alsa/alsa-plug-vol.c b/plugins/alsa/alsa-plug-vol.c
index 54f3c6d..310a8b8 100644
--- a/plugins/alsa/alsa-plug-vol.c
+++ b/plugins/alsa/alsa-plug-vol.c
@@ -27,6 +27,8 @@ PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *strea
AlsaPcmCtlT *pcmVol= calloc(1,sizeof(AlsaPcmCtlT));
int error = 0;
+ AFB_ApiInfo(mixer->api, "%s create SOFTVOL on %s\n", __func__, slaveid);
+
char *cardid = NULL;
if (asprintf(&cardid, "softvol-%s", stream->uid) == -1)
goto OnErrorExit;
@@ -61,7 +63,9 @@ PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *strea
if (open) error = _snd_pcm_softvol_open(&pcmVol->handle, stream->uid, snd_config, streamConfig, SND_PCM_STREAM_PLAYBACK , SND_PCM_NONBLOCK);
if (error) {
- AFB_ApiError(mixer->api, "AlsaCreateSoftvol:%s(stream) fail to create Plug=%s Slave=%s error=%s", stream->uid, pcmVol->cid.cardid, sndcard->cid.cardid, snd_strerror(error));
+ AFB_ApiError(mixer->api,
+ "%s: %s(stream) fail to create Plug=%s Slave=%s error=%s",
+ __func__, stream->uid, pcmVol->cid.cardid, sndcard->cid.cardid, snd_strerror(error));
goto OnErrorExit;
}
@@ -71,20 +75,22 @@ PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *strea
error += snd_config_search(snd_config, "pcm", &pcmConfig);
error += snd_config_add(pcmConfig, streamConfig);
if (error) {
- AFB_ApiError(mixer->api, "AlsaCreateSoftvol:%s(stream) fail to add config error=%s", stream->uid, snd_strerror(error));
+ AFB_ApiError(mixer->api,
+ "%s: %s(stream) fail to add config error=%s",
+ __func__, stream->uid, snd_strerror(error));
goto OnErrorExit;
}
// Debug config & pcm
//AlsaDumpCtlConfig (mixer, "plug-config", pcmConfig, 1);
- //AlsaDumpCtlConfig(mixer, "plug-softvol", streamConfig, 1);
- AFB_ApiNotice(mixer->api, "AlsaCreateSoftvol:%s(stream) done\n", stream->uid);
+ AlsaDumpCtlConfig(mixer, "plug-softvol", streamConfig, 1);
+ AFB_ApiNotice(mixer->api, "%s: %s(stream) done", __func__, stream->uid);
return pcmVol;
OnErrorExit:
free(cardid);
//AlsaDumpCtlConfig (mixer, "plug-config", pcmConfig, 1);
AlsaDumpCtlConfig(mixer, "plug-softvol", streamConfig, 1);
- AFB_ApiNotice(mixer->api, "AlsaCreateSoftvol:%s(stream) OnErrorExit\n", stream->uid);
+ AFB_ApiNotice(mixer->api, "AlsaCreateSoftvol:%s(stream) OnErrorExit", stream->uid);
return NULL;
}