From fe8135a9a769f9df7e7e0d0eeacdd8497661a8c4 Mon Sep 17 00:00:00 2001 From: fulup Date: Sun, 10 Jun 2018 00:49:02 +0200 Subject: Cleanup and added return of previous volume when setting new value --- app-afb-helpers-submodule | 2 +- app-controller-submodule | 2 +- conf.d/project/etc/smixer-test-config.json | 43 +++- conf.d/project/htdocs/index.html | 25 ++- conf.d/project/lua.d/smixer-test-usb_ch8.lua | 65 ++---- mixer-binding/mixer-binding.c | 2 +- nbproject/configurations.xml | 317 ++++++--------------------- plugins/alsa/alsa-api-loop.c | 12 +- plugins/alsa/alsa-api-mixer.c | 262 ++++++++++++++++------ plugins/alsa/alsa-api-pcm.c | 91 +++++--- plugins/alsa/alsa-api-ramp.c | 6 +- plugins/alsa/alsa-api-sink.c | 6 +- plugins/alsa/alsa-api-source.c | 6 +- plugins/alsa/alsa-api-streams.c | 102 ++++++--- plugins/alsa/alsa-api-zones.c | 6 +- plugins/alsa/alsa-core-pcm.c | 4 +- plugins/alsa/alsa-plug-rate.c | 2 +- plugins/alsa/alsa-plug-route.c | 2 +- plugins/alsa/alsa-plug-vol.c | 2 +- plugins/alsa/alsa-softmixer.h | 9 +- plugins/alsa/alsa-utils-bypath.c | 1 + 21 files changed, 500 insertions(+), 467 deletions(-) diff --git a/app-afb-helpers-submodule b/app-afb-helpers-submodule index 9685413..c7cd527 160000 --- a/app-afb-helpers-submodule +++ b/app-afb-helpers-submodule @@ -1 +1 @@ -Subproject commit 9685413c5e155e22f72d0b5d36edad889a5f5247 +Subproject commit c7cd527a8350f736b8013f65db6f5a52b8cb05dd diff --git a/app-controller-submodule b/app-controller-submodule index bcd9efc..690bdee 160000 --- a/app-controller-submodule +++ b/app-controller-submodule @@ -1 +1 @@ -Subproject commit bcd9efc10d60e5f83218378fdd0a3ee847fb9c75 +Subproject commit 690bdeee06f414fa149f5a9b62de7b215c3a80cd 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 @@

Simple Mixer Test

- +

V3 API CALL

    -
  1. -
  2. +
  3. +
  4. +

  5. -
  6. -
  7. +
  8. +

  9. -
  10. -
  11. +
  12. +

  13. -
  14. -
  15. +
  16. +

  17. -
  18. -
  19. +
  20. +
  21. +
    +