summaryrefslogtreecommitdiffstats
path: root/alsa-binding/Alsa-RegEvt.c
AgeCommit message (Collapse)AuthorFilesLines
2019-10-17Use dedicated systemd function for inotify eventsicefish_8.99.2icefish_8.99.1icefish/8.99.2icefish/8.99.18.99.28.99.1Jonathan Aillet1-150/+39
Use inotify events dedicated systemd function 'sd_event_add_inotify' instead of standard 'sd_event_add_io' function. BUG-AGL: SPEC-2909 Change-Id: Ie33d7ff049c9baa70e063a4f0192fc4e77daffac Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-17Prevent stop listening for control event on errorJonathan Aillet1-3/+2
Prevent stop listening for ALSA control events when control info and value was not possible to get. This error happen when a custom ALSA control is removed. BUG-AGL: SPEC-2897 Change-Id: Ie206247537715468f704e3c746d6e8744be23cf4 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-02Add a definition to force status refreshJonathan Aillet1-0/+48
Add a 'FORCE_STATUS_REFRESH_MS' definition that can be use to force cards/PCM status refresh. Might be used in case of missed events using 'inotify'. BUG-AGL: SPEC-2849 Change-Id: I8de80a95b752e5e4a14ad433460598e371d3a39f Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-02Add function to deal with PCM availability eventJonathan Aillet1-52/+74
Add a dedicated function to refresh monitored PCM status and fire event if PCM availability has changed. BUG-AGL: SPEC-2849 Change-Id: I1358b4019d7da80a8055bfbcd0bbf3f55a2499e3 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-01Add events when PCM availability changesJonathan Aillet1-1/+346
Add PCM availability application framework events to be notified when ALSA PCM availability changes. Use subscribe verb and json '{ "event" : "pcm", "name" : "hw:3,2,1", "stream" : 0 }' to subscribe to playback PCM 'hw:3,2,1' availability events. Use subscribe verb and json '{ "event" : "pcm", "name" : "hw:1,2,3", "stream" : 1 }'' to subscribe to capture PCM 'hw:1,2,3' availability events. from removed card events. To handle PCM events, inode notification (using inotify) is used on '/dev/snd/pcm*' file (e.g. '/dev/snd/pcmC0D0p') to monitor PCM availability. BUG-AGL: SPEC-2835 Change-Id: I5bfaef73b896fa7213e1308035eeaff1464f62f6 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-01Add possibility to unsubscribe from eventsJonathan Aillet1-19/+55
Add possibility to unsubscribe from events using 'unsubscribe' verb with the same json payload used for subscribe. BUG-AGL: SPEC-2833 Change-Id: Ie01f36b2bf0a446cc80b09d79417a301ce9ecfff Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-01Rework subscription handlingJonathan Aillet1-239/+279
Rework subscription handling to : - use an "event" key to select which event type we want to subscribe to, this will allow an easier integration of new events. - merge 'soundcard-added' and 'soundcard-removed' cards events into one 'cards-monitoring' event. Will ease unsubscription. - remove concept of 'mode' in json sent by event, this will allow to avoid 'mode' conflicts when several bindings are subscribed to the same event. Also, normalize some syntax issues. SPEC-2832 Change-Id: Ief8b3065a3e18dc710ef5b951053f96459c65e0b Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-10-01Rework verb request json parsingJonathan Aillet1-34/+42
Rework verb request json parsing to allow having request without 'devid' key in json. BUG-AGL: SPEC-2832 Change-Id: Id937d98c29d30b9298be3a1972f1a2cf5d0b722c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-19Add events when ALSA card are added/removedJonathan Aillet1-2/+271
Add 'soundcard-added'/'soundcard-removed' application framework events to be notified when ALSA card are added/removed. Use subscribe verb and json '{ "devid" : "added" }' to subscribe to added card events. Use subscribe verb and json '{ "devid" : "removed" }' to subscribe to removed card events. Bug-AGL: SPEC-2749 Change-Id: Ia021d7f6984b2263a5011121a69f17bb4ee2bf9e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-19Rework ALSA card control events functionsJonathan Aillet1-66/+84
Rework ALSA card control events subscription and handling to: - Clean unnecessary part of codes. - Increase reliability of ALSA control events polling callback. Bug-AGL: SPEC-2749 Change-Id: I75dc90483254b1befdf83968c9032ec877c1d895 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-08-14Avoid epoll errors to be fired indefinitelyJonathan Aillet1-0/+6
When a audio card with control event generation is removed, avoid epoll errors to be fired indefinitely by event loop. Bug-AGL: SPEC-2749 Change-Id: I65dddc2f9714fa2303773b212bc3cad7cb164d73 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-07-20Use some app-fwk macros to support v2 and v3Jonathan Aillet1-8/+8
Use some application framework macros to support both v2 and v3 compilation. Change-Id: I3051bbeff8788ea2c71545e5d253619d4749ff41 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-07-20Correct warning that was raised at compilationJonathan Aillet1-1/+1
Correct warning that was raised at compilation concerning 3 subjects : - Too short strings for 'snprintf'. - Forget cast returns of 'json_object_array_length' function. - Checking return of 'asprintf' function. Change-Id: I0fc702750841a0f8da921c3c3b1453c5afee0fd8 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2017-11-05Fix Regression on Volume RampingFulup Ar Foll1-1/+1
2017-11-05Improve Sound Card By Driver Name DetectionFulup Ar Foll1-25/+36
2017-11-04Added PcmInfo APIFulup Ar Foll1-11/+177
Change HAL register to fallback to driver name when not direct match found
2017-11-02Fix double CloseFulup Ar Foll1-1/+0
2017-11-02Fix FD leaking on Alsa ControlFulup Ar Foll1-1/+4
2017-10-24Initial working version as independent repoFulup Ar Foll1-0/+395