Merge "agl-service-unicens(4A): remove mxml recipes due to replacemet by libxml2"
[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 # ----------------------------------------------------
6 #
7 # ----------------------------------------------------
8 pcm.@AUDIO_DEV_NAME@ {
9     type dmix
10     slave {pcm "hw:@AUDIO_DEV_NAME_ID@"}
11     ipc_key 1001          # ipc_key should be unique to each dmix
12 }
13
14 # -----------------------------------------------------
15 #  Register ControllerHookPlugin (ToiBeFix fullpath)
16 # -----------------------------------------------------
17 pcm_hook_type.CtlHookPlugin {
18     install "AlsaInstallHook"
19     lib "@INSTALL_PREFIX@/lib/policy_alsa_hook.so"
20 }
21
22 # ----------------------------------------------------
23 #
24 # ----------------------------------------------------
25 pcm.Emergency_Main {
26  type softvol
27  slave.pcm "@AUDIO_DEV_NAME@"
28  control{
29    name "Emergency_Volume"
30  }
31 }
32
33 pcm.Warning_Main {
34  type softvol
35  slave.pcm "@AUDIO_DEV_NAME@"
36  control{
37    name "Warning_Volume"
38  }
39 }
40
41 pcm.CustomHigh_Main {
42  type softvol
43  slave.pcm "@AUDIO_DEV_NAME@"
44  control{
45    name "CustomHigh_Volume"
46  }
47 }
48
49 pcm.Phone_Main {
50  type softvol
51  slave.pcm "@AUDIO_DEV_NAME@"
52  control{
53    name "Phone_Volume"
54  }
55 }
56
57 pcm.Navigation_Main {
58  type softvol
59  slave.pcm "@AUDIO_DEV_NAME@"
60  control{
61    name "Navigation_Volume"
62  }
63 }
64
65 pcm.CustomMedium_Main {
66  type softvol
67  slave.pcm "@AUDIO_DEV_NAME@"
68  control{
69    name "CustomMedium_Volume"
70  }
71 }
72
73 pcm.Video_Main {
74  type softvol
75  slave.pcm "@AUDIO_DEV_NAME@"
76  control{
77    name "Video_Volume"
78  }
79 }
80
81 pcm.Streaming_Main {
82  type softvol
83  slave.pcm "@AUDIO_DEV_NAME@"
84  control{
85    name "Streaming_Volume"
86  }
87 }
88
89 pcm.Multimedia_Main {
90  type softvol
91  slave.pcm "@AUDIO_DEV_NAME@"
92  control{
93    name "Multimedia_Volume"
94  }
95 }
96
97 pcm.Radio_Main {
98  type softvol
99  slave.pcm "@AUDIO_DEV_NAME@"
100  control{
101    name "Radio_Volume"
102  }
103 }
104
105 pcm.CustomLow_Main {
106  type softvol
107  slave.pcm "@AUDIO_DEV_NAME@"
108  control{
109    name "CustomLow_Volume"
110  }
111 }
112
113 pcm.Fallback_Main {
114  type softvol
115  slave.pcm "@AUDIO_DEV_NAME@"
116  control{
117    name "Fallback_Volume"
118  }
119 }
120
121 # ----------------------------------------------------
122 # Define one hooked PCM channel per Audio Roles
123 # ----------------------------------------------------
124 pcm.Emergency {
125     type hooks
126     slave {pcm "Emergency_Main"}
127     hooks.0 {
128         comment "Defined used hook sharelib and provide arguments/config to install func"
129         type "CtlHookPlugin"
130         hook_args {
131
132             # print few log messages (default false)
133             verbose true
134
135             # uri to audio-4a policy engine
136             uri="unix:/run/user/0/apis/ws/ahl-4a"
137
138             # timeout in ms (default 500)
139             timeout 5000
140
141             # force API synchronous mode
142             synchronous true
143
144             # api subcall to request a role
145             request {
146                 stream_open "{'audio_role': 'Emergency', 'endpoint_type':'sink'}"
147                 set_stream_state "{'state':'running'}"
148             }
149
150             # api subcall to request a role
151             release {
152                 stream_close "{}"
153             }
154
155             # map AGL event on Unix signal. Search in event for json key=value
156             events {
157                 sig-02 {search state_event, value 1}
158                 sig-31 {search state_event, value 2}
159                 sig-32 {search state_event, value 3}
160             }
161         }
162     }
163 }
164
165 pcm.Warning {
166     type hooks
167     slave {pcm "Warning_Main"}
168     hooks.0 {
169         comment "Defined used hook sharelib and provide arguments/config to install func"
170         type "CtlHookPlugin"
171         hook_args {
172
173             # print few log messages (default false)
174             verbose true
175
176             # uri to audio-4a policy engine
177             uri="unix:/run/user/0/apis/ws/ahl-4a"
178
179             # timeout in ms (default 500)
180             timeout 5000
181
182             # force API synchronous mode
183             synchronous true
184
185             # api subcall to request a role
186             request {
187                 stream_open "{'audio_role': 'Warning', 'endpoint_type':'sink'}"
188                 set_stream_state "{'state':'running'}"
189             }
190
191             # api subcall to request a role
192             release {
193                 stream_close "{}"
194             }
195
196             # map AGL event on Unix signal. Search in event for json key=value
197             events {
198                 sig-02 {search state_event, value 1}
199                 sig-31 {search state_event, value 2}
200                 sig-32 {search state_event, value 3}
201             }
202         }
203     }
204 }
205
206 pcm.CustomHigh {
207     type hooks
208     slave {pcm "CustomHigh_Main"}
209     hooks.0 {
210         comment "Defined used hook sharelib and provide arguments/config to install func"
211         type "CtlHookPlugin"
212         hook_args {
213
214             # print few log messages (default false)
215             verbose true
216
217             # uri to audio-4a policy engine
218             uri="unix:/run/user/0/apis/ws/ahl-4a"
219
220             # timeout in ms (default 500)
221             timeout 5000
222
223             # force API synchronous mode
224             synchronous true
225
226             # api subcall to request a role
227             request {
228                 stream_open "{'audio_role': 'CustomHigh', 'endpoint_type':'sink'}"
229                 set_stream_state "{'state':'running'}"
230             }
231
232             # api subcall to request a role
233             release {
234                 stream_close "{}"
235             }
236
237             # map AGL event on Unix signal. Search in event for json key=value
238             events {
239                 sig-02 {search state_event, value 1}
240                 sig-31 {search state_event, value 2}
241                 sig-32 {search state_event, value 3}
242             }
243         }
244     }
245 }
246
247 pcm.Phone {
248     type hooks
249     slave {pcm "Phone_Main"}
250     hooks.0 {
251         comment "Defined used hook sharelib and provide arguments/config to install func"
252         type "CtlHookPlugin"
253         hook_args {
254
255             # print few log messages (default false)
256             verbose true
257
258             # uri to audio-4a policy engine
259             uri="unix:/run/user/0/apis/ws/ahl-4a"
260
261             # timeout in ms (default 500)
262             timeout 5000
263
264             # force API synchronous mode
265             synchronous true
266
267             # api subcall to request a role
268             request {
269                 stream_open "{'audio_role': 'Phone', 'endpoint_type':'sink'}"
270                 set_stream_state "{'state':'running'}"
271             }
272
273             # api subcall to request a role
274             release {
275                 stream_close "{}"
276             }
277
278             # map AGL event on Unix signal. Search in event for json key=value
279             events {
280                 sig-02 {search state_event, value 1}
281                 sig-31 {search state_event, value 2}
282                 sig-32 {search state_event, value 3}
283             }
284         }
285     }
286 }
287
288 pcm.Navigation {
289     type hooks
290     slave {pcm "Navigation_Main"}
291     hooks.0 {
292         comment "Defined used hook sharelib and provide arguments/config to install func"
293         type "CtlHookPlugin"
294         hook_args {
295
296             # print few log messages (default false)
297             verbose true
298
299             # uri to audio-4a policy engine
300             uri="unix:/run/user/0/apis/ws/ahl-4a"
301
302             # timeout in ms (default 500)
303             timeout 5000
304
305             # force API synchronous mode
306             synchronous true
307
308             # api subcall to request a role
309             request {
310                 stream_open "{'audio_role': 'Navigation', 'endpoint_type':'sink'}"
311                 set_stream_state "{'state':'running'}"
312             }
313
314             # api subcall to request a role
315             release {
316                 stream_close "{}"
317             }
318
319             # map AGL event on Unix signal. Search in event for json key=value
320             events {
321                 sig-02 {search state_event, value 1}
322                 sig-31 {search state_event, value 2}
323                 sig-32 {search state_event, value 3}
324             }
325         }
326     }
327 }
328
329 pcm.CustomMedium {
330     type hooks
331     slave {pcm "CustomMedium_Main"}
332     hooks.0 {
333         comment "Defined used hook sharelib and provide arguments/config to install func"
334         type "CtlHookPlugin"
335         hook_args {
336
337             # print few log messages (default false)
338             verbose true
339
340             # uri to audio-4a policy engine
341             uri="unix:/run/user/0/apis/ws/ahl-4a"
342
343             # timeout in ms (default 500)
344             timeout 5000
345
346             # force API synchronous mode
347             synchronous true
348
349             # api subcall to request a role
350             request {
351                 stream_open "{'audio_role': 'CustomMedium', 'endpoint_type':'sink'}"
352                 set_stream_state "{'state':'running'}"
353             }
354
355             # api subcall to request a role
356             release {
357                 stream_close "{}"
358             }
359
360             # map AGL event on Unix signal. Search in event for json key=value
361             events {
362                 sig-02 {search state_event, value 1}
363                 sig-31 {search state_event, value 2}
364                 sig-32 {search state_event, value 3}
365             }
366         }
367     }
368 }
369
370 pcm.Video {
371     type hooks
372     slave {pcm "Video_Main"}
373     hooks.0 {
374         comment "Defined used hook sharelib and provide arguments/config to install func"
375         type "CtlHookPlugin"
376         hook_args {
377
378             # print few log messages (default false)
379             verbose true
380
381             # uri to audio-4a policy engine
382             uri="unix:/run/user/0/apis/ws/ahl-4a"
383
384             # timeout in ms (default 500)
385             timeout 5000
386
387             # force API synchronous mode
388             synchronous true
389
390             # api subcall to request a role
391             request {
392                 stream_open "{'audio_role': 'Video', 'endpoint_type':'sink'}"
393                 set_stream_state "{'state':'running'}"
394             }
395
396             # api subcall to request a role
397             release {
398                 stream_close "{}"
399             }
400
401             # map AGL event on Unix signal. Search in event for json key=value
402             events {
403                 sig-02 {search state_event, value 1}
404                 sig-31 {search state_event, value 2}
405                 sig-32 {search state_event, value 3}
406             }
407         }
408     }
409 }
410
411 pcm.Streaming {
412     type hooks
413     slave {pcm "Streaming_Main"}
414     hooks.0 {
415         comment "Defined used hook sharelib and provide arguments/config to install func"
416         type "CtlHookPlugin"
417         hook_args {
418
419             # print few log messages (default false)
420             verbose true
421
422             # uri to audio-4a policy engine
423             uri="unix:/run/user/0/apis/ws/ahl-4a"
424
425             # timeout in ms (default 500)
426             timeout 5000
427
428
429             # force API synchronous mode
430             synchronous true
431
432             # api subcall to request a role
433             request {
434                 stream_open "{'audio_role': 'Streaming', 'endpoint_type':'sink'}"
435                 set_stream_state "{'state':'running'}"
436             }
437
438             # api subcall to request a role
439             release {
440                 stream_close "{}"
441             }
442
443             # map AGL event on Unix signal. Search in event for json key=value
444             events {
445                 sig-02 {search state_event, value 1}
446                 sig-31 {search state_event, value 2}
447                 sig-32 {search state_event, value 3}
448             }
449         }
450     }
451 }
452
453 pcm.Multimedia {
454     type hooks
455     slave {pcm "Multimedia_Main"}
456     hooks.0 {
457         comment "Defined used hook sharelib and provide arguments/config to install func"
458         type "CtlHookPlugin"
459         hook_args {
460
461             # print few log messages (default false)
462             verbose true
463
464             # uri to audio-4a policy engine
465             uri="unix:/run/user/0/apis/ws/ahl-4a"
466
467             # timeout in ms (default 500)
468             timeout 5000
469
470             # force API synchronous mode
471             synchronous true
472
473             # api subcall to request a role
474             request {
475                 stream_open "{'audio_role': 'Multimedia', 'endpoint_type':'sink'}"
476                 set_stream_state "{'state':'running'}"
477             }
478
479             # api subcall to request a role
480             release {
481                 stream_close "{}"
482             }
483
484             # map AGL event on Unix signal. Search in event for json key=value
485             events {
486                 sig-02 {search state_event, value 1}
487                 sig-31 {search state_event, value 2}
488                 sig-32 {search state_event, value 3}
489             }
490         }
491     }
492 }
493
494 pcm.Radio {
495     type hooks
496     slave {pcm "Radio_Main"}
497     hooks.0 {
498         comment "Defined used hook sharelib and provide arguments/config to install func"
499         type "CtlHookPlugin"
500         hook_args {
501
502             # print few log messages (default false)
503             verbose true
504
505             # uri to audio-4a policy engine
506             uri="unix:/run/user/0/apis/ws/ahl-4a"
507
508             # timeout in ms (default 500)
509             timeout 5000
510
511             # force API synchronous mode
512             synchronous true
513
514             # api subcall to request a role
515             request {
516                 stream_open "{'audio_role': 'Radio', 'endpoint_type':'sink'}"
517                 set_stream_state "{'state':'running'}"
518             }
519
520             # api subcall to request a role
521             release {
522                 stream_close "{}"
523             }
524
525             # map AGL event on Unix signal. Search in event for json key=value
526             events {
527                 sig-02 {search state_event, value 1}
528                 sig-31 {search state_event, value 2}
529                 sig-32 {search state_event, value 3}
530             }
531         }
532     }
533 }
534
535 pcm.CustomLow {
536     type hooks
537     slave {pcm "CustomLow_Main"}
538     hooks.0 {
539         comment "Defined used hook sharelib and provide arguments/config to install func"
540         type "CtlHookPlugin"
541         hook_args {
542
543             # print few log messages (default false)
544             verbose true
545
546             # uri to audio-4a policy engine
547             uri="unix:/run/user/0/apis/ws/ahl-4a"
548
549             # timeout in ms (default 500)
550             timeout 5000
551
552             # force API synchronous mode
553             synchronous true
554
555             # api subcall to request a role
556             request {
557                 stream_open "{'audio_role': 'CustomLow', 'endpoint_type':'sink'}"
558                 set_stream_state "{'state':'running'}"
559             }
560
561             # api subcall to request a role
562             release {
563                 stream_close "{}"
564             }
565
566             # map AGL event on Unix signal. Search in event for json key=value
567             events {
568                 sig-02 {search state_event, value 1}
569                 sig-31 {search state_event, value 2}
570                 sig-32 {search state_event, value 3}
571             }
572         }
573     }
574 }
575
576 pcm.Fallback {
577     type hooks
578     slave {pcm "Fallback_Main"}
579     hooks.0 {
580         comment "Defined used hook sharelib and provide arguments/config to install func"
581         type "CtlHookPlugin"
582         hook_args {
583
584             # print few log messages (default false)
585             verbose true
586
587             # uri to audio-4a policy engine
588             uri="unix:/run/user/0/apis/ws/ahl-4a"
589
590             # timeout in ms (default 500)
591             timeout 5000
592
593             # force API synchronous mode
594             synchronous true
595
596             # api subcall to request a role
597             request {
598                 stream_open "{'audio_role': 'Fallback', 'endpoint_type':'sink'}"
599                 set_stream_state "{'state':'running'}"
600             }
601
602             # api subcall to request a role
603             release {
604                 stream_close "{}"
605             }
606
607             # map AGL event on Unix signal. Search in event for json key=value
608             events {
609                 sig-02 {search state_event, value 1}
610                 sig-31 {search state_event, value 2}
611                 sig-32 {search state_event, value 3}
612             }
613         }
614     }
615 }