summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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 Aillet9-38/+88
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 Aillet3-20/+7
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 Aillet3-40/+74
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-08-12Add information about events in README.mdJonathan Aillet1-6/+213
Add information about events in README.md : - Add information about existing 'internal' hal events. - Add information about events to provide for an 'external' hal. BUG-AGL: SPEC-2683 Change-Id: I46e43fab026f850fd67852a19442ef6987872b61 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-12Minor corrections in README.mdJonathan Aillet1-3/+3
Correct some typo and call format for '4a-hal-manager loaded'. BUG-AGL: SPEC-2683 Change-Id: I67916fcecab1efa4646badfd54ef87c8f6889dc5 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-06Correct ramps call syntax in README.mdJonathan Aillet1-2/+2
Correct ramps call syntax in README.md. BUG-AGL: SPEC-2683 Change-Id: Ib580a3dc7c681949c542f8dec1eb97fd14e9088a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-07-31Add an example json configurationJonathan Aillet1-0/+272
Add an example json configuration files to show how to write "haldependencies" and "halmap" sections. BUG-AGL: SPEC-2683 Change-Id: I3642677ec6aae6144d2e30dc3f3680ebf473dccf Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-07-31README.md updatesJonathan Aillet1-149/+704
Update README.md to describe last version of hal functionalities and how to compile/use 4a-hal. BUG-AGL: SPEC-2683 Change-Id: I8ddf97872fc34c6e3fb3a9f7cc59a096849854fa 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 Aillet4-27/+203
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-07-18Correct typo in stream handling filesJonathan Aillet2-4/+4
Correct typo in stream handling files. BUG-AGL: SPEC-2652 Change-Id: I3a1ee384dabf564b9d4903e2bac51210d357ff8f 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 Aillet7-88/+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 Aillet6-130/+337
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 Aillet4-31/+82
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 Aillet8-265/+276
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 Aillet3-54/+159
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-25Add function to get probed device card numberJonathan Aillet2-0/+13
Add function to get probed device card number using its uid. BUG-AGL: SPEC-2329 Change-Id: I75bd368d0b1d0ab6d41fc0d75b30511fa7e8584f 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 Aillet5-147/+76
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 Aillet6-216/+216
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 Aillet7-147/+181
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-18Move function about dependency selectionJonathan Aillet1-27/+27
Move function used to test if a dependency is selected. BUG-AGL: SPEC-2329 Change-Id: Ic577a33741d705e09dd14a48dde0483db792b97d 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-06Add func to generate 'hal-dependencies' info jsonJonathan Aillet2-7/+389
Add functions to generate 'hal-dependencies' information json. Provide two type of json generation ('compact' with only extended card number info, and 'full' with all ALSA card info). Provide function to get information about all 'hal-dependencies' and another function to get information about validated 'hal-dependencies'. BUG-AGL: SPEC-2329 Change-Id: If04cbbab7c79a066d2d03fa5ff16ea698de9b018 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 Aillet5-86/+138
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-06-06Split too long function declarationsJonathan Aillet2-8/+19
Split too long function declarations in hal-utilities. BUG-AGL: SPEC-2329 Change-Id: Ia8a18844dd7db52b19db366d737240286d04f9cd 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>
2019-05-29Add forgotten spaces in some multi-lines printsJonathan Aillet2-6/+6
Add forgotten spaces in some multi-lines prints. BUG-AGL: SPEC-2329 Change-Id: I84457ac695a613b3cf280c3e8fb4f25b71070438 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-29Rework internal hals event handlingJonathan Aillet1-28/+54
Rework internal hals event handling to avoid : - rare segmentation fault. - too early alsa-core events subscription. - use of not available data. BUG-AGL: SPEC-2329 Change-Id: Ib84103682614b80bca3c0c2251779775cd35744f Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Add 'haldependencies' section support.halibut_7.99.1halibut/7.99.17.99.1Jonathan Aillet3-0/+29
Add 'haldependencies' section into handled section table. Also, add a function to redirect to 'processing' and to 'handling' functions depending hal initialization stage. BUG-AGL: SPEC-2329 Change-Id: I4fa09493fecf48844bff171e2e8ca764f9fe8f18 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Add functions to handle 'haldependencies'Jonathan Aillet1-0/+182
Add functions to handle new 'haldependencies' section. This new section will be used to probe for multiple audio device using only one hal. Each probed device could be 'mandatory', 'dynamic' (optional but periodically probed), or 'static' (optional and probed only at startup). The result of handling this section will be used by softmixer and in 'halmap' section. BUG-AGL: SPEC-2329 Change-Id: Ib763b86c0f306abba7a886f5a348d5414ab5e88d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Add functions to process 'haldependencies'Jonathan Aillet1-0/+317
Add functions to process new 'haldependencies' section. This new section will be used to probe for multiple audio device using only one hal. Each probed device could be 'mandatory', 'dynamic' (optional but periodically probed), or 'static' (optional and probed only at startup). The result of handling this section will be used by softmixer and in 'halmap' section. BUG-AGL: SPEC-2329 Change-Id: Id4ea2a9c5d87158f0cfa9a88bc5c9296770a6a9b Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Add function to handle probed audio device listJonathan Aillet2-0/+242
Add function to handle probed audio device list. This list will be used to store incoming 'haldependencies' section data. It will also be used to store audio card information resulting from probing requested audio devices specified in 'haldependencies' section. BUG-AGL: SPEC-2329 Change-Id: Iaa9aaba7a01263ca2d17be01c32803702568d614 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Store 'uid' metadata in hal data structureJonathan Aillet3-1/+4
'uid' field is currently used to store the audio device to search for the hal. But with haldependencies' feature, 'uid' field won't be used to search for the audio device anymore. So, 'uid' field is stored elsewhere into the hal data structure (returned when asking for hal informations). BUG-AGL: SPEC-2329 Change-Id: Ib3b2b3bacaecfa80a51f94f9d6874789baba0224 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Add a function to call 'infoget' verb of alsacoreJonathan Aillet2-22/+37
Add 'HalCtlsGetCardInfo' function to call 'infoget' verb of 'alsacore' api. Use this function for all call to 'infoget' to avoid duplicated code. BUG-AGL: SPEC-2329 Change-Id: I66436af87126258773c332ed4cc2df013acd306d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Rework mixer answer handlingJonathan Aillet5-53/+131
Rework mixer answer handling to make it simpler and to avoid fanciful returns. Add some error prints to help diagnostic in case of mixer answer handling error. BUG-AGL : SPEC-2329 Change-Id: I14fe86496585bdc66b8aa761f4ff2c56333c5515 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Remove obsolete links to softmixer controlsJonathan Aillet9-220/+41
Remove obsolete links to playbacks/captures softmixer controls. These links are not used anymore (only 'halmap' controls are used). It also means that references to controls in 'halmixer' section of json configuration files must be removed (as it's done for example json configuration file in this commit). BUG-AGL : SPEC-2329 Change-Id: Ic5a7f055d09b44021d817c04d56023fed3c0e478 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Remove obsolete variable set for 'afb_helpers'Jonathan Aillet2-18/+0
Remove obsolete global variable set for 'afb_helpers'. BUG-AGL: SPEC-2329 Change-Id: I41ec3d486a893a940cd96779d07ab61799a76e13 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Remove use of a global variable for hal-managerJonathan Aillet3-35/+12
Remove use of a global variable for hal-manager data. BUG-AGL: SPEC-2329 Change-Id: Ifc5a85aedb75f89a364de1411c1e12f293095550 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>