summaryrefslogtreecommitdiffstats
path: root/4a-hal
AgeCommit message (Collapse)AuthorFilesLines
2018-10-08Update 4a-hal to work with new 4a-softmixerJonathan Aillet6-127/+315
Update 4a-hal to work with new 4a-softmixer version : - Update audio configuration files to match the configuration format expected by the mixer. - Parse mixer attach response to get information about 'streams', 'playbacks', and 'captures'. store them in new field of controller hal data structure. - Create verb for each returned stream, but only one playback/capture verb even if threre are multiple playbacks/captures returned by the mixer attch verb. - Return 'streams', 'playbacks', and 'captures' when info verb is called. - If info verb is called with a json request, the request is transfered to the mixer. Change-Id: I65593281c34aa91ad87afbf8bebff755cc5cc6d0 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct a syntax mistake in function declarationJonathan Aillet1-1/+1
Correct a syntax mistake in 'HalCtlsNormalizeJsonValues' function declaration. Change-Id: If8f32c9f55a7c8b1075a5b493d467e66d4b2c1f6 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change mixer data structures namesJonathan Aillet3-7/+7
Change mixer data structures names bacause we won't only stores streams data anymore. Change-Id: Id7e4482b6a69696d156c6a8bfc8f8d231dba9d2c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change name of 'list' verb to 'info'Jonathan Aillet3-3/+3
Change name of 'list' verb to 'info'. Change-Id: I9062344b67cc2c19bce9a34d4ac7abfc1baa9428 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Move controller config exec before onload actionJonathan Aillet1-4/+8
Before, the onload action specified in the audio configuration file (see controller documention) was exectued before the sections configuration execution call. So, the onload action was launched before the hal was ready. Now, onload action is launched last. Change-Id: I05d46622b938ae5a818bd404779a2263ed334397 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add search for a concurent hal at mixer attachJonathan Aillet1-3/+19
At hal mixer attach, add search for an already ready hal using the same alsa audio device id. If this concurent hal exists, return an error. Change-Id: Ia17738fe87c7bc82fa1867ecd031dd07ffa73714 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add a function to search for hal using its dev-idJonathan Aillet2-0/+20
Add a function that allows to search for an already ready hal using its device id. This function will be useful at mixer attach of hal to check if the alsa device id is not already attach by another hal. Change-Id: I2f46dca19a98310064ed1af772425bd9186e0a75 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Return an error when hal attach to mixer fails.Jonathan Aillet1-1/+3
Return an error when hal is not successfully attach to mixer. Change-Id: Ibfacf405153e87d8005feba17f963b2f49caad7a Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change paramters in functions handling hal dataJonathan Aillet4-28/+30
Change paramters in functions handling hal data structure. Now, the only thing you need to add/search for/remove something in hal data structure list is the address of the first element of the list instead of the address of the whole hal manager data structure. Change-Id: Iafa7428735c3aa418a6ef6564f9acde8f44e7dfe Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add device id when hal metadata are askedJonathan Aillet1-7/+18
Add device id to response when hal metadata are asked (with verb 'loaded'). Also handle this metadata when an external hal is registered (verb 'loaded'). Change-Id: I25fafce13c8a215ed5991cfee2a399d8d6631c47 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Use a local strucuture to store hal manager dataJonathan Aillet2-7/+18
Use a local strucuture to store hal manager global data. Also declare a function that allows to get the first hal data structure in the list managed by hal manager. Change-Id: I4b36030435bca506b5ba3a08dfbca039eb02e43e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Define ping function as a definitive functionJonathan Aillet2-6/+1
Define ping function as a definitive function. Change-Id: I6c4351d2c829b7e6d89c6e47a0421c872a90e4d4 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Remove Alsa max card as it won't be used.Jonathan Aillet1-4/+0
Remove Alsa max card as it won't be used, the detection of concurent hal will be done by searching in hal list. Change-Id: Ie1d2406d33cd4f794f18bce67bfc5859a6a52393 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add free of 'CtlHalAlsaMapT' data structureJonathan Aillet3-2/+28
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 Aillet3-11/+11
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-08Move mixer attach at hal startupJonathan Aillet5-94/+112
Move mixer attach at hal startup instead of making attachment possible only with a verb. Now, if the hal audio device is detected at startup, it will automatically be attached to the mixer. As it is useless now, the verb used to attach mixer has been deleted. Change-Id: I32c8b829ac37fb31ede4fe8830a6f2a699c0835c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add value normalization of alsa control valuesJonathan Aillet5-18/+237
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 Aillet2-11/+28
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 Aillet6-7/+722
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-08Correct a typo in responsesJonathan Aillet1-2/+2
Correct a typo in responses of the callback that transfer action to mixer. Change-Id: Ic9c33c00367963a6a3d3dbdf21b0e4cad27d0f7d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Remove an unnecessary variableJonathan Aillet1-3/+2
Remove an unnecessary variable because it was used to get the result of a function call and to test this result (in a 'if' statment). So, to remove it, function was put directly into the 'if' statment. Change-Id: Ie79caa35b0873c6ec7cfdb19a25a3506c0082e53 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Prevent sending data to mixer of hal is not readyJonathan Aillet2-3/+3
Prevent sending data to mixer of hal is not ready. Change-Id: Ie511a5e23760e87336745dbe15d8d2a5e9481518 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Set external hal status to ready at loading.Jonathan Aillet1-1/+2
Set external hal status to ready at loading, its a temporary measure to handle external hal for now. Change-Id: I248d2b1288af601681f5567f34037ecc8e06c6aa Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change the way to handle app fw errorJonathan Aillet1-12/+9
Change the way to handle app fw error by passing adresses of 'char *' instead of a 'char **'. Change-Id: I5e89efcf8db113103776f7dc3e40615dc874f400 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change the field name use to store card pathJonathan Aillet4-8/+8
Change the field name use to store card path into controller hal data structure. Change-Id: I4413a4e5550f3122055db4c6184907d8be407ceb Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Use a boolean to set if api is internalJonathan Aillet2-2/+3
Use a boolean to set if api is internal. Change-Id: Ife5b8e052cf416205aca73c270bfb4b131be3656 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change the way to get card id using its pathJonathan Aillet3-47/+49
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-08Correct a little mistake into verbs loaderJonathan Aillet1-1/+1
Correct a little mistake into verbs loader. Change-Id: Iaf871a8ff9f629331827da48a007f4c67814727c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change a comment about what to listJonathan Aillet1-1/+1
Change a comment about what to provide when list verb is called. Add 'playback' and 'capture' to response. Change-Id: I2b663d9a83b18f870dbd7b23be4ef8f41664e25f Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change some comments to add TBD thingsJonathan Aillet7-19/+22
- Change some comments from TODO to TDB. - Remove 'JAI' from warning messages. Change-Id: Ib2c39d4e0f0ca34929237ab8ca3d66c9c0d269d0 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Include afb-definitions when using application frameworkJonathan Aillet18-188/+183
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-08Correct a debug warning about a variableJonathan Aillet1-1/+1
Correct a debug warning about a uninitialized variable. Change-Id: I94b8a5ba42013dd0ede5706a1646a61d58e7ef73 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Fix a typo in a debug messageJonathan Aillet1-5/+5
Fix a typo in a debug message. Change-Id: Iee894287f43d74fd72e41faad42f0617c50c0cf8 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Handle hal status using card presence and mixer initJonathan Aillet7-37/+116
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>
2018-10-08Generate an error when mixer initialization failsJonathan Aillet1-6/+6
Generate an error when mixer initialization is correctly transfered to mixer api but an error was raised by it. Change-Id: I617686b0167f9fb536ec56e430d10560e7f7ca31 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Use error codes when handling mixer init responseJonathan Aillet2-6/+16
Use error codes when handling mixer initialization response. Change-Id: Ie62b022f1a653be18766a09f1803995a77ae8582 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Remove reference to alsa in 4a-hal-managerJonathan Aillet1-3/+0
Remove reference to alsa in 4a-hal-manager because 4a-hal-manager won't communicate with alsa/alsa-core. Change-Id: Ie6d70e1a962ecbf73b1ee5f31fee78d1e29ac23d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Replace controller macro use by app fw macro useJonathan Aillet2-8/+9
Replace controller macro use by application framework macro use. Change-Id: Icee0855a311857ab21a4a5031c4e06ac58b8f295 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add some missing castJonathan Aillet1-3/+3
Add some missing cast when getting controller hal data structure. Change-Id: I8fdfd7486345e89c4004c071b63890b751305ce2 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Handle app fw call errors in a dedicated functionJonathan Aillet6-71/+194
Two functions has been added in a new file in 4a-hal-utilities : - A function that handle application framework call errors by returning a specific error. - A function that handle application framework call errors from a request. Change-Id: I657773586111adc609cbbaead7db589a82e133b0 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Rename a filed of 'CtlHalStreamData' structureJonathan Aillet4-4/+4
Rename 'cardId' filed to 'streamCardId' in 'CtlHalStreamData' structure. Change-Id: I7615eece39aea6bf6b6aadd3361f58792e6531f6 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct date in .c and .h filesJonathan Aillet16-16/+16
Set file creation date to 2018 instead of 2016. Change-Id: I0349bbc1dde097f899d9b38dd28b3891f88020ad Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correction of list verb when there's no streamsJonathan Aillet1-1/+1
Don't raise an error when list verb is called on a controller hal and there's no streams registered yet. Change-Id: Ie4126673f134ced3e93e1111f988923e4bf13e64 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Fix typo in request reponses of a app fw verbJonathan Aillet1-2/+2
Fix typo in request answers info message send back to application framework after an api verb call. Change-Id: Icbd06fc13d9abff8325145c355b6c8c3c6434e1c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Fix a typo in '4a-hal-utilities-verbs-loader.c' fileJonathan Aillet1-1/+1
Fix a typo in '4a-hal-utilities-verbs-loader.c' file. Change-Id: I4e569227414bd8f6bdbe45333982aa9a932099cc Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Add a table to see which hal is using which alsa hwJonathan Aillet1-0/+4
Add a table to see which controller hal is using which alsa hw. This table is stored in the hal manager data structure. It will be used at initialization to check if the device is free before sending the mixer attach call. Change-Id: I94bcb3224f2bf1756d4b53786e324ac13e55c573 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Handle mixer responses correctlyJonathan Aillet3-14/+75
Use a function to handle mixer responses on stream action calls correctly. Before, there was no differencations between responses from api calls that didn't end well. Now, we print a different message if the api/verb is not found and if the request was transfered but an error occured during it. Change-Id: Ib4f9c3cf14b6612cd14762b74466ce484fdfb09d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Handle mixer response after its initJonathan Aillet6-57/+150
Handle mixer response to get created streams and them corresponding card ids after mixer initialization. Store these informations into the controller hal data strucure. Creation of a verb for each stream is now handle at response handling. Remove unnecessary function because we don't need to search for a stream by his name. Change-Id: Id9e598668b071ca18d152b57e71109314025f698 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Don't seal hal controller api at its initJonathan Aillet1-2/+0
To be able to declare new verbs for controller hal dynamic api, don't seal this api after its initialization. Change-Id: I0fd028034ef2f409eceae05b642c74163b26e332 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Store uid of the hal mixer configuration and use itJonathan Aillet3-11/+18
Stores uid of the hal mixer configuration in the specific controller hal structure. Use this uid as prefix when calling softmixer api. Change-Id: Iab00518e02e0f9ff6dbd78c126eda45225c55256 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>