From e904b7da51297b0417df31ab79568c3f1243fb64 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Tue, 8 May 2018 22:12:35 +0200 Subject: Fist AlsaLoop model playing music (work in progress) --- conf.d/project/lua.d/softmixer-01.lua | 39 ++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'conf.d/project/lua.d') 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 -- cgit 1.2.3-korg