aboutsummaryrefslogtreecommitdiffstats
path: root/conf.d/project/lua.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/project/lua.d
parent17edfc4c20cfd855d68e5b0ef044da2e7509f3f3 (diff)
Fist AlsaLoop model playing music (work in progress)
Diffstat (limited to 'conf.d/project/lua.d')
-rw-r--r--conf.d/project/lua.d/softmixer-01.lua39
1 files changed, 31 insertions, 8 deletions
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