summaryrefslogtreecommitdiffstats
path: root/conf.d/project
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/project
parent17edfc4c20cfd855d68e5b0ef044da2e7509f3f3 (diff)
Fist AlsaLoop model playing music (work in progress)
Diffstat (limited to 'conf.d/project')
-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
3 files changed, 38 insertions, 28 deletions
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