summaryrefslogtreecommitdiffstats
path: root/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-24Clarify internals hal functions and files namesJonathan Aillet1-629/+0
The purpose of this commit is to have of a more standard way to name files and functions used to generate/handle hal api (generated from hal json configuration file). It occurred to me that 'hal-controller' was not a good name because it is harder for people who don't know about the app-controller to understanded what is the purpose of these files/functions. It was renamed to 'internal-hal' because it's about hal that are all handle/load by hal-manager in opposition of external-hal that are independant binding/binder that can register themselves to hal-manager. BUG-AGL: SPEC-2329 Change-Id: I11b7efe64ec474b004a2a15ed8969b9db95d428f Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-02-19Updates for latest alsacore changesJonathan Aillet1-17/+16
Updates calls to 'infoget' of 'alsacore' due to recent changes in alsacore. Change-Id: If7259c50cceac26fea6e0966eaccb5a1ed5d132b Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Migrate to newer application framework callsJonathan Aillet1-114/+123
Migrate from 'afb_api_call_sync_legacy' function to 'afb_api_call_sync' function, therefore, handle function return and response json differently from before. Change-Id: Ia7fb42188b8d41e22db2d824459a0d10ed6d6a8e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Move from controller functions to afb functionsJonathan Aillet1-156/+151
Move from controller 'afb-definitions.h' functions to application framework 'afb/afb-binding.h' functions. Change-Id: I4cd62af881ef8ac949b082ede9dfcc4736d1e12c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Turn '4a-hal-utilities' into an internal libraryJonathan Aillet1-29/+5
That way, includes will be cleaner and '4a-hal-utilities' functions will be usable in plugin. Change-Id: I8a2146bd4e5dd5ef449b9ba7f2b1eed4d59045d3 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Add setting values of a ALSA control using a +/-Jonathan Aillet1-4/+23
Add the possibility to change halmap ALSA controls values using a +/- percentage string. Bug-AGL: SPEC-1313 Change-Id: I3b2cf141fc01171fd403c2602fb3805e654e8d68 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Send back control previous and current valuesJonathan Aillet1-5/+36
Send back control previous and current values if the value(s) specified in request json has been applied correctly when calling halmap verbs. Bug-AGL: SPEC-1313 Change-Id: Ie190b4749a6739945a82532909281fb70c92df5d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Send back control current values if no request jsonJonathan Aillet1-4/+31
Return current ALSA control values if no request json is specified when calling halmap verbs. Bug-AGL: SPEC-1313 Change-Id: I74cc03cdcbe975979be4ad2d353ee44cf8cc13ed Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Add a function to get values of an alsa controlJonathan Aillet1-23/+84
Rework communication with 'alsacore' binding to be able to get current ALSA controls values. Bug-AGL: SPEC-1313 Change-Id: If1b4b9bdc49849772075e184768f572ac88fe6c3 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Improve ALSA controls volume values conversionJonathan Aillet1-3/+12
Rework halmap ALSA controls volume conversion to be able to add new types of volume conversions easily. Bug-AGL: SPEC-1313 Change-Id: I0949f25c24a349e7409233f51b3d5738ebc43a8a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Update syntax of a request of an halmap verbJonathan Aillet1-1/+1
Update syntax of a request of an halmap verb : Use key 'value' instead of 'val'. Change-Id: Iadbb05f0bf70c689e1657f065a8f3b1ae31a8849 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Typo fix in halmap call responseJonathan Aillet1-2/+2
Change-Id: I6bc9ba16ec22a21e43221d335bd61bacae197a14 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Correct halmap calls request json syntaxJonathan Aillet1-8/+3
Correct halmap calls request json syntax : The request json must be a json_object type. Change-Id: If443b5480678354193c2419a72ffb711fadd416f Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-11-02Use new ctl functions to set/get ctl external dataJonathan Aillet1-1/+1
Use new controller functions to set/get controller configuration structure external data field. Change-Id: I0e1ce259fccbbd8b4054efbed07cef5c5b9243b5 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-11-02Use ctl defines to call afb functionsJonathan Aillet1-3/+3
Use controller 'afb-defintions.h' defines to call application framework functions. Change-Id: If9599b0397a593440ce2e08f039dc279c63f7428 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Remove unnecessary 'function' string in printsJonathan Aillet1-16/+15
Function's names was printed using '__func__' when calling application framework prints functions. But, as the application framework prints functions already prints them, '__func__' has been removed from print calls to avoid duplicated information. Change-Id: I0dea49a9d84b7ccdbdaecec67ced6c98b5ed26d6 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Use correct file to include controllerJonathan Aillet1-1/+1
Use correct file ('ctl-config.h') instead of (''ctl-plugin.h) to include controller. Change-Id: I93a1bcb5dab51211532fc59ffd979ea7acad1530 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct an error when unpacking alsacore responseJonathan Aillet1-1/+1
Correct an error when unpacking alsacore event subscription response. Change-Id: I39d331303d99363c36444fa642e8cb4ca16e84d8 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Remove boolean libraryJonathan Aillet1-1/+0
As it was almost never used in code, remove boolean library. Change-Id: I9264ffd5600a7d9526f4f4cfa8209a0cd0e5bb77 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Free json objects that should have been freedJonathan Aillet1-38/+58
Free json objects that should have been freed after use. Change-Id: Ifb3dab9672d0c039292ae05f23ade008fe82ade8 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct a cast errorJonathan Aillet1-1/+1
Correct a cast error that was causing a segfault in some unknown condition. Change-Id: I96c89c04d4f6bd5177446c56b4c50cbab30b4830 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add free of 'CtlHalAlsaMapT' data structureJonathan Aillet1-1/+22
Add free of 'CtlHalAlsaMapT' data structure. Change-Id: Icabc1d6f0d6e6977fead8260dd3932c6004c5d10 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update request success macro used in codeJonathan Aillet1-1/+1
Update request success macro used in code to correct compilation error. Change-Id: I0cb9c07b27000935b01aaaa17d5656f05d4e21ff Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add value normalization of alsa control valuesJonathan Aillet1-7/+20
Add functions that allows to normalize values that are requested to be sent with an alsa set control call (using alsacore). Change-Id: I5046a66d807c9b9b6751e036a47303ceddc0c16a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Get alsa controls properties at control getJonathan Aillet1-10/+27
Get alsa controls properties by parsing the response sent by balsacore when we search for an existing alsa control. Change-Id: I9d13327ae2ef79c793dbd227589740f7e336e46c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Process and handle alsa controls mapJonathan Aillet1-0/+360
Process and handle alsa controls map by : Parse and store info from 'halmap' section into a structure. If the hal is available : - Test if controls are available (if use of existing control). - Create new controls (if use of control to create). - Add a verb for each element of the section. - Handle call to alsa when a verb request is detected. - Resgister to event from this device. - Handle call to action if event on this control is detected. Change-Id: I246e16e9d02e64a1778f5c78d2458a33bdfb6d7e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change the way to get card id using its pathJonathan Aillet1-25/+25
Change the way to get card id using its path by returning directly the found card id. Corrects a typo in alsa core link header. Change-Id: Ib202632e049921a57428b31a29f7def4d9e78aaa Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Include afb-definitions when using application frameworkJonathan Aillet1-5/+5
Include <afb-definitions.h> from 'app-controller' instead of <afb/afb-binding.h> and use its definitions. It allows to migrate from an application framework version to another with less impact on the code. Change-Id: I22359cd3fe22145b3d6c551f227be2ba7e1b65d5 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Handle hal status using card presence and mixer initJonathan Aillet1-0/+79
Test audio card presence at hal startup using alsacore call. Handling a new state of hal. Move alsacore link files into 4a-hal-controllers. Check state of hal before mixer initialization call. Actualize hal state if mixer initlialization ends well. Add a sndCardId filed to 'SpecificHalData' structure which will contain audio card if (from alsa). Change-Id: I2e82a14ee6ba6e63f06fe2b498587783941b7b98 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>