aboutsummaryrefslogtreecommitdiffstats
path: root/Alsa-afb
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-08-25 01:10:00 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-08-25 01:10:00 +0200
commit7dda5549b51ce1bbf674c620a5715986d7da4ffd (patch)
tree57b0af6551e55c1207a7d8cbae4fa573fbf85541 /Alsa-afb
parentb6e3522aae05d770b06d3af7c0cbf71d3a3a447f (diff)
Fix Initial Volume for Jabra
Diffstat (limited to 'Alsa-afb')
-rw-r--r--Alsa-afb/Alsa-AddCtl.c8
-rw-r--r--Alsa-afb/Alsa-ApiHat.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/Alsa-afb/Alsa-AddCtl.c b/Alsa-afb/Alsa-AddCtl.c
index b9045f5..aaa9347 100644
--- a/Alsa-afb/Alsa-AddCtl.c
+++ b/Alsa-afb/Alsa-AddCtl.c
@@ -114,7 +114,7 @@ STATIC json_object * addOneSndCtl(afb_req request, snd_ctl_t *ctlDev, json_objec
if (done) ctlType = json_object_get_int(tmpJ);
else ctlType = SND_CTL_ELEM_TYPE_INTEGER;
- json_object_object_get_ex(ctlJ, "value", &tmpJ);
+ json_object_object_get_ex(ctlJ, "val", &tmpJ);
ctlValue = json_object_get_int(tmpJ);
// default for json_object_get_int is zero
@@ -162,7 +162,11 @@ STATIC json_object * addOneSndCtl(afb_req request, snd_ctl_t *ctlDev, json_objec
snd_ctl_elem_info_get_id(elemInfo, elemId);
// If this is a hardware ctl only update value
- if (ctlNumid != CTL_AUTO) goto UpdateDefaultVal;
+ if (ctlNumid != CTL_AUTO) {
+ json_object_object_get_ex(ctlJ, "val", &tmpJ);
+ ctlValue = json_object_get_int(tmpJ);
+ goto UpdateDefaultVal;
+ }
count = snd_ctl_elem_info_get_count(elemInfo);
min = (int) snd_ctl_elem_info_get_min(elemInfo);
diff --git a/Alsa-afb/Alsa-ApiHat.c b/Alsa-afb/Alsa-ApiHat.c
index bbb3959..e5172de 100644
--- a/Alsa-afb/Alsa-ApiHat.c
+++ b/Alsa-afb/Alsa-ApiHat.c
@@ -43,11 +43,11 @@ STATIC int AlsaInit(void) {
static const struct afb_verb_v2 api_verbs[] = {
/* VERB'S NAME FUNCTION TO CALL */
{ .verb = "ping", .callback = pingtest, .info="Ping Presence Check on API"},
- { .verb = "getinfo", .callback = alsaGetInfo, .info="Return sound cards list"},
- { .verb = "getctl", .callback = alsaGetCtls, .info="Get one or many control values"},
- { .verb = "setctl", .callback = alsaSetCtls, .info="Set one control or more"},
+ { .verb = "infoget", .callback = alsaGetInfo, .info="Return sound cards list"},
+ { .verb = "ctlget", .callback = alsaGetCtls, .info="Get one or many control values"},
+ { .verb = "ctlset", .callback = alsaSetCtls, .info="Set one control or more"},
{ .verb = "subscribe", .callback = alsaEvtSubcribe, .info="subscribe to alsa events"},
- { .verb = "getcardid", .callback = alsaGetCardId, .info="get sound card id"},
+ { .verb = "cardidget", .callback = alsaGetCardId, .info="get sound card id"},
{ .verb = "halregister", .callback = alsaRegisterHal, .info="register a new HAL in alsacore"},
{ .verb = "hallist", .callback = alsaActiveHal, .info="Get list of currently active HAL"},
{ .verb = "ucmquery", .callback = alsaUseCaseQuery,.info="Use Case Manager Query"},