summaryrefslogtreecommitdiffstats
path: root/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-09 00:30:40 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:52:51 +0200
commit0f6d2131882e05e230f648626b81586c052b4da0 (patch)
treebe871b747128f8fe51c6a7d3ffb3aab6f3ac26b1 /4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
parentcc1ec41093c3b0db3b8bdf8e8949ecdacceda190 (diff)
Move mixer attach at hal startup
Move mixer attach at hal startup instead of making attachment possible only with a verb. Now, if the hal audio device is detected at startup, it will automatically be attached to the mixer. As it is useless now, the verb used to attach mixer has been deleted. Change-Id: I32c8b829ac37fb31ede4fe8830a6f2a699c0835c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c')
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
index f0ef696..404ecd2 100644
--- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
+++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
@@ -31,6 +31,7 @@
#include "4a-hal-controllers-api-loader.h"
#include "4a-hal-controllers-alsacore-link.h"
#include "4a-hal-controllers-cb.h"
+#include "4a-hal-controllers-mixer-handler.h"
// Default api to print log when apihandle not available
AFB_ApiT AFB_default;
@@ -60,7 +61,6 @@ static struct HalUtlApiVerb CtlHalDynApiStaticVerbs[] =
{
/* VERB'S NAME FUNCTION TO CALL SHORT DESCRIPTION */
{ .verb = "list", .callback = HalCtlsListVerbs, .info = "List available verbs for this api"},
- { .verb = "init-mixer", .callback = HalCtlsInitMixer, .info = "Init Hal with 4a-softmixer"},
{ .verb = NULL } // Marker for end of the array
};
@@ -71,6 +71,8 @@ static struct HalUtlApiVerb CtlHalDynApiStaticVerbs[] =
static int HalCtlsInitOneApi(AFB_ApiT apiHandle)
{
+ int err;
+
CtlConfigT *ctrlConfig;
struct SpecificHalData *currentCtlHalData;
@@ -109,8 +111,11 @@ static int HalCtlsInitOneApi(AFB_ApiT apiHandle)
if(currentCtlHalData->sndCardId < 0)
currentCtlHalData->status = HAL_STATUS_UNAVAILABLE;
- else
+ else {
currentCtlHalData->status = HAL_STATUS_AVAILABLE;
+ if((err = HalCtlsAttachToMixer(apiHandle)))
+ AFB_ApiError(apiHandle, "%s: Error %i while attaching to mixer", __func__, err);
+ }
// TBD JAI: handle refresh of hal status for dynamic card (/dev/by-id)