aboutsummaryrefslogtreecommitdiffstats
path: root/Alsa-afb/Alsa-AddCtl.c
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/Alsa-AddCtl.c
parentb6e3522aae05d770b06d3af7c0cbf71d3a3a447f (diff)
Fix Initial Volume for Jabra
Diffstat (limited to 'Alsa-afb/Alsa-AddCtl.c')
-rw-r--r--Alsa-afb/Alsa-AddCtl.c8
1 files changed, 6 insertions, 2 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);