diff options
Diffstat (limited to 'conf.d')
-rw-r--r-- | conf.d/project/etc/smixer-test-config.json | 43 | ||||
-rw-r--r-- | conf.d/project/htdocs/index.html | 25 | ||||
-rw-r--r-- | conf.d/project/lua.d/smixer-test-usb_ch8.lua | 65 |
3 files changed, 66 insertions, 67 deletions
diff --git a/conf.d/project/etc/smixer-test-config.json b/conf.d/project/etc/smixer-test-config.json index 3916d76..42f9e65 100644 --- a/conf.d/project/etc/smixer-test-config.json +++ b/conf.d/project/etc/smixer-test-config.json @@ -11,20 +11,49 @@ "uid": "softmixer", "info": "Map alsa-loop subdevices to 4A HAL streams", "spath": "./package/lib/plugins:./package/var:./lib/plugins:./var", - "libs": ["alsa-softmixer.ctlso", "smixer-test-radio_8ch.lua"], + "libs": ["alsa-softmixer.ctlso", "smixer-test-usb_ch8.lua"], } ], - "onload": [ { - "uid": "create-soft-mixer", + "uid": "mixer-create-api", "info": "Create Audio Router", - "action": "plugin://softmixer#CreateMixer", - "args": {"uid":"Simple_Test_Mixer"} + "action": "plugin://softmixer#MixerCreate", + "args": { + "uid":"Alsa-Mixer", + "max_loop": 1, + "max_sink": 8, + "max_source": 8, + "max_zone": 8, + "max_stream": 8, + "max_ramp": 4, + } }, { - "uid": "attach-soft-mixer", - "info": "Attach Stream to Audio Router", + "uid": "mixer-attach-loop", + "info": "Create Audio Router", + "action": "plugin://softmixer#MixerAttach", + "args": { + "loops" : { + "uid":"Alsa-Loopback", + "path": "/dev/snd/by-path/platform-snd_aloop.0", + "devices" : {"playback":0, "capture":1}, + "subdevs" : [ + {"subdev": 0, "numid": 51, "uid": "loop-legacy"}, + {"subdev": 1, "numid": 57, "uid": "loop-multimedia"}, + {"subdev": 2, "numid": 63}, + {"subdev": 3, "numid": 69}, + {"subdev": 4, "numid": 75}, + {"subdev": 5, "numid": 81}, + {"subdev": 6, "numid": 87}, + {"subdev": 7, "numid": 93} + ] + } + } + }, + { + "uid": "lua-test-attach", + "info": "For testing purpose attach stream & zone directly from LUA script to simulate HAL", "action": "lua://softmixer#_mixer_simple_test_" } ] diff --git a/conf.d/project/htdocs/index.html b/conf.d/project/htdocs/index.html index c667dde..53c7054 100644 --- a/conf.d/project/htdocs/index.html +++ b/conf.d/project/htdocs/index.html @@ -13,26 +13,29 @@ <h1>Simple Mixer Test</h1> <button id="connected" onclick="init()">Binder WS Fail</button> - <button id="mnitoring" onclick="window.open('/monitoring/monitor.html', '_monitor_ctl')">Debug/Monitoring</a></button> + <button id="monitoring" onclick="window.open('/monitoring/monitor.html', '_monitor_ctl')">Debug/Monitoring</a></button> <br><br> <h2>V3 API CALL</h2> <ol> - <li><button onclick="callbinder('smixer', 'info', {streams: true});">Streams List</button></li> - <li><button onclick="callbinder('smixer', 'info', {ramps: true});">Ramps List</button></li> + <li><button onclick="callbinder('smixer', 'info', {streams: true, verbose:true});">Streams All List</button></li> + <li><button onclick="callbinder('smixer', 'info', {streams: 'multimedia'});">Streams Multimedia</button></li> + <li><button onclick="callbinder('smixer', 'info', {ramps: true, verbose:true});">Ramps List</button></li> <li><button onclick="callbinder('smixer', 'info', {zones: true});">Zones List</button></li> <br> - <li><button onclick="callbinder('smixer', '8CH-USB/playback', {volume: '+10'});">Master 8CH-USB vol=+10</button></li> - <li><button onclick="callbinder('smixer', '8CH-USB/playback', {volume: '-10'});">Master 8CH-USB vol=-10</button></li> + <li><button onclick="callbinder('smixer', '8CH-USB:playback', {volume: '+10', verbose:true});">Master default vol=+10</button></li> + <li><button onclick="callbinder('smixer', '8CH-USB:playback', {volume: '-10', verbose:true});">Master default vol=-10</button></li> <br> - <li><button onclick="callbinder('smixer', 'multimedia', {toggle: true});">Stream Multimedia pause/resume</button></li> - <li><button onclick="callbinder('smixer', 'navigation', {toggle: true});">Stream Navigation pause/resume</button></li> + <li><button onclick="callbinder('smixer', 'default:multimedia', {toggle: true, verbose:true});">Stream Multimedia pause/resume</button></li> + <li><button onclick="callbinder('smixer', 'default:navigation', {toggle: true, verbose:true});">Stream Navigation pause/resume</button></li> <br> - <li><button onclick="callbinder('smixer', 'multimedia', {volume: '+10'});">Stream Multimedia volume=+10"</button></li> - <li><button onclick="callbinder('smixer', 'multimedia', {volume: '-10'});">Stream Multimedia volume=-10"</button></li> + <li><button onclick="callbinder('smixer', 'default:multimedia', {volume: '+10', verbose:true});">Stream Multimedia volume=+10"</button></li> + <li><button onclick="callbinder('smixer', 'default:multimedia', {volume: '-10', verbose:true});">Stream Multimedia volume=-10"</button></li> <br> - <li><button onclick="callbinder('smixer', 'multimedia', {ramp: {uid:'ramp-slow', volume:30}});">Stream Multimedia ramp-slow=30"</button></li> - <li><button onclick="callbinder('smixer', 'multimedia', {ramp: {uid:'ramp-fast', volume:80}});">Stream Multimedia ramp-fast=80"</button></li> + <li><button onclick="callbinder('smixer', 'default:multimedia', {ramp: {uid:'ramp-slow', volume:30}, verbose:true});">Stream Multimedia ramp-slow=30"</button></li> + <li><button onclick="callbinder('smixer', 'default:multimedia', {ramp: {uid:'ramp-fast', volume:80}, verbose:true});">Stream Multimedia ramp-fast=80"</button></li> + <br> + <li><button onclick="callbinder('smixer', 'default:multimedia', {info: true});">Stream Multimedia get info"</button></li> </ol> <div id="main" style="visibility:hidden"> diff --git a/conf.d/project/lua.d/smixer-test-usb_ch8.lua b/conf.d/project/lua.d/smixer-test-usb_ch8.lua index 98df824..2b804b6 100644 --- a/conf.d/project/lua.d/smixer-test-usb_ch8.lua +++ b/conf.d/project/lua.d/smixer-test-usb_ch8.lua @@ -53,29 +53,11 @@ function _mixer_simple_test_ (source, args) {["uid"]="ramp-normal", ["delay"]= 100, ["up"]=06,["down"]=2}, } - -- ======================= Loop PCM =========================== - local snd_aloop = { - ["uid"] = "Alsa-Loop", - ["path"]= "/dev/snd/by-path/platform-snd_aloop.0", - ["devices"] = {["playback"]=0,["capture"]=1}, - ["subdevs"] = { - {["subdev"]= 0, ["numid"]= 51, ["uid"]= "loop-legacy"}, - {["subdev"]= 1, ["numid"]= 57, ["uid"]= "loop-multimedia"}, - {["subdev"]= 2, ["numid"]= 63}, - {["subdev"]= 3, ["numid"]= 69}, - {["subdev"]= 4, ["numid"]= 75}, - {["subdev"]= 5, ["numid"]= 81}, - {["subdev"]= 6, ["numid"]= 87}, - {["subdev"]= 7, ["numid"]= 93}, - }, - } - - -- ============================= Backend (Sound Cards) =================== local snd_usb_8ch= { ["uid"]= "8CH-USB", - ["cardid"]= "USB", + ["path"]= "/dev/snd/by-id/usb-0d8c_USB_Sound_Device-00", ["params"] = audio_params.default, ["sink"] = { ["controls"]= { @@ -143,21 +125,12 @@ function _mixer_simple_test_ (source, args) } } - local zone_driver= { - ["uid"] = "driver-seat", - ["source"] = { - {["target"]="mic-right",["channel"]=0}, - }, - ["sink"] = { - {["target"]="front-right",["channel"]=0}, - } - } -- =================== Audio Streams ============================ local stream_music= { ["uid"] = "stream-multimedia", + ["verb"] = "multimedia", ["zone"]= "full-stereo", - ["source"]= "loop-multimedia", ["volume"]= 80, ["mute"] = false, ["params"]= audio_params.standard, @@ -165,6 +138,7 @@ function _mixer_simple_test_ (source, args) local stream_navigation= { ["uid"] = "stream-navigation", + ["verb"] = "navigation", ["zone"]= "front-seats", ["volume"]= 80, ["mute"] = false, @@ -172,22 +146,16 @@ function _mixer_simple_test_ (source, args) local stream_emergency= { ["uid"] = "stream-emergency", - ["zone"] = "driver-seat", + ["verb"] = "emergency", + ["zone"] = "front-seats", ["volume"]= 80, ["mute"] = false, - --["params"]= audio_params.basic, } - - local stream_radio= { - ["uid"] = "stream-radio", - ["zone"] = "full-stereo", - ["source"]= "radio", - ["volume"]= 80, - ["mute"] = false, - } - + + -- Force Pulse to attach a well known Loop subdev to get a fix Alsa cardid local stream_pulse= { ["uid"] = "stream-pulseaudio", + ["verb"] = "legacy", ["zone"] = "back-seats", ["source"]= "loop-legacy", ["volume"]= 80, @@ -196,22 +164,21 @@ function _mixer_simple_test_ (source, args) --- ================ Create Mixer ========================= local MyTestHal= { - ["uid"] = "MyMixer", + ["uid"] = "HAL-LUA-8CH-USB", + ["prefix"] = "default", ["ramps"] = volume_ramps, ["playbacks"]= {snd_usb_8ch }, ["captures"] = {snd_usb_8ch }, - ["loops"] = {snd_aloop}, - ["zones"] = {zone_stereo, zone_front, zone_back, zone_middle, zone_driver}, - ["streams"] = {stream_pulse, stream_music, stream_navigation, stream_radio }, + ["zones"] = {zone_stereo, zone_front, zone_back, zone_middle}, + ["streams"] = {stream_pulse, stream_music, stream_navigation, stream_emergency }, } error,result= AFB:servsync(source, "smixer", "attach", MyTestHal) - if (error) then - AFB:error (source, "--InLua-- API MyMixer/attach fail error=%d", error) + AFB:error (source, "--InLua-- API smixer/attach fail error=%d %s", error, Dump_Table(result)) goto OnErrorExit else - AFB:notice (source, "--InLua-- MyMixer/attach done result=%s\n", Dump_Table(result)) + AFB:notice (source, "--InLua-- smixer/attach done result=%s\n", Dump_Table(result)) end -- ================== Happy End ============================= @@ -221,9 +188,9 @@ function _mixer_simple_test_ (source, args) -- ================= Unhappy End ============================ ::OnErrorExit:: local response=result["request"] - printf ("--InLua-- ------------STATUS= %s --------------", result["status"]) + printf ("--InLua-- ------------STATUS= %s --------------", response["status"]) printf ("--InLua-- ++ INFO= %s", Dump_Table(response["info"])) - printf ("--InLua-- ----------TEST %s-------------", result["status"]) + printf ("--InLua-- ----------TEST %s-------------", response["status"]) AFB:error (source, "--InLua-- Test Fail") return 1 -- unhappy end -- |