From 51f13ca3ac2ae698e7356bda826f0d4a75e11092 Mon Sep 17 00:00:00 2001 From: ronan Date: Fri, 24 Nov 2017 19:00:41 +0100 Subject: 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 --- .../4a-hal-config/files/ahl-config.json.template | 103 ++++- .../4a-hal-config/files/asound.conf.template | 496 +++++++++++++++++++-- 2 files changed, 562 insertions(+), 37 deletions(-) (limited to 'meta-audio-4a-framework/recipes-multimedia/4a-hal-config') 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 "{}" } -- cgit 1.2.3-korg