summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorronan <ronan@iot.bzh>2017-11-24 19:00:41 +0100
committerronan <ronan@iot.bzh>2017-11-28 08:20:11 +0100
commit51f13ca3ac2ae698e7356bda826f0d4a75e11092 (patch)
tree5835e8145b28c51e7993c24f39d1da209fcce6d0
parent21cf14bcfec3ddbec729ed2b856861d1f96fb478 (diff)
Change 4A PCM Name
* Update Policy level of each pcm * Fix Pulseaudio start * Add 4A module config to pulse audio SPEC-1140: we need to have orderer PCM list in file 90-4a-modules.pa, to fix pulseaudio startup. (From lower to higher). Bug-AGL: SPEC-1136 Bug-AGL: SPEC-1103 Change-Id: I847711d9076a0d9817176a5cc3dee823476d8703 Signed-off-by: ronan <ronan@iot.bzh>
-rw-r--r--meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/ahl-config.json.template103
-rw-r--r--meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/asound.conf.template496
-rw-r--r--meta-audio-4a-framework/recipes-multimedia/agl-service-audio-4a/agl-service-audio-4a_git.bb3
-rw-r--r--meta-audio-4a-framework/recipes-multimedia/pulseaudio/files/90-4a-modules.pa12
-rw-r--r--meta-audio-4a-framework/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend16
5 files changed, 593 insertions, 37 deletions
diff --git a/meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/ahl-config.json.template b/meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/ahl-config.json.template
index 82e9668d..57fc5cca 100644
--- a/meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/ahl-config.json.template
+++ b/meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/ahl-config.json.template
@@ -6,31 +6,112 @@
"hal_list": ["@AUDIO_DEV_NAME_ID@"],
"audio_roles": [
{
- "name": "Guidance",
+ "name": "Emergency",
+ "description": "to complete",
+ "priority": 99,
+ "output": [
+ "alsa.plug:Emergency_Main"
+ ],
+ "interupt_behavior": "continue"
+ },
+ {
+ "name": "Warning",
+ "description": "to complete",
+ "priority": 95,
+ "output": [
+ "alsa.plug:Warning_Main"
+ ],
+ "interupt_behavior": "continue"
+ },
+ {
+ "name": "CustomHigh",
+ "description": "to complete",
+ "priority": 79,
+ "output": [
+ "alsa.plug:CustomHigh_Main"
+ ],
+ "interupt_behavior": "continue"
+ },
+ {
+ "name": "Phone",
+ "description": "to complete",
+ "priority": 72,
+ "output": [
+ "alsa.plug:Phone_Main"
+ ],
+ "interupt_behavior": "continue"
+ },
+ {
+ "name": "Navigation",
"description": "Important user information where user action is expected (e.g. navigation instruction)",
- "priority": 25,
+ "priority": 71,
"output": [
- "alsa.plug:Guidance_Main"
+ "alsa.plug:Navigation_Main"
+ ],
+ "interupt_behavior": "pause"
+ },
+ {
+ "name": "CustomMedium",
+ "description": "to complete",
+ "priority": 59,
+ "output": [
+ "alsa.plug:CustomMedium_Main"
],
"interupt_behavior": "continue"
},
{
- "name": "Notification",
- "description": "HMI or else notifications (e.g. touchscreen events, speech recognition on/off,...)",
- "priority": 100,
+ "name": "Video",
+ "description": "Video content",
+ "priority": 57,
"output": [
- "alsa.plug:Notification_Main"
+ "alsa.plug:Video_Main"
],
"interupt_behavior": "pause"
},
{
- "name": "Entertainment",
- "description": "Multimedia content (e.g. tuner, media player, etc.)",
- "priority": 0,
+ "name": "Streaming",
+ "description": "Streaming content",
+ "priority": 55,
+ "output": [
+ "alsa.plug:Streaming_Main"
+ ],
+ "interupt_behavior": "pause"
+ },
+ {
+ "name": "Multimedia",
+ "description": "Multimedia content",
+ "priority": 53,
"output": [
- "alsa.plug:Entertainment_Main"
+ "alsa.plug:Multimedia_Main"
],
"interupt_behavior": "pause"
+ },
+ {
+ "name": "Radio",
+ "description": "Radio content",
+ "priority": 51,
+ "output": [
+ "alsa.plug:Radio_Main"
+ ],
+ "interupt_behavior": "continue"
+ },
+ {
+ "name": "CustomLow",
+ "description": "to complete",
+ "priority": 19,
+ "output": [
+ "alsa.plug:CustomLow_Main"
+ ],
+ "interupt_behavior": "continue"
+ },
+ {
+ "name": "Fallback",
+ "description": "to complete",
+ "priority": 0,
+ "output": [
+ "alsa.plug:Fallback_Main"
+ ],
+ "interupt_behavior": "continue"
}
]
}
diff --git a/meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/asound.conf.template b/meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/asound.conf.template
index fba7953f..aa97a39c 100644
--- a/meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/asound.conf.template
+++ b/meta-audio-4a-framework/recipes-multimedia/4a-hal-config/files/asound.conf.template
@@ -2,6 +2,9 @@
#This define 2 sounds card with 8 audio roles each
#The alsa soft volume control name must match with the HAL Control Name
+# ----------------------------------------------------
+#
+# ----------------------------------------------------
pcm.@AUDIO_DEV_NAME@ {
type dmix
slave {pcm "hw:@AUDIO_DEV_NAME_ID@"}
@@ -16,76 +19,111 @@ pcm_hook_type.CtlHookPlugin {
lib "@INSTALL_PREFIX@/lib/policy_alsa_hook.so"
}
-pcm.Entertainment_Main {
+# ----------------------------------------------------
+#
+# ----------------------------------------------------
+pcm.Emergency_Main {
type softvol
slave.pcm "@AUDIO_DEV_NAME@"
control{
- name "Entertainment_Volume"
+ name "Emergency_Volume"
}
}
-pcm.Guidance_Main {
+pcm.Warning_Main {
type softvol
slave.pcm "@AUDIO_DEV_NAME@"
control{
- name "Guidance_Volume"
+ name "Warning_Volume"
}
}
-pcm.Communications_Main {
+pcm.CustomHigh_Main {
type softvol
slave.pcm "@AUDIO_DEV_NAME@"
control{
- name "Communications_Volume"
+ name "CustomHigh_Volume"
}
}
-pcm.Notification_Main {
+pcm.Phone_Main {
type softvol
slave.pcm "@AUDIO_DEV_NAME@"
control{
- name "Notification_Volume"
+ name "Phone_Volume"
}
}
-pcm.Warning_Main {
+pcm.Navigation_Main {
type softvol
slave.pcm "@AUDIO_DEV_NAME@"
control{
- name "Warning_Volume"
+ name "Navigation_Volume"
+ }
+}
+
+pcm.CustomMedium_Main {
+ type softvol
+ slave.pcm "@AUDIO_DEV_NAME@"
+ control{
+ name "CustomMedium_Volume"
}
}
-pcm.System_Main {
+pcm.Video_Main {
type softvol
slave.pcm "@AUDIO_DEV_NAME@"
control{
- name "System_Volume"
+ name "Video_Volume"
}
}
-pcm.Startup_Main {
+pcm.Streaming_Main {
type softvol
slave.pcm "@AUDIO_DEV_NAME@"
control{
- name "Startup_Volume"
+ name "Streaming_Volume"
}
}
-pcm.Shutdown_Main {
+pcm.Multimedia_Main {
type softvol
slave.pcm "@AUDIO_DEV_NAME@"
control{
- name "Shutdown_Volume"
+ name "Multimedia_Volume"
+ }
+}
+
+pcm.Radio_Main {
+ type softvol
+ slave.pcm "@AUDIO_DEV_NAME@"
+ control{
+ name "Radio_Volume"
+ }
+}
+
+pcm.CustomLow_Main {
+ type softvol
+ slave.pcm "@AUDIO_DEV_NAME@"
+ control{
+ name "CustomLow_Volume"
+ }
+}
+
+pcm.Fallback_Main {
+ type softvol
+ slave.pcm "@AUDIO_DEV_NAME@"
+ control{
+ name "Fallback_Volume"
}
}
# ----------------------------------------------------
# Define one hooked PCM channel per Audio Roles
# ----------------------------------------------------
-pcm.Multimedia {
+pcm.Emergency {
type hooks
- slave {pcm "Entertainment_Main"}
+ slave {pcm "Emergency_Main"}
hooks.0 {
comment "Defined used hook sharelib and provide arguments/config to install func"
type "CtlHookPlugin"
@@ -105,13 +143,135 @@ pcm.Multimedia {
# api subcall to request a role
request {
- stream_open "{'audio_role': 'Entertainment', 'endpoint_type':'sink'}"
+ stream_open "{'audio_role': 'Emergency', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.Warning {
+ type hooks
+ slave {pcm "Warning_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'Warning', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.CustomHigh {
+ type hooks
+ slave {pcm "CustomHigh_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'CustomHigh', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.Phone {
+ type hooks
+ slave {pcm "Phone_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'Phone', 'endpoint_type':'sink'}"
set_stream_state "{'state':'running'}"
}
# api subcall to request a role
release {
- set_stream_state "{'state':'idle'}"
stream_close "{}"
}
@@ -125,12 +285,297 @@ pcm.Multimedia {
}
}
-# ----------------------------------------------------
-# Define one hooked PCM channel per Audio Roles
-# ----------------------------------------------------
pcm.Navigation {
type hooks
- slave {pcm "Guidance_Main"}
+ slave {pcm "Navigation_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'Navigation', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.CustomMedium {
+ type hooks
+ slave {pcm "CustomMedium_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'CustomMedium', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.Video {
+ type hooks
+ slave {pcm "Video_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'Video', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.Streaming {
+ type hooks
+ slave {pcm "Streaming_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'Streaming', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.Multimedia {
+ type hooks
+ slave {pcm "Multimedia_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'Multimedia', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.Radio {
+ type hooks
+ slave {pcm "Radio_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'Radio', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.CustomLow {
+ type hooks
+ slave {pcm "CustomLow_Main"}
+ hooks.0 {
+ comment "Defined used hook sharelib and provide arguments/config to install func"
+ type "CtlHookPlugin"
+ hook_args {
+
+ # print few log messages (default false)
+ verbose true
+
+ # uri to audio-4a policy engine
+ uri="unix:/run/user/0/apis/ws/ahl-4a"
+
+ # timeout in ms (default 500)
+ timeout 5000
+
+ # force API synchronous mode
+ synchronous true
+
+ # api subcall to request a role
+ request {
+ stream_open "{'audio_role': 'CustomLow', 'endpoint_type':'sink'}"
+ set_stream_state "{'state':'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ stream_close "{}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search state_event, value 1}
+ sig-31 {search state_event, value 2}
+ sig-32 {search state_event, value 3}
+ }
+ }
+ }
+}
+
+pcm.Fallback {
+ type hooks
+ slave {pcm "Fallback_Main"}
hooks.0 {
comment "Defined used hook sharelib and provide arguments/config to install func"
type "CtlHookPlugin"
@@ -150,13 +595,12 @@ pcm.Navigation {
# api subcall to request a role
request {
- stream_open "{'audio_role': 'Guidance', 'endpoint_type':'sink'}"
+ stream_open "{'audio_role': 'Fallback', 'endpoint_type':'sink'}"
set_stream_state "{'state':'running'}"
}
# api subcall to request a role
release {
- set_stream_state "{'state':'idle'}"
stream_close "{}"
}
diff --git a/meta-audio-4a-framework/recipes-multimedia/agl-service-audio-4a/agl-service-audio-4a_git.bb b/meta-audio-4a-framework/recipes-multimedia/agl-service-audio-4a/agl-service-audio-4a_git.bb
index a0bb6d90..2422743d 100644
--- a/meta-audio-4a-framework/recipes-multimedia/agl-service-audio-4a/agl-service-audio-4a_git.bb
+++ b/meta-audio-4a-framework/recipes-multimedia/agl-service-audio-4a/agl-service-audio-4a_git.bb
@@ -28,6 +28,9 @@ while ! ls $svcfile > /dev/null; do
sleep 0.2
N=$(expr $N - 1)
done
+sed -i '/\[Unit\]/ a Before=pulseaudio.service' $svcfile;
+sed -i '/\[Unit\]/ a ConditionPathExistsGlob=/dev/snd/control*' $svcfile;
+
sed -i -e 's|/usr/bin/afb-daemon\>|& --ldpath=/usr/libexec/agl/afb-aaaa/lib:/usr/libexec/agl/4a-alsa-core/lib|' $svcfile
echo "-- TMP 4A INSTALL FIX END"
diff --git a/meta-audio-4a-framework/recipes-multimedia/pulseaudio/files/90-4a-modules.pa b/meta-audio-4a-framework/recipes-multimedia/pulseaudio/files/90-4a-modules.pa
new file mode 100644
index 00000000..0cc2fdc0
--- /dev/null
+++ b/meta-audio-4a-framework/recipes-multimedia/pulseaudio/files/90-4a-modules.pa
@@ -0,0 +1,12 @@
+load-module module-alsa-sink device=Fallback
+load-module module-alsa-sink device=CustomLow
+load-module module-alsa-sink device=Radio
+load-module module-alsa-sink device=Multimedia
+load-module module-alsa-sink device=Streaming
+load-module module-alsa-sink device=Video
+load-module module-alsa-sink device=CustomMedium
+load-module module-alsa-sink device=Navigation
+load-module module-alsa-sink device=Phone
+load-module module-alsa-sink device=CustomHigh
+load-module module-alsa-sink device=Warning
+load-module module-alsa-sink device=Emergency
diff --git a/meta-audio-4a-framework/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-audio-4a-framework/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
new file mode 100644
index 00000000..6b122f5e
--- /dev/null
+++ b/meta-audio-4a-framework/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
@@ -0,0 +1,16 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://90-4a-modules.pa"
+
+# Add .include directive to default.pa so optional configuration can be added
+do_install_append () {
+ if [ ! -e ${D}${sysconfdir}/pulse/default.d/ ]; then
+ echo ".include ${sysconfdir}/pulse/default.d" >> ${D}${sysconfdir}/pulse/default.pa
+ install -d ${D}${sysconfdir}/pulse/default.d
+ fi
+ install -m 0644 ${WORKDIR}/90-4a-modules.pa ${D}${sysconfdir}/pulse/default.d/
+
+ for m in module-udev-detect module-suspend-on-idle;do
+ sed -i -e "s|^load-module ${m}|#load-module ${m}|" ${D}${sysconfdir}/pulse/default.pa
+ done
+}