diff options
Diffstat (limited to 'src/4a-internals-hal/4a-internals-hal-cb.c')
-rw-r--r-- | src/4a-internals-hal/4a-internals-hal-cb.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-cb.c b/src/4a-internals-hal/4a-internals-hal-cb.c index c5f19a2..1e872bb 100644 --- a/src/4a-internals-hal/4a-internals-hal-cb.c +++ b/src/4a-internals-hal/4a-internals-hal-cb.c @@ -725,6 +725,7 @@ int InternalHalHalMixerConfig(afb_api_t apiHandle, CtlSectionT *section, json_ob CtlConfigT *ctrlConfig; struct HalData *currentHalData; + struct InternalHalProbedDevice *currentProbedDevice; if(! apiHandle || ! section) return -1; @@ -752,17 +753,31 @@ int InternalHalHalMixerConfig(afb_api_t apiHandle, CtlSectionT *section, json_ob return -6; if(prefix) { - currentHalData->internalHalData->prefix = strdup(prefix); + currentHalData->internalHalData->prefix = strdup(prefix); if(! currentHalData->internalHalData->prefix) return -7; } } else if(currentHalData->status == HAL_STATUS_AVAILABLE) { - err = InternalHalAttachToMixer(apiHandle); - if(err) { - AFB_API_ERROR(apiHandle, "Error %i while attaching to mixer", err); - return -8; + cds_list_for_each_entry(currentProbedDevice, ¤tHalData->internalHalData->probedDevicesListHead, node) { + if(! currentProbedDevice->deviceData) { + currentProbedDevice->mixerLinkStatus = DEPENDENCY_MIXER_LINK_USELESS; + continue; + } + + if(currentProbedDevice->mixerLinkStatus == DEPENDENCY_MIXER_ATTACH_SUCCEED) { + AFB_API_WARNING(apiHandle, "Mixer status is already initialized, moving to next one"); + continue; + } + + err = InternalHalAttachDependencyToMixer(apiHandle, currentProbedDevice); + if(err) { + AFB_API_ERROR(apiHandle, "Error %i while attaching to mixer", err); + return -8; + } } + + currentHalData->status = HAL_STATUS_READY; } return 0; |