summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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>
2019-05-24Improve search for mixer data in linked listJonathan Aillet1-4/+5
Improve search for specific mixer data in linked list when the search is using stream properties. BUG-AGL: SPEC-2329 Change-Id: Idd5ea0540ace508b8b8351f38a3832f7d0f8a760 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Improve static verbs loadingJonathan Aillet6-87/+5
Improve static verbs loading by using 'afb_api_set_verbs_v3' application_framework function. BUG-AGL: SPEC-2329 Change-Id: I3fe5397316d4a582635da637ab6a207b606c496e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Add forgotten verifications of allocation resultsJonathan Aillet8-117/+359
Concern several types of allocation such as : - malloc/calloc - json_object_new_* - wrap_json_pack - strdup BUG-AGL: SPEC-2329 Change-Id: Iffe2a6a44ef4df2ed0ec4d159682159db5e78cfb Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Correct mistakes due to use of unsigned returnsJonathan Aillet6-29/+29
Correct mistakes due to use of unsigned returns. Also, simplify use of int by replacing 'int8_t' and 'int64_t' types by plain 'int' type. BUG-AGL: SPEC-2329 Change-Id: I24fe273c5a233762c072f7bc9e79eab32a1c824c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Add freeing of halmap data table in case of errorJonathan Aillet1-0/+1
Add freeing of halmap data table in case of error when parsing 'halmap' section. BUG-AGL: SPEC-2329 Change-Id: Ic2c819dfc3155122ade0f37bb06fa304f4859779 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Add forgotten freeing of hal dataJonathan Aillet1-0/+3
Add forgotten freeing of hal data when removing hal from linked list. BUG-AGL: SPEC-2329 Change-Id: Iddef1c1f23be587792907f4ab009a2567f4b7834 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Normalize coding style among repositoryJonathan Aillet11-287/+321
Normalize coding style among project : - When possible, set the variable outside test in 'if' statement. - Remove fanciful returns. - Split too long lines. - Remove unnecessary '\n' into prints. - Normalize use of tabulation. - Use 'afb_req_fail' instead of 'afb_req_fail_f' when possible. - Add some error prints. BUG-AGL: SPEC-2329 Change-Id: I14867e05e02b4c4c0389108c335fec2d2aa27495 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Correct 'config.cmake' fileJonathan Aillet1-5/+10
Correct mistakes and update some entries in 'config.cmake' file. BUG-AGL: SPEC-2329 Change-Id: Iaf3c92ab8bf8a9246ab51c0a8d8943bdf55f02dc Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Reorganize repository directoriesJonathan Aillet26-1/+23
Reorganize repository directories to clarify code use. BUG-AGL: SPEC-2329 Change-Id: Ia9be0c1818cb2e331e75b51a87fcb2820407c1d8 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-05-24Clarify internals hal functions and files namesJonathan Aillet21-575/+631
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-05-22Clarify use of linked listJonathan Aillet8-82/+85
Clarify use of linked list by renaming some variables and functions. BUG-AGL: SPEC-2329 Change-Id: I21ada0b2914c99dfeecfcb6b55c8976dee1a0cd7 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-04-19Remove unused 4a-hal-manager events handler filesJonathan Aillet4-58/+0
Remove unused 4a-hal-manager events handler files. BUG-AGL: SPEC-2329 Change-Id: Ic0d02e93641f3ae9ec6ba2e7134987770987b1ca Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-04-19Rename misnamed var in values changing functionJonathan Aillet1-9/+9
Rename misnamed variable in function used to change ALSA values using percentage. BUG-AGL: SPEC-2329 Change-Id: I7ba630f591d0d1af0c7f021002493a80817b27a1 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-04-19Rename misnamed var name in hal manager load funcJonathan Aillet1-3/+3
Rename misnamed variable name in hal manager load function. BUG-AGL: SPEC-2329 Change-Id: I47922c3df935ad0f59eb62ac9d521e076893b0fb Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-04-19Rename misnamed param in 'halmap' config functionJonathan Aillet1-1/+1
Rename misnamed parameter in function used to parse and handle 'halmap' section. BUG-AGL: SPEC-2329 Change-Id: I5b0e17665ac4580c4efb2931cb1fc2d6da52e87e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-04-19Rename misnamed function used to search for halJonathan Aillet3-4/+3
Rename misnamed function used to search for ready hal using its audio card id. BUG-AGL: SPEC-2329 Change-Id: I62ad371f10bff2e23e059b4020fbe16ece6e87c9 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-02-18.gitignore: added wildcard for build directoryThierry Bultel1-1/+1
Change-Id: I5ce4ec091b60a62414f0f8cdce829feba0d8c212 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-02-18bluealsa plugin: do not do anything when the HAL is not readyThierry Bultel1-7/+21
Change-Id: Ifad933c3c5f574aad437a59708c01c6d674dc914 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-02-13bluealsa plugin: get the sampling rate from the transportThierry Bultel2-9/+32
The sampling rate, for both SCO and A2DP, had been harcoded for convenience. But this is not a constant, because it depends on the connected handset. This commit retrieves the sampling rate for each new transport and uses that information as a parameter for the stream creation in the softmixer. Change-Id: I4d30eccba9cc63d7f4e618c571719996a136b4f5 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-02-07hal-bluealsa: fixes the abort due to sync call in io eventhalibut_7.90.0halibut/7.90.07.90.0Thierry Bultel1-17/+4
The binder does not accept that synchronous calls are performed in the context of a systemd event, it makes is abort. To solve that, synchronous calls for creating/deleting bluetooth streams in the softmixer are simply here replaced by asynchronous calls. BUG-AGL: SPEC-2162 Change-Id: I4916d11cc904622449930365c5c09f67fe74425f Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-01-29bluealsa plugin: monitor the state of service via dbusThierry Bultel4-29/+219
By monitoring the changes of names on dbus, and by asking dbus for the list of available names at startup, the bluealsa plugin can now be started at whatever time, and is also robust to bluealsa restarts. Moreover, since the bluealsa name has the HCI interface has a suffix (org.bluez-alsa.hci0, for instance), there is not need to hardcode the hci name. Even better, the plugin supports several instances of bluealsa (since the daemon needs one instace per hci device), and will add a watch for added transports for every instance it detects. Complete cleanup of the created streams in softmixer is done when one watched instance disappears. Finnaly, there is a new cmd line '-DWITHOUT_BLUEALSA' option to CMake, for developpers that want to use 4A on host, without the bluealsa library. Default build (SDK, bitbake) consider that the bluealsa shared library is always available. Notice that in the future, the bluealsa library might disappeared, to be replaced by a full dbus interface to bluealsa. BUG-AGL:SPEC-2126 Change-Id: I67fc6edf5147c71dc97f1fc1257d3dadbdde20fc Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-01-28Migrate to newer application framework callsJonathan Aillet9-397/+220
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-28Migrate app-controller from submodule to libraryJonathan Aillet6-13/+1
Change-Id: I5a3de70994374e9a447fde67eef5925915335863 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Migrate afb-helpers from submodule to libraryJonathan Aillet6-7/+2
Change-Id: I1d554d29e11f7bac327ed65b4187dac3572ae0a6 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>