summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-10-08Delay event parsing to be the lastJonathan Aillet1-13/+18
Delay event parsing to be the last. This is to avoid receiving events before everything is parsed. Do some minor layout changes. Change-Id: I0fd3f8d387c27471657c58ca8c4ea5828c002e23 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Optimize alsacore event handlerJonathan Aillet1-18/+14
Optimize alsacore event handler by avoiding generating a string to detect an alsacore event. Change-Id: I7498e99741b2b7095076016143ec8be6520ee122 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update Kingfisher json configuration filesJonathan Aillet1-1/+1
Update Kingfisher json configuration files to avoid confilcts with regular m3 json configuration file. Change-Id: I8b9425065dc273fc8e66a1f4c5822c93168b183c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Authorize empty response from mixerJonathan Aillet1-4/+4
Authorize empty response from mixer because a hal could configure no streams/captures/playbacks. Change-Id: I59b703aca72e8a70e10d41b28a95c3a022797a89 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Call onload section to before halmap sectionJonathan Aillet1-3/+3
Call onload section to before halmap section. This will be usefull if we want to execute action before the first alsa calls. Change-Id: Ia1b6428d322fb94538fee7b69b4886ab419a597c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct typo in README.mdJonathan Aillet1-5/+5
Correct some typo in README. Change-Id: If6a2cd3a710a775dc86f33c1a9241e21814264b0 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-084a-hal-cfg-reference: add HAL definition for M3 on KingfisherStephane Desneux1-0/+199
When M3 board is plugged on Kingfisher board, the internal M3 card is not reachable with the same device name, due to changes in the DTB. The added file hal-4a-rcar-m3kf.json is thus a copy of hal-4a-rcar-m3.json where '/dev/snd/by-path/platform-sound' has been replaced by '/dev/snd/by-path/platform-sound@1' (<- '@1' at the end) Change-Id: I44c07ee83b3d884fb52a28f6ed1418765a0a0816 Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2018-10-08Correct a failed request warning messageJonathan Aillet1-1/+1
Correct a failed request warning message. Change-Id: Iefdf1cb29af55dc1f4ea098ede032c33fb3b4138 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update README.mdJonathan Aillet1-14/+32
Add some indications about hal selection and known issues. Change-Id: Ib09eac904029a1faf15bb8239e9188f8b39c17c1 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08config.cmake: adjust paths (CONTROL_*_PATH)Stephane Desneux1-3/+3
At runtime, the controller should search paths inside ${CMAKE_INSTALL_PREFIX}/${PROJECt_NAME}, typically: /usr/libexec/agl/4a-hal/ Change-Id: I8165a1c389dcb7e24d0e336918f0698295de1c23 Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2018-10-08Add Hal (audio json configration files)Jonathan Aillet7-2/+986
Add some audio json configration files inspired from hal available in '4a-hal-reference' and '4a-hal-community'. Each one of these files are meant to be be a reproduction of old hal using the new 4a-hal implementation. List of hal added : - Rcar M3 - Intel Minnowboard - 2ch generic usb - Intel - Jabra solemate - Ensoniq Change-Id: I6bac5ed1e6d4ab72975427a9a2343851f874df79 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update USB json configuration filesJonathan Aillet4-11/+206
Update USB json configuration files and README. Change-Id: Ib217da9189fd928e0842bf8da85a362c1423080e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Change verb prefix separator accroding to mixerJonathan Aillet1-1/+1
Change verb prefix separator charactor accroding to mixer. Change-Id: Ifbeb715490371ffdf835599b47076d8c17447571 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct typo in READMEJonathan Aillet1-3/+5
Correct some typo in README. Change-Id: I4427a2c09866bab975334b1577ff83d6b8439947 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Auithorize sending empty json to verbsJonathan Aillet2-13/+11
Auithorize sending empty json to hal-manager 'loaded 'verb and to hal 'info' verb. Change-Id: Id664b0335ad80f88392dd24cd910016deaad25e3 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Move onload section parsing lastJonathan Aillet1-1/+1
To avoid onload action to be launch before the configuration sets in other sections, parse onload section last. Change-Id: Icdc77239a9784e559bd9df130d3dc63c7ba5801b Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Revert "Move controller config exec before onload action"Jonathan Aillet1-8/+4
This reverts commit 19080e452e5ae909f64e09a4edfe9c57fbac43a4. Change-Id: I82c8f0a867a20995443f0cd600d5118ee9e3128d Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Return the result of call to mixerJonathan Aillet1-7/+20
Return the response field of mixer reponse to the caller of stream/capture/playback verbs. Force the verbose key in sent object. Change-Id: I5b87da0042c86c6b7dc8853af66cddd2f6819532 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct some compilation warningsJonathan Aillet4-6/+6
Correct some compilation warnings that appeared in some gcc versions. Change-Id: I846c573f3128f7d5d5da8b7d2eb1b63dc61af1ab Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Correct a cast errorJonathan Aillet1-1/+1
Correct a cast error that was causing a segfault in some unknown condition. Change-Id: I96c89c04d4f6bd5177446c56b4c50cbab30b4830 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Print some errors in info verbsJonathan Aillet3-11/+18
Print errors info when an error happen during call to mixer 'info' verb. Change-Id: Ic3b0b6312743af3ba41a7868d1347ce6b0fcc8cd Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Test 'asprintf' returnJonathan Aillet1-1/+4
Test 'asprintf' return to avoid compilation warning when building with yocto. Change-Id: I322890a149aff86c30afc7a654540d82dc0a8957 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update README.md accordingly to recent changesJonathan Aillet1-22/+56
Update README.md accordingly to recent changes. Change-Id: I88920073b63911fa709bb2331a81b1a06a9d8049 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Updates json controller configuration filesJonathan Aillet1-5/+4
Change stream uid to simplify search. Remove the prefix as it won't be used (for now). Change-Id: Ieafc53f51458648860334ac3a4fb641446d8639f Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Use structure defined in controller to load verbsJonathan Aillet4-13/+10
Use structure defined in controller to load verbs into an api using 'HalUtlLoadVerbs' function. Change-Id: I57aabf9ce2c580fc98b7ea8438cd01083e032ac2 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Rename files handling call/response of mixerJonathan Aillet5-5/+8
Rename files handling call/response of mixer. Change-Id: I070f109e2f0249b74548ae7dc7b84793926cb261 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-10-08Update 4a-hal to work with new 4a-softmixerJonathan Aillet7-214/+483
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-08Remove test cfg files and add community cfg fileJonathan Aillet6-216/+62
Now, the configuration files should be into these 2 directories : - 4a-hal-cfg-community/ - 4a-hal-cfg-reference/ A configuration file has been added for 'CSL CM106 8ch USB' audio device in community directory. The test configuration files has been removed. The README.md has been updated accordingly to these modifications. Change-Id: I03d197a534b2a36bacea8e09d3098b5b92c8d3b7 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 README.mdJonathan Aillet1-15/+11
Update README.md. Change-Id: I1feb001864d65fb345c92d21cb835093e681646b 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-08Update version of app-controller submodule.Jonathan Aillet1-0/+0
Changes of app-controller: (690bdee - Jonathan Aillet) Fix a compilation issue due to modif of AFB_ReqSuccess (4063ff0 - Clément Bénier) README:md: update README accordingly to new json scheme. (e9f423a - Sebastien Douheret) Fixed crash due to call to json_object_put (ce3e14c - Sebastien Douheret) Fix segfault when printing long message from lua (6838dff - Sebastien Douheret) Fixed spelling of AFB_ReqSuccess Change-Id: I8b631b0cc7d5dcd2c6e3d2c3ab277b2925174e07 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-08Updates json controller configuration filesJonathan Aillet1-1/+1
Corrects mistakes in info fields. Change-Id: Ic03c51608ea4dfe506d549505e50ee505f38970a 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>