summaryrefslogtreecommitdiffstats
path: root/Alsa
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-03-07 22:35:52 +0100
committerFulup Ar Foll <fulup@iot.bzh>2017-03-07 22:35:52 +0100
commit49533399810630031541b25407cd88498a72f6c3 (patch)
tree1ab7d0e6063c609e97ca15d400e21c5618e63b45 /Alsa
parent3392199837251e8b165dda1eb0ec211d9c06dd0b (diff)
Lock on WS afb-daemon Segmentation fault
Diffstat (limited to 'Alsa')
-rw-r--r--Alsa/CMakeLists.txt5
-rw-r--r--Alsa/core-binding/AlsaLibMapping.c3
-rw-r--r--Alsa/core-binding/README.md2
3 files changed, 8 insertions, 2 deletions
diff --git a/Alsa/CMakeLists.txt b/Alsa/CMakeLists.txt
index 22061eb..e8173f9 100644
--- a/Alsa/CMakeLists.txt
+++ b/Alsa/CMakeLists.txt
@@ -22,5 +22,10 @@ PKG_CHECK_MODULES(alsa REQUIRED alsa)
# Max Sound Card Number eligible to ctlevent subscription
defstr(MAX_SND_CARD 16)
+SET(link_libraries
+ ${alsa_LIBRARIES}
+ ${link_libraries}
+ )
+
ADD_SUBDIRECTORY(core-binding)
diff --git a/Alsa/core-binding/AlsaLibMapping.c b/Alsa/core-binding/AlsaLibMapping.c
index e4f27c9..8d85f11 100644
--- a/Alsa/core-binding/AlsaLibMapping.c
+++ b/Alsa/core-binding/AlsaLibMapping.c
@@ -710,10 +710,11 @@ PUBLIC void alsaSubCtl (struct afb_req request) {
// subscribe to binder event
err = afb_req_subscribe(request, evtHandle->afbevt);
if (err != 0) {
- afb_req_fail_f (request, "register-eventname", "Cannot subscribe binder event name=%s err=%d", devid, err);
+ afb_req_fail_f (request, "register-eventname", "Cannot subscribe binder event name=%s need WS", devid, err);
goto ExitOnError;
}
+ // increase usage count and return success
sndHandles[idx].ucount ++;
afb_req_success(request, NULL, NULL);
return;
diff --git a/Alsa/core-binding/README.md b/Alsa/core-binding/README.md
index 12c8d5e..7f8c87a 100644
--- a/Alsa/core-binding/README.md
+++ b/Alsa/core-binding/README.md
@@ -18,5 +18,5 @@ Testing: (from Build dir with Binder install in $HOME/opt=
# Get detail on a given control (optional quiet=0=verbose,1,2)
http://localhost:1234/api/alsacore/getctl?devid=hw:0&numid=1&quiet=0
- # Subscribe to event from a given sound card
+ # Subscribe to event from a given sound card (warning fail if not WS)
http://localhost:1234/api/alsacore/subctl?devid=hw:0 \ No newline at end of file