aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-12-03Remove forgotten pieces of codeHEADicefish_8.99.5icefish_8.99.4icefish_8.99.3icefish/8.99.5icefish/8.99.4icefish/8.99.38.99.58.99.48.99.3masterJonathan Aillet1-2/+0
Remove some forgotten pieces of code about cleaning binding data at binder exit. BUG-AGL: SPEC-2910 Change-Id: Iffb8898b8df97236910642251f7f009cdfb8cf50 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Add function that prepare closing binder on exiticefish_8.99.2icefish_8.99.1icefish/8.99.2icefish/8.99.18.99.28.99.1Jonathan Aillet3-1/+40
Add function that prepare closing binder when exit signal is received. That includes reverting hal api performed actions (e.g. removing added custom ALSA control, ...) and deleting all hal api. Register this function to be call at binder exit (using 'on_exit'). BUG-AGL: SPEC-2910 Change-Id: I49a5b65c303561bede4c93a2eb3284395fa9f1e7 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Add a function to delete all hal apiJonathan Aillet2-0/+40
BUG-AGL: SPEC-2893 Change-Id: I577565ac2134f87151491644c74c057e3634ed52 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Unmanage all halmap before deleting hal apiJonathan Aillet1-2/+13
Unmanage all halmap before deleting hal api. This assures removing all added custom ALSA control before deleting hal api. BUG-AGL: SPEC-2893 Change-Id: Id7af6c198d3d215709e81679e4e310d24b501458 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Add functions to unmanage handled halmapJonathan Aillet2-28/+142
Add functions to unmanage handled halmap. Using these functions, it is possible to unmanage : - a specific halmap. - dependency related halmaps (e.g. at dynamic dependency disconnection). - all handled halmaps (a.g. at binder exit). BUG-AGL: SPEC-2893 Change-Id: I24c40ade8a392b30ad962e2396fdb5f8d7e71b33 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Add function to delete an ALSA controlJonathan Aillet2-0/+88
Add function to delete a previously created ALSA control. BUG-AGL: SPEC-2893 Change-Id: If6890712b167bba021812e899ec878075d5472af Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Unsubscribe from unwanted eventsJonathan Aillet1-3/+20
Unsubscribe from ALSA card control events when the card is not used by any 'halmap'. BUG-AGL: SPEC-2892 Change-Id: I3ce2ae8e7133797778d3d0edd393324aa345ef1f Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Handle 'alsacore' events in a dedicated functionJonathan Aillet3-76/+199
Handle 'alsacore' events in a dedicated function. For now, only 'controls' events are handled. This modification will also ease addition of other 'alsacore' events. BUG-AGL: SPEC-2885 Change-Id: Ie56d4d58242fd7ff78306d85b54d48ed771f3227 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Add function to unsubscribe from audio card eventJonathan Aillet2-7/+27
Add function to unsubscribe from Alsacore audio card event. BUG-AGL: SPEC-2891 Change-Id: I2b9856a8c6e795c46bf0ae7382859ea2859bf985 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Rework Alsacore subscription functionsJonathan Aillet3-11/+38
Reworking of Alsacore subscription functions to ease adding new Alsacore events subscription. BUG-AGL: SPEC-2891 Change-Id: I8796bc5923e640cccd5a27167a0aa58ca4967609 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Add an 'info' verb to 'hal-manager'Jonathan Aillet3-0/+89
Add an 'info' verb to 'hal-manager' that allows to get information about all json hal. The verbose level can be specified. If it is not, it will be set to the lowest by default. BUG-AGL: SPEC-2890 Change-Id: I113a733b32e1b758f94586006df6ab0130cf097a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Add verbose level to json hal info verbJonathan Aillet3-54/+100
Add verbose level to specify the requested information level when calling a json hal 'info' verb. Also, move into a function the code that allows to get information about json hal. BUG-AGL: SPEC-2889 Change-Id: I9d5cbc6cfa550f4f7c8033dad0f3ec66d1268ea5 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Add function to 'detach' dependency from mixerJonathan Aillet2-0/+84
Add function to perform a 'detach' verb call to mixer to detach a dependency. This will be useful for 'dynamic' dependency handling. BUG-AGL: SPEC-2888 Change-Id: I4468b9fb0dedb79b637883ef88683274713765fa Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Rework mixer calls to handle dependenciesJonathan Aillet3-11/+30
Rework 'attach' mixer calls to handle dependencies individually. That means that an attach call will be performed for each dependency. To avoid errors when calling mixer, complete list of dependencies should be send to it, but we can specify which dependency we want to be processed using 'handled' key. BUG-AGL: SPEC-2887 Change-Id: I9db7391fe7a44ba045fd82d94221a1442b7c2198 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Move hal api delete code into a functionJonathan Aillet3-11/+46
BUG-AGL: SPEC-2885 Change-Id: I23c605440782f8caeef30c1fe41f4cac5b704dbb Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Reorder 'internals-hal-cb.c' functionsJonathan Aillet2-559/+559
Reorder hal json section handling functions in 'internals-hal-cb.c' to match processing order define in 'ctrlSectionsDefault' table. BUG-AGL: SPEC-2885 Change-Id: I9bf2c59706982339b5676fe900c7f48af68b96c8 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Correct behaviour of halmap handling functionJonathan Aillet1-2/+2
Correct behaviour of halmap handling function by : - Avoid unnecessary set to 0 newly allocated data. - Correct return value. BUG-AGL: SPEC-2884 Change-Id: I647812e8fe8770954ada5cfded2505bf9f412699 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Correction of print in control creation functionJonathan Aillet1-1/+1
Correction of an error print in ALSA control creation function. BUG-AGL: SPEC-2884 Change-Id: I518eae1595bfeaaf9437e442895efea2f3c77904 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Remove an unnecessary double pointerJonathan Aillet1-7/+3
Remove an unnecessary double pointer in 'InternalHalHandleOneHalDependencies' function. BUG-AGL: SPEC-2884 Change-Id: I20e0b0d11288814322b3480a70b77df14a08564a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Remove useless things about ping functionJonathan Aillet1-1/+0
Remove useless things about 'HalUtlPing' function. BUG-AGL: SPEC-2884 Change-Id: I8ad30e91ac45d340a5f64922da6a87658a3cd2b3 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Prevent binder exit when hal initialization failsJonathan Aillet3-8/+13
No longer returns an error in hal api initialization function when an non-blocking error happens (e.g. card-sound not found). This will prevent application framework binder exit. BUG-AGL: SPEC-2906 Change-Id: I0ef5e5f624fc0021771f40f37ce5663510a7e03e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-09-26Update call to 'subscribe' verb of 'alsacore' apiJonathan Aillet3-8/+14
Update call to 'subscribe' verb of 'alsacore' api to match last '4a-alsacore' events/subscription handling updates. BUG-AGL: SPEC-2832 Change-Id: Ib6b5e1f4536440fd4f83a07d66fe047bfa889a5b Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-09-26Rename dependencies object keyJonathan Aillet1-1/+1
Rename dependencies object key to avoid having references to '4a-hal' in '4a-smixer. BUG-AGL: SPEC-2831 Change-Id: Ibc7ff7551eccfe9dfade951d44c10185f16b1e5c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-12Move ping function in 4a-hal-utilitiesJonathan Aillet3-22/+5
Move ping function in 4a-utilities and register it as verb into 4a-hal-manager and into each created 4a-hal-*. Updates 4a-hal json configuration files to match these modifications. BUG-AGL: SPEC-2733 Change-Id: If93a31296206923860262b225a8c7e0e8a6fd521 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-12Add information when calling mixer attach verbJonathan Aillet1-3/+3
Add information about not resolved dependencies when calling mixer attach verb (will be used to detect json format error). BUG-AGL: SPEC-2733 Change-Id: Iae5f339aacef9fd97b923e75142d9cd0176f4b6f Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-12Remove error when no stream was created by mixerJonathan Aillet1-9/+22
Remove error generation when no stream was created by mixer at 'attach' call. BUG-AGL: SPEC-2733 Change-Id: If5f0b521c449d3599925abe5e3e5a22d849f3c5d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-12Create 'all_streams' verb at binding startupJonathan Aillet2-15/+2
Create 'all_streams' verb at binding startup, that way, it will always be created. Generate a request fail when a call is done when no streams are created. BUG-AGL: SPEC-2733 Change-Id: I1b7ec3b8ed0fcd617e4a016e455beb447d233c82 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-12Optimize hal 'info' response json allocationJonathan Aillet1-29/+15
Optimize hal 'info' response json allocation by removing empty objects/arrays from response. BUG-AGL: SPEC-2733 Change-Id: I521626b67076b603ab1caa974b697246c8fff759 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-07-18Remove hal if an error happened at hal inithalibut_8.0.6halibut_8.0.5halibut_8.0.4halibut_8.0.3halibut_8.0.2halibut_8.0.1halibut_8.0.0halibut/8.0.6halibut/8.0.5halibut/8.0.4halibut/8.0.3halibut/8.0.2halibut/8.0.1halibut/8.0.08.0.68.0.58.0.48.0.38.0.28.0.18.0.0halibutJonathan Aillet1-2/+33
Remove hal api and hal data if an error happened at hal initialization. Also prevent binding to stop if a hal failed to init. BUG-AGL: SPEC-2652 Change-Id: Ifcef2fdf135e152f300febf6a934e43352f86fc2 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-07-18Add hal api handler utilities filesJonathan Aillet1-27/+6
Add utilities files to create/delete hal apis while adding hal data to hal data list. Use it to create new hal apis. BUG-AGL: SPEC-2652 Change-Id: I62e99cda31bb2c6f597da27960102c036a25b733 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-07-18Correct error level for hal-dependenciesJonathan Aillet1-4/+4
Correct error level when a mandatory hal-dependencies is not available. BUG-AGL: SPEC-2652 Change-Id: I053913a83be8124eaac26dd4f2cd28d1e5ff5083 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-26Remove global card number of halhalibut_7.99.3halibut_7.99.2halibut/7.99.3halibut/7.99.27.99.37.99.2Jonathan Aillet6-86/+32
As we are now using haldependencies to get hal card number(s), it does not make sense to store a global card number for a hal. BUG-AGL: SPEC-2329 Change-Id: If5beb84b71b5e5e67aeabd947b5c3edbf154fa3c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-26Use haldependencies to process and handle halmapJonathan Aillet2-88/+239
Use haldependencies section definition to process and to handle halmap section. That means that each 'halmap' control can use its own probed audio device card number using a targeted dependencies. Also, change halmap section definition to be able to handle several halmap defined with the same dependencies. Update example hal to match new json file format. BUG-AGL: SPEC-2329 Change-Id: I31997a037ee8f0e727e0a67866d651b988b85260 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-25Avoid unnecessary overwriting of ALSA ctrl dataJonathan Aillet1-13/+7
Avoid overwriting stored ALSA control properties data when only calling to get current ALSA control values. BUG-AGL: SPEC-2329 Change-Id: Iaaef1266aea334c8799ab31fd2e523871be9b3a7 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-25Avoid unnecessary call for ALSA ctrl propertiesJonathan Aillet1-4/+5
Avoid getting ALSA control properties if the structure to store them is not allocated. BUG-AGL: SPEC-2329 Change-Id: If5fbacc7616250d8abf86f561f51a147868fea07 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-25Use a dynamic allocation for halmap data storageJonathan Aillet2-30/+70
Use a dynamically allocated structure to store properties about ALSA controls (halmap). BUG-AGL: SPEC-2329 Change-Id: I691648452d6c950d201bc25977a493608fede197 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-25Use of linked list for 'halmap' dataJonathan Aillet3-132/+124
Use of linked list for 'halmap' data instead of a fixed array. It uses the same mechanism already implemented for other linked list. BUG-AGL: SPEC-2329 Change-Id: I2ff9c9a797a5547cd74f0240c5b7573a02c90781 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-25Rework json strings allocation/freeingJonathan Aillet2-25/+70
Rework json strings allocation/freeing because : - Some json strings are freed twice. - Some containing strings json are not correctly freed. BUG-AGL: SPEC-2329 Change-Id: I90f9470c6a4bc4b1641a01dd2da5051da1ff9547 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-25Move function used to process all halmap objectsJonathan Aillet1-50/+50
Move function used to process all halmap json objects. BUG-AGL: SPEC-2329 Change-Id: I692b1810ce2298b24198a001c26b9233740ca31a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-18Add a function to handle selected dependencyJonathan Aillet2-19/+67
Add a function to handle selected dependency using its uid. BUG-AGL: SPEC-2329 Change-Id: I0e92448f9102bc5e6e0f19d1598d75c1ba782863 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-18Refactoring 'hal data' linked listJonathan Aillet3-19/+15
Refactoring 'hal data' linked list code using liburcu. BUG-AGL: SPEC-2329 Change-Id: Ia51d362f96838f4b5bb77e8d1b85fa8d1ab4bed1 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-18Refactoring 'streams data' linked listJonathan Aillet3-12/+9
Refactoring 'streams data' linked list code using liburcu. BUG-AGL: SPEC-2329 Change-Id: Idf9367c015d73574d96d83c82a9e8f5b7588a45d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-18Refactoring 'probed devices' linked listJonathan Aillet4-18/+17
Refactoring 'probed devices' linked list code using liburcu. BUG-AGL: SPEC-2329 Change-Id: I4d0255bc020733b1abbea1f3e6195c73cf8da8f6 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-06Add 'hal-dependencies' info in 'loaded' responseJonathan Aillet1-3/+10
Add all 'hal-dependencies' compact json info in response of hal-manager 'loaded' verb call. BUG-AGL: SPEC-2329 Change-Id: I45a94c80be078236fbc581e62654f5261e1b281e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-06Add 'hal-dependencies' info at hal 'info' callJonathan Aillet1-3/+13
Add available 'hal-dependencies' full json info in response of hal 'info' verb call. BUG-AGL: SPEC-2329 Change-Id: I74615b84d015d142a6aebc291fb9e849a053344a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-06Send 'hal-dependencies' info with mixer attachJonathan Aillet1-5/+16
Send available 'hal-dependencies' compact json info with mixer attach call to allow mixer to use 'hal-dependencies' for audio cards detection/resolution. BUG-AGL: SPEC-2329 Change-Id: I0e64a45bc9296e1aa1310f6c01b1ebbce8524dcd Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-06Correct an wrong declared enumerationJonathan Aillet1-2/+2
Correct an wrong declared enumeration by setting first enum item at '0' instead of '1'. BUG-AGL: SPEC-2329 Change-Id: Ia142e5c64d2e6a5415f27edc87fa0787d2088f5c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-06Prevent errors when multiple devices are foundJonathan Aillet1-0/+1
Prevent errors when multiple devices are found by a 'hal-dependency' BUG-AGL: SPEC-2329 Change-Id: I276cc7abe19d5c0ee27ee3a8950271f58dd14f04 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-06-06Move functions used to generate jsonJonathan Aillet1-84/+4
Move functions used to generate hal information json into there corresponding files in hal-utilities. BUG-AGL: SPEC-2329 Change-Id: Id518e7f732ef393bbf98f3b3a32edf01ec81f70c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-31Add prints when a controller error is detectedJonathan Aillet1-3/+17
Add prints when a controller error is detected at json loading/exection. BUG-AGL: SPEC-2329 Change-Id: I8b3319115ce98694e7f382fd39c39e5422a38021 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>