Initial integration of 4A (AGL Advance Audio Agent)
[AGL/meta-agl-devel.git] / meta-audio-4a-framework / recipes-multimedia / 4a-hal-config / files / asound.conf.template
1
2 # ------------------------------------------------------
3 # Mixer PCM allow to play multiple stream simultaneously
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
20 # -------------------------------------------------------
21 # Define one Audio Virtual Channel per Audio Roles
22 # -------------------------------------------------------
23 pcm.MusicPCM {
24     type softvol
25
26     # Point Slave on HOOK for policies control
27     slave.pcm "@AUDIO_DEV_NAME@"
28
29     # name should match with HAL definition
30     control.name  "Playback Multimedia"
31 }
32
33 pcm.NaviPCM {
34     type softvol
35
36     # Point Slave on HOOK for policies control
37     slave.pcm "@AUDIO_DEV_NAME@"
38
39     # name should match with HAL definition
40     control.name  "Playback Navigation"
41 }
42
43 pcm.UrgentPCM {
44     type softvol
45
46     # Point Slave on HOOK for policies control
47     slave.pcm "@AUDIO_DEV_NAME@"
48
49     # name should match with HAL definition
50     control.name  "Playback Emergency"
51 }
52
53 # ----------------------------------------------------
54 # Define one hooked PCM channel per Audio Roles
55 # ----------------------------------------------------
56 pcm.Multimedia {
57     type hooks
58     slave {pcm "MusicPCM"}
59     hooks.0 {
60         comment "Defined used hook sharelib and provide arguments/config to install func"
61         type "CtlHookPlugin"
62         hook_args {
63
64             # print few log messages (default false)
65             verbose true
66
67             # uri to audio-4a policy engine
68             uri="unix:/var/tmp/pol4a"
69
70             # timeout in ms (default 500)
71             timeout 5000
72
73             # force API synchronous mode
74             synchronous true
75
76             # api subcall to request a role
77             request {
78                 multimedia-role "{'uid':'alsa-hook-client'}"
79                 signal-timeout  "{'timeout':180, 'music':'quit'}"
80             }
81
82             # api subcall to request a role
83             release {
84                 release-role "{'uid':'alsa-hook-client'}"
85             }
86
87             # map AGL event on Unix signal. Search in event for json key=value
88             events {
89                 sig-02 {search music, value quit}
90                 sig-31 {search event, value start}
91                 sig-32 {search event, value start}
92             }
93         }
94     }
95 }
96
97 pcm.Navigation {
98     type hooks
99     slave {pcm "NaviPCM"}
100     hooks.0 {
101         comment "Defined used hook sharelib and provide arguments/config to install func"
102         type "CtlHookPlugin"
103         hook_args {
104
105             # print few log messages (default false)
106             verbose true
107
108             # uri to audio-4a policy engine
109             uri="unix:/var/tmp/pol4a"
110
111             # timeout in ms (default 500)
112             timeout 5000
113
114             # force API synchronous mode
115             synchronous true
116
117             # api subcall to request a role
118             request {
119                 navigation-role "{'uid':'alsa-hook-client'}"
120                 signal-timeout  "{'timeout':5, 'navi':'quit'}"
121             }
122
123             # api subcall to request a role
124             release {
125                 release-role "{'uid':'alsa-hook-client'}"
126             }
127
128             # map AGL event on Unix signal. Search in event for json key=value
129             events {
130                 sig-02 {search navi, value quit}
131                 sig-31 {search event, value start}
132                 sig-32 {search event, value start}
133             }
134         }
135     }
136 }