summaryrefslogtreecommitdiffstats
path: root/4a-hal
AgeCommit message (Collapse)AuthorFilesLines
2019-05-24Reorganize repository directoriesJonathan Aillet15-3218/+0
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 Aillet14-397/+440
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 Aillet6-21/+21
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 Aillet1-1/+1
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-01-28Migrate to newer application framework callsJonathan Aillet4-169/+182
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 Aillet1-2/+0
Change-Id: I5a3de70994374e9a447fde67eef5925915335863 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Migrate afb-helpers from submodule to libraryJonathan Aillet1-1/+0
Change-Id: I1d554d29e11f7bac327ed65b4187dac3572ae0a6 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Move from controller functions to afb functionsJonathan Aillet14-634/+617
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-28Create 'halmap' ALSA controls events earlierJonathan Aillet1-13/+13
Create 'halmap' ALSA controls events earlier to avoid errors at 4a-hal-generic binder startup. Change-Id: I5976f5d4c358b21108ec136f791841b4ea15c666 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Add event to indicate hal stream changesJonathan Aillet2-0/+27
This event can be used to be notified when a stream has been added/removed from hal. Change-Id: I0511b948accf4d3dc25e5603cbaaf5f1da741b49 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Improve stream creation/deletion functionsJonathan Aillet4-251/+15
Add functions to add/remove stream verb while adding/deleting stream data. Use them to create streams when mixer response is received. Change-Id: I158b04cef7f6ce4f58a9c7481b6ebad00de989e3 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Use linked-list to handle hal stream listJonathan Aillet4-114/+135
Use linked-list instead of an array to handle hal stream list. Usefull to add/remove dynamic stream (e.g. bluetooth). Change-Id: I39bbf0f16941f1c4642c916fdc5143a683c6460c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Turn '4a-hal-utilities' into an internal libraryJonathan Aillet18-709/+28
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-20Remove old comments not true anymoreJonathan Aillet3-3/+0
Remove old comments not true anymore about moving to application framewrok v3 functions but it has already be done some weeks ago. Change-Id: Ia5dfc7a47d9e9eb929fa6c79fa37686206131301 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Add halmap controls events generation for all halJonathan Aillet2-3/+59
Each hal will now allow other bindings to subscribe to halmap ALSA controls events to be notified when a modification happened on a control. Bug-AGL: SPEC-1313 Change-Id: Ia6a019b254c78e5e752b0d39a7cf35114c1fc460 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Add streams events generation for each halJonathan Aillet6-0/+176
Each hal will now have subscribe/unsubscribe verbs to allow other bindings to be notified when a modification (volume, mute, ...) happened on a stream. Bug-AGL: SPEC-1313 Change-Id: If68d3b4b4e39385c1fffdd04b9f3e2b7fa5ae108 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Rework calls to mixer streamsJonathan Aillet5-48/+193
When using 'playback'/'capture' verbs, call all associated controls. When at least one stream has been created by the mixer, a verb called 'all-streams' is added to transfer a request to all the streams. Bug-AGL: SPEC-1313 Change-Id: Ie574e2ef0dcae8abbd45523b49093ec2ed1413cf Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Add 'halmap' controls in hal 'info' verb responseJonathan Aillet2-21/+77
Add 'halmap' controls verbs (specified in json configuration file) in the response of verb 'info'. Bug-AGL: SPEC-1313 Change-Id: I4e7ec5c3d23fd505da1eb233c1da63708024912d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Add setting values of a ALSA control using a +/-Jonathan Aillet3-4/+118
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 Aillet3-25/+86
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 Aillet4-66/+192
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-27Move hal controls actions at the end of hal initJonathan Aillet1-1/+1
Move hal controls actions at the end of hal initialization to avoid calling halmap controls before handling controller actions (onload, events). Change-Id: Id3896b9497985d7a82242d719551a507a0ca74c5 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-11-02Use new ctl functions to set/get ctl external dataJonathan Aillet4-9/+9
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-02Force each hal to have its own ctl section dataJonathan Aillet1-2/+6
Force each hal api to have its own controller section data, it is very usefull if different hals don't have the same onload/events/... actions. Change-Id: Iaf3c2059a774ef8ec4f7262064d1cfa8d8159d91 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-11-02Use ctl defines to call afb functionsJonathan Aillet10-69/+72
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-08Move hal sections callbacks after plugin callbackJonathan Aillet1-2/+2
Into the controller section array, move hal sections callbacks after plugin callback so it will be executed before everything else. Change-Id: Id80063caae3b089e6ccef79a7b54a82b16600375 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Move mixer attach into its controller sectionJonathan Aillet2-17/+16
As the mixer section is obtained during a call of a controller section callback (during api pre-initilization), 'attach' call to 'mixer' has been moved in the same callback (called a second time during api initialization). Change-Id: I17f54aab1b9616649bfcb183297ba8128621a7c2 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Remove unnecessary 'function' string in printsJonathan Aillet8-110/+86
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 Aillet2-2/+2
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-08Force hals init before ending hal-manager initJonathan Aillet2-1/+14
Force launched hals initialization before ending hal-manager initialization. This way, external api requiring 'hal-manager' will be sure that all launched hals are initialized. Change-Id: I00b9b14da623828d7cf7bc507873ad6de8ba2391 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Decrease level of a msg printed in event catcherJonathan Aillet1-5/+5
Decrease level of a message printed in event catcher to avoid polluting debug logs. Change-Id: Id222ddc958f9550da19507537944319888bac016 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add bluetooth hal pluginJonathan Aillet1-1/+1
Add first version of a hal plugin that will handle hal that wants bluetooth as an audio device. Change-Id: I4f5628ef9688c417b1b443fc3c4948cb23c17214 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Remove unnecessary 'struct' before json_objectJonathan Aillet1-2/+2
Remove unnecessary 'struct' before json_object. Change-Id: Id5106c87780ebbf1eff8bd3754d59e1184e37216 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-08Correct errors in hal-utilities-data prototypesJonathan Aillet2-10/+10
Functions can now returns a -int ... Change-Id: If2732bfc8fdc2566da520fcb104b9a595ac2caa6 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct error print when attaching to mixerJonathan Aillet1-1/+1
Correct print when attach to mixer results in an call sync error. Change-Id: Id0c06d2c449d2b3dd56822674f496e0f52c31c27 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update binding entry for app-fw v3.Jonathan Aillet1-1/+1
Update binding entry to became compatible with application framework v3 (used since AGL FF-RC1 release) Change-Id: Ib51e4a41629b73e849f56c6d0987955a373f1e59 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Simplify ping verb call print outputJonathan Aillet1-1/+1
Simplify ping verb call print output to avoid any issues in relation with app-framework binder version. Change-Id: I538498c98c458e67e8d98d455def12935c16f830 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update version of conf.d/app-templates submodule.Jonathan Aillet1-3/+3
Changes of conf.d/app-templates: (291aa4e - Romain Forlot) Change the default debug compilation options. (22a2cbf - Romain Forlot) Clearer coverage compilation options configuration (aa68dbd - Romain Forlot) Don't overwrite the autobuild script if it exists (a13e7b9 - Romain Forlot) Disable the in-tree build method. (51026d2 - Romain Forlot) Detect Yocto as OS distribution (1f2944e - Romain Forlot) Fix: wrong compile options added (92646f6 - Romain Forlot) Fallback using zip format if no wgtpkg-pack found (f65761c - José Bollo) 02-variables.cmake: Avoid checking CXX version if not required (3965d37 - José Bollo) config.cmake.sample: Remove dependency to libsystemd (a45ae0c - José Bollo) config.cmake.sample: Remove dependency to libmicrohttpd (9b17efe - Thierry Bultel) Added -D_FORTIFY_SOURCE=2 to CFLAGS (66f7bc8 - Thierry Bultel) start-on-target: uses RSYNC_PREFIX path for config (e400fb3 - Sebastien Douheret) Fixed spelling. Also, corrects warnings that appeared with this bump. Change-Id: Iec94bb4f49a6ce2b6cdb32154dc47ef7a31c614c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update version of app-controller submodule.Loïc Collignon1-6/+2
Changes of app-controller: (0f3063b - Romain Forlot) Be able to dispatch required api at the wanted time (1ff524b - Romain Forlot) Change LUA package path at LUA interpreter load (738ae54 - Romain Forlot) Don't load two times a plugin even for LUA (c04f029 - Sebastien Douheret) Fixed hidden bound variable (apiHandle) (cfe3919 - Sebastien Douheret) Fixed null value when push Lua arguments (69c0585 - José Bollo) Adjust to compile with incoming bindings v3 (d7e260c - José Bollo) Remove declaration to not existing functions (8ac6625 - Romain Forlot) Add 2 lua utilities function (d3504bb - Jonathan Aillet) Update README.md for new metadata keys. Change-Id: Iee42482b7a6834977497c27fe634cee9a5f96e0c Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>