From 0f6d2131882e05e230f648626b81586c052b4da0 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Sat, 9 Jun 2018 00:30:40 +0200 Subject: 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 --- 4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c') 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) -- cgit 1.2.3-korg