summaryrefslogtreecommitdiffstats
path: root/conf.d
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2018-05-08 22:12:35 +0200
committerFulup Ar Foll <fulup@iot.bzh>2018-05-08 22:12:35 +0200
commite904b7da51297b0417df31ab79568c3f1243fb64 (patch)
tree01a7850d68dcc3983cd0bdfab1ed49ed2e4e675c /conf.d
parent17edfc4c20cfd855d68e5b0ef044da2e7509f3f3 (diff)
Fist AlsaLoop model playing music (work in progress)
Diffstat (limited to 'conf.d')
-rw-r--r--conf.d/cmake/00-suse-osconfig.cmake1
-rw-r--r--conf.d/cmake/config.cmake2
-rw-r--r--conf.d/project/etc/4a-softmixer-config.json9
-rw-r--r--conf.d/project/htdocs/index.html18
-rw-r--r--conf.d/project/lua.d/softmixer-01.lua39
5 files changed, 40 insertions, 29 deletions
diff --git a/conf.d/cmake/00-suse-osconfig.cmake b/conf.d/cmake/00-suse-osconfig.cmake
index a1101ef..976aa1e 100644
--- a/conf.d/cmake/00-suse-osconfig.cmake
+++ b/conf.d/cmake/00-suse-osconfig.cmake
@@ -1,2 +1,3 @@
+message(STATUS "*** Notice: OpenSuSe LUA-5.3+DynApi")
list(APPEND PKG_REQUIRED_LIST lua>=5.3)
add_compile_options(-DUSE_API_DYN)
diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake
index a8bce3d..b807a5e 100644
--- a/conf.d/cmake/config.cmake
+++ b/conf.d/cmake/config.cmake
@@ -131,7 +131,7 @@ list(APPEND link_libraries afb-helpers)
set(CONTROL_SUPPORT_LUA 1)
add_definitions(-DCONTROL_PLUGIN_PATH="${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/lib/plugins:${CMAKE_BINARY_DIR}/package/lib/plugins")
add_definitions(-DCONTROL_CONFIG_PATH="${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/etc:${CMAKE_BINARY_DIR}/package/etc")
-add_definitions(-DCONTROL_LUA_PATH="${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/data:${CMAKE_SOURCE_DIR}/conf.d/project/lua.d")
+add_definitions(-DCONTROL_LUA_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/lua.d:${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/data")
add_definitions(-DCTL_PLUGIN_MAGIC=987456123)
add_definitions(-DUSE_API_DYN=1 -DAFB_BINDING_VERSION=dyn)
diff --git a/conf.d/project/etc/4a-softmixer-config.json b/conf.d/project/etc/4a-softmixer-config.json
index db13705..e66a2e6 100644
--- a/conf.d/project/etc/4a-softmixer-config.json
+++ b/conf.d/project/etc/4a-softmixer-config.json
@@ -4,13 +4,12 @@
"uid": "Soft Mixer",
"version": "1.0",
"api": "softmixer",
- "info": "Soft Mixer emulating hardware mixer",
- "require": ["alsacore"]
+ "info": "Soft Mixer emulating hardware mixer"
},
"plugins": [
{
"uid": "alsa-router",
- "ldpath": "package/lib/plugins",
+ "ldpath": "./plugins/alsa",
"lua2c": ["AlsaDmix", "AlsaRouter"],
"info": "Map alsa-loop subdevices to 4A HAL streams"
}
@@ -80,6 +79,10 @@
"controls": [
{
+ "uid": "mixer-config",
+ "lua": "_mixer_config_"
+ },
+ {
"uid": "stream",
"callback": {
"plugin": "alsa-router",
diff --git a/conf.d/project/htdocs/index.html b/conf.d/project/htdocs/index.html
index 9a7d66f..600f7e0 100644
--- a/conf.d/project/htdocs/index.html
+++ b/conf.d/project/htdocs/index.html
@@ -13,25 +13,9 @@
<button id="mnitoring" onclick="window.open('/monitoring/monitor.html','_monitor_ctl')">Debug/Monitoring</a></button>
<br><br>
- <h2>V2 API CALL</h2>
- <ol>
- <li><button onclick="callbinder('pol4a','request', {'uid':'navigation-role'});">Navigation Open</button></li>
- <li><button onclick="callbinder('pol4a','request', {'uid':'emergency-role'});">Emergency Open</button></li>
- <br>
- <li><button onclick="callbinder('pol4a', 'request', {'uid':'release-current'});">Release Current Role</button></li>
- </ol>
-
<h2>V3 API CALL</h2>
<ol>
- <li><button onclick="callbinder('pol4a','navigation-role');">Navigation Open</button></li>
- <li><button onclick="callbinder('pol4a','emergency-role');">Emergency Open</button></li>
- <br>
- <li><button onclick="callbinder('pol4a','release-current');">Release Current Role</button></li>
- </ol>
-
- <h2>Signal/Timeout</h2>
- <ol>
- <li><button onclick="callbinder('pol4a','signal-timeout', {'timeout':3, 'data':'state', 'event':'quit'});">Get Signal in 3s</button></li>
+ <li><button onclick="callbinder('softmixer','mixer-config');">Mixer Config</button></li>
</ol>
<div id="main" style="visibility:hidden">
diff --git a/conf.d/project/lua.d/softmixer-01.lua b/conf.d/project/lua.d/softmixer-01.lua
index d4ae580..8d7aae9 100644
--- a/conf.d/project/lua.d/softmixer-01.lua
+++ b/conf.d/project/lua.d/softmixer-01.lua
@@ -28,19 +28,42 @@ function _AlsaPingCB_ (source, result, context)
end
+
-- Display receive arguments and echo them to caller
-function _init_softmixer_ (source, args)
+function _mixer_config_ (source, args)
- -- create event to push change audio roles to potential listeners
- _EventHandle=AFB:evtmake(source, "control")
+ local devin = {
+ ["path"]= "/dev/snd/by-path/platform-snd_aloop.0",
+ ["dev"]= 1,
+ ["sub"]= 0,
+ ["numid"]= 51,
+ }
- -- get list of supported HAL devices
- AFB:service(source, "alsacore","ping", {}, "_AlsaPingCB_", {})
+ local devout = {
+ ["path"]= "/dev/snd/by-id/usb-YAMAHA_Corporation_YAMAHA_AP-U70_USB_Audio_00-00",
+ ["dev"]= 0,
+ ["sub"]= 0,
+ }
- -- test Lua2C plugin
- L2C:alsadmix(source, {})
+ local params = {
+ ["rate"]= 44100,
+ ["channels"]= 2,
+ }
- AFB:notice (source, "--InLua-- _init_softmixer_ done")
+ -- Call AlsaSoftRouter
+ L2C:alsarouter(source, {["devin"]= devin, ["devout"]= devout, ["params"]= params})
+
+ AFB:notice (source, "--InLua-- _mixer_config_ done")
return 0 -- happy end
end
+
+-- Display receive arguments and echo them to caller
+function _init_softmixer_ (source, args)
+
+ -- create event to push change audio roles to potential listeners
+ _EventHandle=AFB:evtmake(source, "control")
+
+ _mixer_config_ (source, args)
+
+end