Merge "Update asound.conf.template"
[AGL/meta-agl-devel.git] / meta-audio-4a-framework / recipes-multimedia / 4a-hal-config / files / asound.conf.template
1 #AGL Audio High Level ALSA configuration
2 #This define 2 sounds card with 8 audio roles each
3 #The alsa soft volume control name must match with the HAL Control Name
4
5 pcm.@AUDIO_DEV_NAME@ {
6     type dmix
7     slave {pcm "hw:@AUDIO_DEV_NAME_ID@"}
8     ipc_key 1001          # ipc_key should be unique to each dmix
9 }
10
11 # -----------------------------------------------------
12 #  Register ControllerHookPlugin (ToiBeFix fullpath)
13 # -----------------------------------------------------
14 pcm_hook_type.CtlHookPlugin {
15     install "AlsaInstallHook"
16     lib "@INSTALL_PREFIX@/lib/policy_alsa_hook.so"
17 }
18
19 pcm.Entertainment_Main {
20  type softvol
21  slave.pcm "@AUDIO_DEV_NAME@"
22  control{
23    name "Entertainment_Volume"
24  }
25 }
26
27 pcm.Guidance_Main {
28  type softvol
29  slave.pcm "@AUDIO_DEV_NAME@"
30  control{
31    name "Guidance_Volume"
32  }
33 }
34
35 pcm.Communications_Main {
36  type softvol
37  slave.pcm "@AUDIO_DEV_NAME@"
38  control{
39    name "Communications_Volume"
40  }
41 }
42
43 pcm.Notification_Main {
44  type softvol
45  slave.pcm "@AUDIO_DEV_NAME@"
46  control{
47    name "Notification_Volume"
48  }
49 }
50
51 pcm.Warning_Main {
52  type softvol
53  slave.pcm "@AUDIO_DEV_NAME@"
54  control{
55    name "Warning_Volume"
56  }
57 }
58
59 pcm.System_Main {
60  type softvol
61  slave.pcm "@AUDIO_DEV_NAME@"
62  control{
63    name "System_Volume"
64  }
65 }
66
67 pcm.Startup_Main {
68  type softvol
69  slave.pcm "@AUDIO_DEV_NAME@"
70  control{
71    name "Startup_Volume"
72  }
73 }
74
75 pcm.Shutdown_Main {
76  type softvol
77  slave.pcm "@AUDIO_DEV_NAME@"
78  control{
79    name "Shutdown_Volume"
80  }
81 }
82
83 # ----------------------------------------------------
84 # Define one hooked PCM channel per Audio Roles
85 # ----------------------------------------------------
86 pcm.Multimedia {
87     type hooks
88     slave {pcm "Entertainment_Main"}
89     hooks.0 {
90         comment "Defined used hook sharelib and provide arguments/config to install func"
91         type "CtlHookPlugin"
92         hook_args {
93
94             # print few log messages (default false)
95             verbose true
96
97             # uri to audio-4a policy engine
98             uri="unix:/run/user/0/apis/ws/ahl-4a"
99
100             # timeout in ms (default 500)
101             timeout 5000
102
103             # force API synchronous mode
104             synchronous true
105
106             # api subcall to request a role
107             request {
108                 stream_open "{'audio_role': 'Entertainment', 'endpoint_type':'sink'}"
109                 set_stream_state "{'state':'running'}"
110             }
111
112             # api subcall to request a role
113             release {
114                 set_stream_state "{'state':'idle'}"
115                 stream_close "{}"
116             }
117
118             # map AGL event on Unix signal. Search in event for json key=value
119             events {
120                 sig-02 {search state_event, value 1}
121                 sig-31 {search state_event, value 2}
122                 sig-32 {search state_event, value 3}
123             }
124         }
125     }
126 }
127
128 # ----------------------------------------------------
129 # Define one hooked PCM channel per Audio Roles
130 # ----------------------------------------------------
131 pcm.Navigation {
132     type hooks
133     slave {pcm "Guidance_Main"}
134     hooks.0 {
135         comment "Defined used hook sharelib and provide arguments/config to install func"
136         type "CtlHookPlugin"
137         hook_args {
138
139             # print few log messages (default false)
140             verbose true
141
142             # uri to audio-4a policy engine
143             uri="unix:/run/user/0/apis/ws/ahl-4a"
144
145             # timeout in ms (default 500)
146             timeout 5000
147
148             # force API synchronous mode
149             synchronous true
150
151             # api subcall to request a role
152             request {
153                 stream_open "{'audio_role': 'Guidance', 'endpoint_type':'sink'}"
154                 set_stream_state "{'state':'running'}"
155             }
156
157             # api subcall to request a role
158             release {
159                 set_stream_state "{'state':'idle'}"
160                 stream_close "{}"
161             }
162
163             # map AGL event on Unix signal. Search in event for json key=value
164             events {
165                 sig-02 {search state_event, value 1}
166                 sig-31 {search state_event, value 2}
167                 sig-32 {search state_event, value 3}
168             }
169         }
170     }
171 }