aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-api-loop.c
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2018-11-08 13:59:50 +0100
committerThierry Bultel <thierry.bultel@iot.bzh>2018-11-08 13:59:50 +0100
commita17d5239d2e72daa25a07a761fcece345701c7ff (patch)
tree363ea7f8934b3e2c1ceb1b8a7f3c4a66c49f450f /plugins/alsa/alsa-api-loop.c
parent92e0380860dbc556ef2a1f9fbc0cd7eb99edad69 (diff)
Fix the error string of attach actions
Fixes the "syntax-error" to something more explicit (SPEC-1906) Change-Id: I9d4c81ee1d62dcfb99799480c6dc910e2019a791 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'plugins/alsa/alsa-api-loop.c')
-rw-r--r--plugins/alsa/alsa-api-loop.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/alsa/alsa-api-loop.c b/plugins/alsa/alsa-api-loop.c
index e2d789e..61bdc99 100644
--- a/plugins/alsa/alsa-api-loop.c
+++ b/plugins/alsa/alsa-api-loop.c
@@ -100,14 +100,16 @@ STATIC AlsaSndLoopT *AttachOneLoop(SoftMixerT *mixer, const char *uid, json_obje
, "subdevs", &subdevsJ
);
if (error || !loop->uid || !subdevsJ || (!loop->sndcard->cid.devpath && !loop->sndcard->cid.cardid)) {
- AFB_ApiNotice(mixer->api, "AttachOneLoop mixer=%s hal=%s missing 'uid|path|cardid|devices|subdevs' error=%s args=%s", mixer->uid, uid, wrap_json_get_error_string(error),json_object_get_string(argsJ));
+ AFB_ApiNotice(mixer->api, "%s mixer=%s hal=%s missing 'uid|path|cardid|devices|subdevs' error=%s args=%s",
+ __func__, mixer->uid, uid, wrap_json_get_error_string(error),json_object_get_string(argsJ));
goto OnErrorExit;
}
// try to open sound card control interface
loop->sndcard->ctl = AlsaByPathOpenCtl(mixer, loop->uid, loop->sndcard);
if (!loop->sndcard->ctl) {
- AFB_ApiError(mixer->api, "AttachOneLoop mixer=%s hal=%s Fail open sndcard loop=%s devpath=%s cardid=%s (please check 'modprobe snd_aloop')", mixer->uid, uid, loop->uid, loop->sndcard->cid.devpath, loop->sndcard->cid.cardid);
+ AFB_ApiError(mixer->api, "%s mixer=%s hal=%s Fail open sndcard loop=%s devpath=%s cardid=%s (please check 'modprobe snd_aloop')",
+ __func__, mixer->uid, uid, loop->uid, loop->sndcard->cid.devpath, loop->sndcard->cid.cardid);
goto OnErrorExit;
}
@@ -118,7 +120,8 @@ STATIC AlsaSndLoopT *AttachOneLoop(SoftMixerT *mixer, const char *uid, json_obje
} else {
error = wrap_json_unpack(devicesJ, "{si,si !}", "capture", &loop->capture, "playback", &loop->playback);
if (error) {
- AFB_ApiNotice(mixer->api, "AttachOneLoop mixer=%s hal=%s Loop=%s missing 'capture|playback' error=%s devices=%s", mixer->uid, uid, loop->uid, wrap_json_get_error_string(error),json_object_get_string(devicesJ));
+ AFB_ApiNotice(mixer->api, "%s mixer=%s hal=%s Loop=%s missing 'capture|playback' error=%s devices=%s",
+ __func__, mixer->uid, uid, loop->uid, wrap_json_get_error_string(error),json_object_get_string(devicesJ));
goto OnErrorExit;
}
}
@@ -140,7 +143,8 @@ STATIC AlsaSndLoopT *AttachOneLoop(SoftMixerT *mixer, const char *uid, json_obje
}
break;
default:
- AFB_ApiError(mixer->api, "AttachOneLoop mixer=%s hal=%s Loop=%s invalid subdevs= %s", mixer->uid, uid, loop->uid, json_object_get_string(subdevsJ));
+ AFB_ApiError(mixer->api, "%s mixer=%s hal=%s Loop=%s invalid subdevs= %s",
+ __func__, mixer->uid, uid, loop->uid, json_object_get_string(subdevsJ));
goto OnErrorExit;
}
@@ -193,7 +197,7 @@ PUBLIC int ApiLoopAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, j
}
break;
default:
- AFB_IfReqFailF(mixer, request, "invalid-syntax", "mixer=%s hal=%s loops invalid argsJ= %s", mixer->uid, uid, json_object_get_string(argsJ));
+ AFB_IfReqFailF(mixer, request, "bad-loop", "mixer=%s hal=%s loops invalid argsJ= %s", mixer->uid, uid, json_object_get_string(argsJ));
goto OnErrorExit;
}