summaryrefslogtreecommitdiffstats
path: root/HAL-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 /HAL-afb
parentb6e3522aae05d770b06d3af7c0cbf71d3a3a447f (diff)
Fix Initial Volume for Jabra
Diffstat (limited to 'HAL-afb')
-rw-r--r--HAL-afb/HAL-interface/hal-interface.c6
-rw-r--r--HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c2
-rw-r--r--HAL-afb/Jabra-Solemate/JabraUsbHAL.c20
3 files changed, 14 insertions, 14 deletions
diff --git a/HAL-afb/HAL-interface/hal-interface.c b/HAL-afb/HAL-interface/hal-interface.c
index ad5eabb..4a32d72 100644
--- a/HAL-afb/HAL-interface/hal-interface.c
+++ b/HAL-afb/HAL-interface/hal-interface.c
@@ -138,7 +138,7 @@ STATIC int halCallAlsaSetCtls(json_object *ctlsOutJ) {
json_object_object_add(queryJ, "devid", json_object_new_string(halSndCard->devid));
json_object_object_add(queryJ, "ctl", ctlsOutJ);
- err = afb_service_call_sync("alsacore", "setctl", queryJ, &responseJ);
+ err = afb_service_call_sync("alsacore", "ctlset", queryJ, &responseJ);
json_object_put(responseJ); // let's ignore response
return err;
@@ -312,7 +312,7 @@ STATIC json_object *halCallAlsaGetCtls(json_object *ctlsOutJ) {
json_object_object_add(queryJ, "devid", json_object_new_string(halSndCard->devid));
json_object_object_add(queryJ, "ctl", ctlsOutJ);
- err = afb_service_call_sync("alsacore", "getctl", queryJ, &responseJ);
+ err = afb_service_call_sync("alsacore", "ctlget", queryJ, &responseJ);
if (err) goto OnErrorExit;
// Let ignore info data if any and keep on response
@@ -518,7 +518,7 @@ PUBLIC int halServiceInit(const char *apiPrefix, alsaHalSndCardT *alsaHalSndCard
if (halCtls[idx].ctl.step) json_object_object_add(ctlJ, "step", json_object_new_int(halCtls[idx].ctl.step));
if (halCtls[idx].ctl.type) json_object_object_add(ctlJ, "type", json_object_new_int(halCtls[idx].ctl.type));
if (halCtls[idx].ctl.count) json_object_object_add(ctlJ, "count", json_object_new_int(halCtls[idx].ctl.count));
- if (halCtls[idx].ctl.value) json_object_object_add(ctlJ, "value", json_object_new_int(halCtls[idx].ctl.value));
+ if (halCtls[idx].ctl.value) json_object_object_add(ctlJ, "val", json_object_new_int(halCtls[idx].ctl.value));
if (halCtls[idx].ctl.dbscale) {
json_object *dbscaleJ = json_object_new_object();
diff --git a/HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c b/HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c
index 06fc0c1..5e29b59 100644
--- a/HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c
+++ b/HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c
@@ -87,7 +87,7 @@ __attribute__ ((unused)) static void unicens_request_card_values(const char* dev
goto OnErrorExit;
}
- afb_service_call("alsacore", "getctl", j_query,
+ afb_service_call("alsacore", "ctlget", j_query,
&unicens_request_card_values_cb,
NULL);
diff --git a/HAL-afb/Jabra-Solemate/JabraUsbHAL.c b/HAL-afb/Jabra-Solemate/JabraUsbHAL.c
index 03d53d8..d3ddcfc 100644
--- a/HAL-afb/Jabra-Solemate/JabraUsbHAL.c
+++ b/HAL-afb/Jabra-Solemate/JabraUsbHAL.c
@@ -17,9 +17,9 @@
*
* To find out which control your sound card uses
* aplay -l # Check sndcard name name in between []
- * amixer -D hw:USB controls # get supported controls
- * amixer -Dhw:USB cget name=Power-Switch
- * amixer -Dhw:USB cset name=Power-Switch true
+ * amixer -D hw:v1340 controls # get supported controls
+ * amixer -Dhw:v1340 cget name=Power-Switch
+ * amixer -Dhw:v1340 cset name=Power-Switch true
*
*/
#define _GNU_SOURCE
@@ -63,8 +63,8 @@ STATIC halVolRampT volRampEmergency= {
// Map HAL hight sndctl with Alsa numid and optionally with a custom callback for non Alsa supported functionalities.
STATIC alsaHalMapT alsaHalMap[]= {
- { .tag=Master_Playback_Volume, . ctl={.name="PCM Playback Volume" } },
- { .tag=PCM_Playback_Volume , .ctl={.name="PCM Playback Volume" } },
+ { .tag=Master_Playback_Volume, . ctl={.name="PCM Playback Volume", .value=12 } },
+ { .tag=PCM_Playback_Volume , .ctl={.name="PCM Playback Volume", .value=12 } },
{ .tag=PCM_Playback_Switch , .ctl={.name="PCM Playback Switch" } },
{ .tag=Capture_Volume , .ctl={.name="Mic Capture Volume" } },
@@ -74,17 +74,17 @@ STATIC alsaHalMapT alsaHalMap[]= {
},
// Implement Rampup Volume for Virtual Channels
- { .tag=Multimedia_Playback_Volume, .cb={.callback=volumeRamp, .handle=&volRampMultimedia}, .info="Rampup Multimedia Volume",
- .ctl={.numid=CTL_AUTO, .type=SND_CTL_ELEM_TYPE_INTEGER, .name="Playback Multimedia Ramp"}
- },
{ .tag=Navigation_Playback_Volume, .cb={.callback=volumeRamp, .handle=&volRampNavigation}, .info="RampUp Navigation Volume",
- .ctl={.numid=CTL_AUTO, .type=SND_CTL_ELEM_TYPE_INTEGER,.name="Playback Navigation Ramp"}
+ .ctl={.numid=CTL_AUTO, .type=SND_CTL_ELEM_TYPE_INTEGER,.name="Playback Navigation Ramp", .value=80 }
},
{ .tag=Emergency_Playback_Volume, .cb={.callback=volumeRamp, .handle=&volRampEmergency}, .info="Rampup Emergency Volume",
- .ctl={.numid=CTL_AUTO, .type=SND_CTL_ELEM_TYPE_INTEGER,.name="Playback Emergency Ramp"}
+ .ctl={.numid=CTL_AUTO, .type=SND_CTL_ELEM_TYPE_INTEGER,.name="Playback Emergency Ramp", .value=80 }
},
// Sound Card does not support hardware channel volume mixer (note softvol default range 0-256)
+ { .tag=Multimedia_Playback_Volume, .cb={.callback=volumeRamp, .handle=&volRampMultimedia}, .info="Ramp-up Multimedia Volume",
+ .ctl={.numid=CTL_AUTO, .type=SND_CTL_ELEM_TYPE_INTEGER, .name="Playback Multimedia Ramp", .value=80 }
+ },
{ .tag=PCM_Volume_Multimedia, .info="Playback Multimedia Softvol",
.ctl={.numid=CTL_AUTO, .type=SND_CTL_ELEM_TYPE_INTEGER, .count=2, .maxval=255, .value=200, .name="Playback Multimedia"}
},