summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfulup <fulup.arfoll@iot.bzh>2018-06-10 22:44:07 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-11 01:22:18 +0200
commit9c88fd2aaf454b4ab5d4cfcb5e510196da3b74b4 (patch)
tree0c1fbe9fe6902712d55e309912c3dcc02107170a
parent2838587fc0d118d504e6ef8e04b98f262f29a712 (diff)
Autorize direct zone to point on sndcard
-rw-r--r--README.md1
-rw-r--r--conf.d/project/etc/fiberdyme_hal_sample.json287
-rw-r--r--conf.d/project/etc/smixer-test-config.json4
-rw-r--r--conf.d/project/lua.d/smixer-test-usb_2ch.lua157
-rw-r--r--conf.d/project/lua.d/smixer-test-usb_8ch.lua (renamed from conf.d/project/lua.d/smixer-test-usb_ch8.lua)21
-rw-r--r--nbproject/configurations.xml278
-rw-r--r--plugins/alsa/alsa-api-sink.c29
-rw-r--r--plugins/alsa/alsa-api-streams.c38
-rw-r--r--plugins/alsa/alsa-plug-vol.c15
-rw-r--r--plugins/alsa/alsa-softmixer.h3
10 files changed, 152 insertions, 681 deletions
diff --git a/README.md b/README.md
index a33adca..504f911 100644
--- a/README.md
+++ b/README.md
@@ -57,6 +57,7 @@ Alsa snd-aloop impose '0' as playback device. Soft mixer will start from last su
Current version does not handle audio rate conversion, using gstreamer or equivalent to match with audio hardware params is mandatory.
```
+ export PROJECT_ROOT=`pwd`
gst123 --audio-output alsa=hw:Loopback,0,0 $PROJECT_ROOT/conf.d/project/sounds/trio-divi-alkazabach.mp3
gst123 --audio-output alsa=hw:XXX,0,??? other sound file
diff --git a/conf.d/project/etc/fiberdyme_hal_sample.json b/conf.d/project/etc/fiberdyme_hal_sample.json
deleted file mode 100644
index 2614163..0000000
--- a/conf.d/project/etc/fiberdyme_hal_sample.json
+++ /dev/null
@@ -1,287 +0,0 @@
-{
- "$schema": "ToBeDone",
- "metadata": {
- "api": "fd-dsp",
- "uid": "fiberdyne_dsp",
- "info": "Fiberdyne DSP HAL for Xtensa HiFi2",
- "version": "1.0",
- "require": "alsacore"
- },
- "plugins": [
- {
- "uid": "fd-dsp-hifi2",
- "info": "Fiberdyne DSP client library for HiFi2",
- "basename": "fd-dsp-hifi2",
- "ldpath": "./fd-dsp-hifi2"
- }
- ],
- "comment": "These are per-stream, could look at alsa byte stream?",
- "control": [
- {
- "uid": "Volume",
- "alsa": {
- "name": "PCM Playback Volume",
- "value": 50
- }
- },
- {
- "uid": "Mute",
- "alsa": {
- "name": "PCM Playback Switch",
- "value": false
- }
- },
- {
- "uid": "Bass",
- "alsa": {
- "name": "PCM Playback Bass",
- "value": 50
- }
- },
- {
- "uid": "Mid",
- "alsa": {
- "name": "PCM Playback Mid",
- "value": 50
- }
- },
- {
- "uid": "Treble",
- "alsa": {
- "name": "PCM Playback Treble",
- "value": 50
- }
- },
- {
- "uid": "Balance",
- "alsa": {
- "name": "PCM Playback Balance",
- "value": 50
- }
- },
- {
- "uid": "Fade",
- "alsa": {
- "name": "PCM Playback Fade",
- "value": 50
- }
- }
- ],
- "eqpoint": {
- "action": [
- {
- "uid": "eq-add-point",
- "function": "plugin://fd-dsp-hifi2/eq_add_point"
- },
- {
- "uid": "eq-remove-point",
- "function": "plugin://fd-dsp-hifi2/eq_remove_point"
- }
- ]
- },
- "filter": {
- "plugin": "fd-dsp-hifi2",
- "action": [
- {
- "uid": "filter-hip",
- "function": "plugin://fd-dsp-hifi2/filter_hip"
- }
- ]
- },
- "cards": {
- "uid": "A",
- "alsa": "xf-dsp-alsa:0,1",
- "desc": "Xtensa R-Car HiFi2 DSP",
- "action": {
- "uid": "init-snd-card",
- "function": "plugin://fd-dsp-hifi2/init-stereo"
- },
- "channels": {
- "sink": [
- {
- "type": "FrontLeftFullRange",
- "port": 0
- },
- {
- "type": "FrontRightFullRange",
- "port": 1
- },
- {
- "type": "RearLeftFullRange",
- "port": 2
- },
- {
- "type": "FrontRightFullRange",
- "port": 3
- },
- {
- "type": "Center",
- "port": 4
- },
- {
- "type": "LFE",
- "port": 5
- }
- ],
- "source": [
- {
- "uid": "FrontRightMic",
- "type": "Directional",
- "port": 0
- }
- ]
- }
- },
- "info": "This is totally an abstraction",
- "zone": [
- {
- "uid": "FrontSeat",
- "type": "sink",
- "mapping": [
- [
- "FrontRightMain",
- "FrontRightHigh"
- ],
- [
- "FrontLeftMain",
- "FrontLeftHigh"
- ]
- ]
- },
- {
- "uid": "RearSeat",
- "type": "sink",
- "mapping": [
- [
- "RearRightMain",
- "RearRightHigh"
- ],
- [
- "RearLeftMain",
- "RearLeftHigh"
- ]
- ]
- },
- {
- "uid": "DriverMic",
- "type": "source",
- "mapping": [
- [
- "FrontRightMic"
- ]
- ]
- },
- {
- "uid": "FullMicSetup",
- "type":"source",
- "mapping":
- [
- [ "FrontLeftMic"],
- [ "FrontRightMic"],
- [ "RearLeftMic"],
- [ "RearLeftMic"]
- ]
- }
- {
- "uid": "FiveOne",
- "type": "sink",
- "mapping": [
- [
- "FrontRightMain",
- "FrontRightHigh"
- ],
- [
- "FrontLeftMain",
- "FrontLeftHigh"
- ],
- [
- "RearRightMain",
- "RearRightHigh"
- ],
- [
- "RearLeftMain",
- "RearLeftHigh"
- ],
- [
- "Center"
- ],
- [
- "LFE"
- ]
- ]
- },
- {
- "uid": "StereoFour",
- "type": "sink",
- "mapping": [
- [
- "FrontRightMain",
- "FrontRightHigh",
- "RearRightMain",
- "RearRightHigh"
- ],
- [
- "FrontLeftMain",
- "FrontLeftHigh",
- "RearLeftMain",
- "RearLeftHigh"
- ]
- ]
- }
- ],
- "streams": [
- {
- "name": "speech-engine",
- "profile": "profile-speech",
- "source": {
- "zone":"DriverMic",
- "defaultconfig":{
- "mute": true
- }
- },
- "sink": {
- "zone": "FrontSeat",
- "defaultconfig": {
- "volume": 50,
- "mute": false,
- "bass": 50,
- "mid": 50,
- "treble": 50,
- "balance": 50,
- "fade": 50
- }
- }
- },
- {
- "name": "phone",
- "profile": "test",
- "source": {
- "channels": 1,
- "zone": "DriverMic",
- "defaultconfig":{
- "volume":"25"
- }
- },
- "sink": {
- "channels": 2,
- "zone": "FrontSeat"
- }
- },
- {
- "name": "stereo",
- "profile": "profile-dynamic",
- "sink": {
- "channels": 2,
- "zone": "StereoFour"
- }
- },
- {
- "name": "5_1",
- "profile": "profile-dynamic",
- "sink": {
- "channels": 6,
- "zone": "FiveOne"
- }
- }
- ]
-} \ No newline at end of file
diff --git a/conf.d/project/etc/smixer-test-config.json b/conf.d/project/etc/smixer-test-config.json
index 42f9e65..8643175 100644
--- a/conf.d/project/etc/smixer-test-config.json
+++ b/conf.d/project/etc/smixer-test-config.json
@@ -11,7 +11,7 @@
"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-usb_ch8.lua"],
+ "libs": ["alsa-softmixer.ctlso", "smixer-test-usb_8ch.lua"]
}
],
"onload": [
@@ -26,7 +26,7 @@
"max_source": 8,
"max_zone": 8,
"max_stream": 8,
- "max_ramp": 4,
+ "max_ramp": 4
}
},
{
diff --git a/conf.d/project/lua.d/smixer-test-usb_2ch.lua b/conf.d/project/lua.d/smixer-test-usb_2ch.lua
index 99893c1..fbe466c 100644
--- a/conf.d/project/lua.d/smixer-test-usb_2ch.lua
+++ b/conf.d/project/lua.d/smixer-test-usb_2ch.lua
@@ -44,7 +44,7 @@ function _mixer_simple_test_ (source, args)
local audio_params ={
defaults = { ["rate"] = 48000 },
standard = { ["rate"] = 44100 },
- basic= { ["rate"] = 8000 },
+ basic = { ["rate"] = 8000 },
}
local volume_ramps = {
@@ -53,66 +53,19 @@ 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_yamaha = {
- ["uid"]= "YAMAHA-APU70",
- ["path"]= "/dev/snd/by-id/usb-YAMAHA_Corporation_YAMAHA_AP-U70_USB_Audio_00-00",
- ["params"]= audio_params.default,
- ["sink"] = {
- ["channels"] = {
- {["uid"]= "front-right", ["port"]= 0},
- {["uid"]= "front-left", ["port"]= 1},
- },
- }
- }
-
- local snd_usb_8ch= {
- ["uid"]= "8CH-USB",
- ["path"]= "/dev/snd/by-id/usb-0d8c_USB_Sound_Device-00",
- ["params"] = audio_params.default,
+ local snd_usb_2ch= {
+ ["uid"]= "STEREO-USB",
+ ["path"]= "/dev/snd/by-id/usb-0b0e_Jabra_SOLEMATE_v1.34.0-00",
["sink"] = {
["controls"]= {
- ["volume"] = {["name"]= "Speaker Playback Volume", ["value"]=80},
- ["mute"] = {["name"]= "Speaker Playback Switch"},
+ ["volume"] = {["name"]= "Playback Volume", ["value"]=80},
+ ["mute"] = {["name"]= "Playback Switch"},
},
["channels"] = {
{["uid"]= "front-right", ["port"]= 0},
{["uid"]= "front-left" , ["port"]= 1},
- {["uid"]= "middle-right", ["port"]= 2},
- {["uid"]= "middle-left" , ["port"]= 3},
- {["uid"]= "back-right", ["port"]= 4},
- {["uid"]= "back-left" , ["port"]= 5},
- {["uid"]= "centre-left" , ["port"]= 6},
- {["uid"]= "centre-left" , ["port"]= 7},
- },
- },
- ["source"] = {
- ["controls"]= {
- ["volume"] = {["name"]= "Capture Volume"},
- ["mute"] = {["name"]= "Capture Switch"},
- },
- ["channels"] = {
- {["uid"]= "mic-right", ["port"]= 0},
- {["uid"]= "mic-left" , ["port"]= 1},
},
}
}
@@ -124,83 +77,39 @@ function _mixer_simple_test_ (source, args)
["sink"] = {
{["target"]="front-right",["channel"]=0},
{["target"]="front-left" ,["channel"]=1},
- {["target"]="middle-right",["channel"]=0},
- {["target"]="middle-left" ,["channel"]=1},
- {["target"]="back-right",["channel"]=0},
- {["target"]="back-left" ,["channel"]=1},
- }
- }
-
- local zone_front= {
- ["uid"] = "front-seats",
- ["sink"] = {
- {["target"]="front-right",["channel"]=0},
- {["target"]="front-left" ,["channel"]=1},
}
}
- local zone_middle= {
- ["uid"] = "middle-seats",
- ["sink"] = {
- {["target"]="middle-right",["channel"]=0},
- {["target"]="middle-left" ,["channel"]=1},
- }
- }
-
- local zone_back= {
- ["uid"] = "back-seats",
- ["sink"] = {
- {["target"]="back-right",["channel"]=0},
- {["target"]="back-left" ,["channel"]=1},
- }
- }
-
- local zone_driver= {
- ["uid"] = "driver-seat",
- ["source"] = {
- {["target"]="mic-right",["channel"]=0},
- },
- ["sink"] = {
- {["target"]="front-right",["channel"]=0},
- }
- }
-
- -- =================== Audio Stream ============================
+ -- =================== Audio Streams ============================
local stream_music= {
- ["uid"] = "multimedia",
- ["zone"]= "full-stereo",
- ["source"]= "loop-multimedia",
+ ["uid"] = "stream-multimedia",
+ ["verb"] = "multimedia",
+ ["zone"]= "JABRA-USB",
["volume"]= 80,
["mute"] = false,
- ["params"]= audio_params.standard,
}
local stream_navigation= {
- ["uid"] = "navigation",
- ["zone"]= "front-seats",
+ ["uid"] = "stream-navigation",
+ ["verb"] = "navigation",
+ ["zone"]= "JABRA-USB",
["volume"]= 80,
["mute"] = false,
}
local stream_emergency= {
- ["uid"] = "emergency",
- ["zone"] = "driver-seat",
- ["volume"]= 80,
- ["mute"] = false,
- --["params"]= audio_params.basic,
- }
-
- local stream_radio= {
- ["uid"] = "radio",
- ["zone"] = "full-stereo",
- --["source"]= snd_usb_8ch.uid,
+ ["uid"] = "stream-emergency",
+ ["verb"] = "emergency",
+ ["zone"] = "JABRA-USB",
["volume"]= 80,
["mute"] = false,
}
-
+
+ -- Force Pulse to attach a well known Loop subdev to get a fix Alsa cardid
local stream_pulse= {
- ["uid"] = "pulseaudio",
- ["zone"] = "back-seats",
+ ["uid"] = "stream-pulseaudio",
+ ["verb"] = "legacy",
+ ["zone"] = "JABRA-USB",
["source"]= "loop-legacy",
["volume"]= 80,
["mute"] = false,
@@ -208,25 +117,19 @@ function _mixer_simple_test_ (source, args)
--- ================ Create Mixer =========================
local MyTestHal= {
- ["uid"]= "MyMixer",
- ["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 },
- -- ["streams"] = {stream_pulse, stream_music, stream_navigation, stream_emergency, stream_radio },
-
+ ["uid"] = "HAL-LUA-2CH-USB",
+ ["prefix"] = "default",
+ ["ramps"] = volume_ramps,
+ ["playbacks"]= {snd_usb_2ch },
+ ["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 =============================
@@ -236,9 +139,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 --
diff --git a/conf.d/project/lua.d/smixer-test-usb_ch8.lua b/conf.d/project/lua.d/smixer-test-usb_8ch.lua
index 2b804b6..68b50fa 100644
--- a/conf.d/project/lua.d/smixer-test-usb_ch8.lua
+++ b/conf.d/project/lua.d/smixer-test-usb_8ch.lua
@@ -42,9 +42,9 @@ function _mixer_simple_test_ (source, args)
-- ==================== Default rate ===========================
local audio_params ={
- defaults = { ["rate"] = 48000 },
- standard = { ["rate"] = 44100 },
- basic = { ["rate"] = 8000 },
+ R48000 = { ["rate"] = 48000 },
+ R44100 = { ["rate"] = 44100 },
+ R8000 = { ["rate"] = 8000 },
}
local volume_ramps = {
@@ -58,7 +58,7 @@ function _mixer_simple_test_ (source, args)
local snd_usb_8ch= {
["uid"]= "8CH-USB",
["path"]= "/dev/snd/by-id/usb-0d8c_USB_Sound_Device-00",
- ["params"] = audio_params.default,
+ ["params"] = audio_params.R48000,
["sink"] = {
["controls"]= {
["volume"] = {["name"]= "Speaker Playback Volume", ["value"]=80},
@@ -128,20 +128,21 @@ function _mixer_simple_test_ (source, args)
-- =================== Audio Streams ============================
local stream_music= {
- ["uid"] = "stream-multimedia",
+ ["uid"] = "stream-multimedia",
["verb"] = "multimedia",
- ["zone"]= "full-stereo",
+ ["zone"] = "full-stereo",
["volume"]= 80,
["mute"] = false,
- ["params"]= audio_params.standard,
+ ["params"] = audio_params.R48000,
}
local stream_navigation= {
- ["uid"] = "stream-navigation",
+ ["uid"] = "stream-navigation",
["verb"] = "navigation",
- ["zone"]= "front-seats",
+ ["zone"] = "front-seats",
["volume"]= 80,
["mute"] = false,
+ ["params"] = audio_params.R48000,
}
local stream_emergency= {
@@ -150,6 +151,7 @@ function _mixer_simple_test_ (source, args)
["zone"] = "front-seats",
["volume"]= 80,
["mute"] = false,
+ ["params"] = audio_params.R48000,
}
-- Force Pulse to attach a well known Loop subdev to get a fix Alsa cardid
@@ -160,6 +162,7 @@ function _mixer_simple_test_ (source, args)
["source"]= "loop-legacy",
["volume"]= 80,
["mute"] = false,
+ ["params"] = audio_params.R48000,
}
--- ================ Create Mixer =========================
diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml
index 7b619f2..115cebe 100644
--- a/nbproject/configurations.xml
+++ b/nbproject/configurations.xml
@@ -173,7 +173,12 @@
<cTool flags="1">
<incDir>
<pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/lib64/gcc/x86_64-suse-linux/7/include</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
</incDir>
</cTool>
</item>
@@ -184,7 +189,12 @@
<cTool flags="1">
<incDir>
<pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/lib64/gcc/x86_64-suse-linux/7/include</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
</incDir>
</cTool>
</item>
@@ -193,11 +203,23 @@
tool="0"
flavor2="3">
<cTool flags="0">
+ <incDir>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/uuid</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
<preprocessorList>
<Elem>AFB_BINDING_VERSION=dyn</Elem>
<Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/Audio-4a/4a-softmixer/conf.d/project/etc:/home/fulup/Workspace/Audio-4a/4a-softmixer/build/package/etc:/home/fulup/opt/smixer/etc"</Elem>
<Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/Audio-4a/4a-softmixer/conf.d/project/lua.d:/home/fulup/opt/smixer/var"</Elem>
<Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/Audio-4a/4a-softmixer/build/package/lib/plugins:/home/fulup/opt/smixer/lib/plugins"</Elem>
+ <Elem>CONTROL_SUPPORT_LUA</Elem>
<Elem>CTL_PLUGIN_MAGIC=987456123</Elem>
<Elem>USE_API_DYN=1</Elem>
</preprocessorList>
@@ -210,7 +232,12 @@
<cTool flags="1">
<incDir>
<pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/lib64/gcc/x86_64-suse-linux/7/include</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
</incDir>
</cTool>
</item>
@@ -219,6 +246,10 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<item path="app-controller-submodule/ctl-lib/ctl-lua.c"
@@ -228,7 +259,12 @@
<cTool flags="1">
<incDir>
<pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/lib64/gcc/x86_64-suse-linux/7/include</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
</incDir>
</cTool>
</item>
@@ -239,7 +275,12 @@
<cTool flags="1">
<incDir>
<pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/lib64/gcc/x86_64-suse-linux/7/include</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
</incDir>
</cTool>
</item>
@@ -250,7 +291,12 @@
<cTool flags="1">
<incDir>
<pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/lib64/gcc/x86_64-suse-linux/7/include</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
</incDir>
</cTool>
</item>
@@ -261,7 +307,12 @@
<cTool flags="1">
<incDir>
<pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/lib64/gcc/x86_64-suse-linux/7/include</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
</incDir>
</cTool>
</item>
@@ -331,18 +382,6 @@
<item path="plugins/alsa/alsa-api-loop.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -353,16 +392,7 @@
<item path="plugins/alsa/alsa-api-mixer.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>/usr/include/json-c</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
</incDir>
<preprocessorList>
<Elem>alsa_softmixer_EXPORTS</Elem>
@@ -372,18 +402,6 @@
<item path="plugins/alsa/alsa-api-pcm.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -394,18 +412,6 @@
<item path="plugins/alsa/alsa-api-ramp.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -416,18 +422,6 @@
<item path="plugins/alsa/alsa-api-sink.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -438,18 +432,6 @@
<item path="plugins/alsa/alsa-api-source.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -460,18 +442,6 @@
<item path="plugins/alsa/alsa-api-streams.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -482,18 +452,6 @@
<item path="plugins/alsa/alsa-api-zones.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -503,20 +461,6 @@
</item>
<item path="plugins/alsa/alsa-capture.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
- <incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
- </incDir>
<preprocessorList>
<Elem>CONTROL_CONFIG_PATH="/home/fulup/opt/4a-softmixer/etc:/home/fulup/Workspace/Audio-4a/4a-softmixer/build/package/etc"</Elem>
<Elem>CONTROL_LUA_PATH="/home/fulup/opt/4a-softmixer/data:/home/fulup/Workspace/Audio-4a/4a-softmixer/conf.d/project/lua.d"</Elem>
@@ -528,18 +472,6 @@
<item path="plugins/alsa/alsa-core-ctl.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -550,18 +482,6 @@
<item path="plugins/alsa/alsa-core-pcm.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -572,18 +492,6 @@
<item path="plugins/alsa/alsa-effect-ramp.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -594,18 +502,6 @@
<item path="plugins/alsa/alsa-plug-dmix.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -616,18 +512,6 @@
<item path="plugins/alsa/alsa-plug-rate.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -638,18 +522,6 @@
<item path="plugins/alsa/alsa-plug-route.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -660,18 +532,6 @@
<item path="plugins/alsa/alsa-plug-vol.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -682,18 +542,6 @@
<item path="plugins/alsa/alsa-softmixer.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -704,18 +552,6 @@
<item path="plugins/alsa/alsa-utils-bypath.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
@@ -726,18 +562,6 @@
<item path="plugins/alsa/alsa-utils-dump.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
- <pElem>app-controller-submodule/ctl-lib</pElem>
- <pElem>build/app-controller-submodule/ctl-lib</pElem>
- <pElem>/usr/include</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/alsa</pElem>
- <pElem>../../../opt/include</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/uuid</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>mixer-binding</pElem>
- <pElem>app-afb-helpers-submodule</pElem>
- <pElem>build/plugins/alsa</pElem>
<pElem>/usr/include/lua5.3</pElem>
</incDir>
<preprocessorList>
diff --git a/plugins/alsa/alsa-api-sink.c b/plugins/alsa/alsa-api-sink.c
index 02322de..e38621a 100644
--- a/plugins/alsa/alsa-api-sink.c
+++ b/plugins/alsa/alsa-api-sink.c
@@ -22,23 +22,36 @@
PUBLIC AlsaPcmHwInfoT *ApiSinkGetParamsByZone(SoftMixerT *mixer, const char *target) {
+ // try to attach a zone as stream playback sink
AlsaSndZoneT *zone = ApiZoneGetByUid(mixer, target);
- if (!zone || !zone->sinks) return NULL;
+ if (zone && zone->sinks) {
- // use 1st channel to find attached sound card.
- const char *channel = zone->sinks[0]->uid;
+ // use 1st channel to find attached sound card.
+ const char *channel = zone->sinks[0]->uid;
- // search for channel uid into mixer sinks
- for (int idx = 0; mixer->sinks[idx]; idx++) {
- for (int jdx = 0; jdx < mixer->sinks[idx]->ccount; jdx++) {
- if (mixer->sinks[idx]->channels[jdx]->uid && !strcasecmp(channel, mixer->sinks[idx]->channels[jdx]->uid)) {
- return mixer->sinks[idx]->sndcard->params;
+ // search for channel uid into mixer sinks and derive sound card
+ for (int idx = 0; mixer->sinks[idx]; idx++) {
+ for (int jdx = 0; jdx < mixer->sinks[idx]->ccount; jdx++) {
+ if (mixer->sinks[idx]->channels[jdx]->uid && !strcasecmp(channel, mixer->sinks[idx]->channels[jdx]->uid)) {
+ return mixer->sinks[idx]->sndcard->params;
+ }
}
}
}
return NULL;
}
+PUBLIC AlsaSndPcmT *ApiSinkGetByUid(SoftMixerT *mixer, const char *target) {
+ // if no attached zone found, then try direct sink attachment
+ for (int idx = 0; mixer->sinks[idx]; idx++) {
+ if (mixer->sinks[idx]->uid && !strcasecmp(mixer->sinks[idx]->uid, target)) {
+ return mixer->sinks[idx];
+ }
+ }
+
+ return NULL;
+}
+
PUBLIC int ApiSinkAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, json_object * argsJ) {
int index;
diff --git a/plugins/alsa/alsa-api-streams.c b/plugins/alsa/alsa-api-streams.c
index 0f9786a..c8702ed 100644
--- a/plugins/alsa/alsa-api-streams.c
+++ b/plugins/alsa/alsa-api-streams.c
@@ -188,7 +188,9 @@ STATIC int CreateOneStream(SoftMixerT *mixer, const char * uid, AlsaStreamAudioT
AlsaSndCtlT *captureCard;
AlsaDevInfoT *captureDev = alloca(sizeof (AlsaDevInfoT));
AlsaLoopSubdevT *loopDev;
- char * captureName;
+ AlsaSndZoneT *zone;
+ char *volSlaveId;
+ char *captureName;
loopDev = ApiLoopFindSubdev(mixer, stream->uid, stream->source, &loop);
if (loopDev) {
@@ -225,15 +227,37 @@ STATIC int CreateOneStream(SoftMixerT *mixer, const char * uid, AlsaStreamAudioT
if (error) goto OnErrorExit;
}
- AlsaSndZoneT *zone = ApiZoneGetByUid(mixer, stream->sink);
- if (!zone) {
- AFB_ApiError(mixer->api, "CreateOneStream: mixer=%s stream=%s fail to find sink zone='%s'", mixer->uid, stream->uid, stream->sink);
- goto OnErrorExit;
+ if (mixer->zones[0]) {
+ // if zones exist then retrieve zone pcmid and channel count
+ zone = ApiZoneGetByUid(mixer, stream->sink);
+ if (!zone) {
+ AFB_ApiError(mixer->api, "CreateOneStream: mixer=%s stream=%s fail to find sink zone='%s'", mixer->uid, stream->uid, stream->sink);
+ goto OnErrorExit;
+ }
+
+ // route PCM should have been create during zones attach phase.
+ (void) asprintf(&volSlaveId, "route-%s", zone->uid);
+
+ } else {
+ AlsaSndPcmT *playback = ApiSinkGetByUid(mixer, stream->sink);
+ if (!playback) {
+ AFB_ApiError(mixer->api, "CreateOneStream: mixer=%s stream=%s fail to find sink playback='%s'", mixer->uid, stream->uid, stream->sink);
+ goto OnErrorExit;
+ }
+
+ // retrieve channel count from route and push it to stream
+ (void) asprintf(&volSlaveId, "dmix-%s", playback->uid);
+
+ // create a fake zone for rate converter selection
+ zone=alloca(sizeof(AlsaSndZoneT));
+ zone->uid= playback->uid;
+ zone->params = playback->sndcard->params;
+ zone->ccount = playback->ccount;
}
// retrieve channel count from route and push it to stream
stream->params->channels = zone->ccount;
-
+
// create mute control and Registry it as pause/resume ctl)
char *runName;
(void) asprintf(&runName, "pause-%s", stream->uid);
@@ -249,7 +273,7 @@ STATIC int CreateOneStream(SoftMixerT *mixer, const char * uid, AlsaStreamAudioT
(void) asprintf(&volName, "vol-%s", stream->uid);
// create stream and delay pcm opening until vol control is created
- streamPcm = AlsaCreateSoftvol(mixer, stream, zone, captureCard, volName, VOL_CONTROL_MAX, 0);
+ streamPcm = AlsaCreateSoftvol(mixer, stream, volSlaveId, captureCard, volName, VOL_CONTROL_MAX, 0);
if (!streamPcm) {
AFB_ApiError(mixer->api, "CreateOneStream: mixer=%s stream=%s fail to create stream", mixer->uid, stream->uid);
goto OnErrorExit;
diff --git a/plugins/alsa/alsa-plug-vol.c b/plugins/alsa/alsa-plug-vol.c
index 879901f..968ae73 100644
--- a/plugins/alsa/alsa-plug-vol.c
+++ b/plugins/alsa/alsa-plug-vol.c
@@ -22,26 +22,15 @@
ALSA_PLUG_PROTO(softvol); // stream uses softvol plugin
-PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *stream, AlsaSndZoneT *zone, AlsaSndCtlT *sndcard, char* ctlName, int max, int open) {
+PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *stream, char* slaveid, AlsaSndCtlT *sndcard, char* ctlName, int max, int open) {
snd_config_t *streamConfig, *elemConfig, *slaveConfig, *controlConfig,*pcmConfig;
AlsaPcmCtlT *pcmVol= calloc(1,sizeof(AlsaPcmCtlT));
int error = 0;
-
- // assert static/global softmixer handle get requited info
- AlsaSndZoneT **pcmZones = mixer->zones;
- if (!pcmZones) {
- AFB_ApiError(mixer->api, "AlsaCreateSoftvol:%s(stream) No Zone found [should Registry zones first]", stream->uid);
- goto OnErrorExit;
- }
-
+
char *cardid;
(void) asprintf(&cardid, "softvol-%s", stream->uid);
pcmVol->cid.cardid = (const char *) cardid;
- char *slaveid;
- (void)asprintf(&slaveid, "route-%s", zone->uid);
- // Fulup debug (void) asprintf(&slaveid, "dmix-%s", "8CH-USB");
-
// refresh global alsalib config and create PCM top config
snd_config_update();
error += snd_config_top(&streamConfig);
diff --git a/plugins/alsa/alsa-softmixer.h b/plugins/alsa/alsa-softmixer.h
index 3a3cf05..f435b3f 100644
--- a/plugins/alsa/alsa-softmixer.h
+++ b/plugins/alsa/alsa-softmixer.h
@@ -265,7 +265,7 @@ PUBLIC int AlsaPcmCopy(SoftMixerT *mixer, AlsaStreamAudioT *stream, AlsaPcmCtlT
// alsa-plug-*.c _snd_pcm_PLUGIN_open_ see macro ALSA_PLUG_PROTO(plugin)
PUBLIC int AlsaPcmConf(SoftMixerT *mixer, AlsaPcmCtlT *pcm, AlsaPcmHwInfoT *opts);
PUBLIC int AlsaPcmCopy(SoftMixerT *mixer, AlsaStreamAudioT *streamAudio, AlsaPcmCtlT *pcmIn, AlsaPcmCtlT *pcmOut, AlsaPcmHwInfoT * opts);
-PUBLIC AlsaPcmCtlT* AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *stream, AlsaSndZoneT *zone, AlsaSndCtlT *sndcard, char* ctlName, int max, int open);
+PUBLIC AlsaPcmCtlT* AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *stream, char *slaveid, AlsaSndCtlT *sndcard, char* ctlName, int max, int open);
PUBLIC AlsaPcmCtlT* AlsaCreateRoute(SoftMixerT *mixer, AlsaSndZoneT *zone, int open);
PUBLIC AlsaPcmCtlT* AlsaCreateRate(SoftMixerT *mixer, const char* pcmName, AlsaPcmCtlT *pcmSlave, AlsaPcmHwInfoT *params, int open);
PUBLIC AlsaPcmCtlT* AlsaCreateDmix(SoftMixerT *mixer, const char* pcmName, AlsaSndPcmT *pcmSlave, int open);
@@ -279,6 +279,7 @@ PUBLIC AlsaVolRampT *ApiRampGetByUid(SoftMixerT *mixer, const char *uid);
PUBLIC int ApiRampAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, json_object *argsJ);
PUBLIC AlsaPcmHwInfoT *ApiSinkGetParamsByZone(SoftMixerT *mixer, const char *target);
PUBLIC int ApiSinkAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, json_object * argsJ);
+PUBLIC AlsaSndPcmT *ApiSinkGetByUid(SoftMixerT *mixer, const char *target);
PUBLIC AlsaSndCtlT *ApiSourceFindSubdev(SoftMixerT *mixer, const char *target);
PUBLIC int ApiSourceAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, json_object * argsJ);
PUBLIC int ApiStreamAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, const char *prefix, json_object * argsJ);