summaryrefslogtreecommitdiffstats
path: root/conf.d/project/.asounrc-fulup
diff options
context:
space:
mode:
authorTai Vuong <tvuong@audiokinetic.com>2017-11-02 16:31:15 -0400
committerTai Vuong <tvuong@audiokinetic.com>2017-11-02 16:31:15 -0400
commit5d2ee4455d95771d12cc6058bc19c0d6f7fe43d1 (patch)
treeb4cbc2be7475641edf71ae42c6ce117dba27b91d /conf.d/project/.asounrc-fulup
parente92aade201ec131c3eb7430305f60a0a4c9c44c1 (diff)
parentab6e470190f2cc410b1f6fa8f146317a3c3b08b5 (diff)
merge dev branch with master
Diffstat (limited to 'conf.d/project/.asounrc-fulup')
-rw-r--r--conf.d/project/.asounrc-fulup198
1 files changed, 198 insertions, 0 deletions
diff --git a/conf.d/project/.asounrc-fulup b/conf.d/project/.asounrc-fulup
new file mode 100644
index 0000000..c98d5a8
--- /dev/null
+++ b/conf.d/project/.asounrc-fulup
@@ -0,0 +1,198 @@
+#
+# Author: Fulup Ar Foll
+# Object: PCM hook type
+#
+# Test : Note: Jabra_USB=hw:v1340
+# Check SoundCard ==> speaker-test -Dhw:v1340 -c2 -twav
+# Check MixerPCM ==> speaker-test -DSpeakers -c2 -twav
+# Check SoftVol ==> speaker-test -DMusicPCM -c2 -twav
+# Check Plugin ==> speaker-test -DMultimedia -c2 -twav
+# Check Plugin ==> speaker-test -DNavigation -c2 -twav
+#
+# MultiMedia aplay -DDMyNavPCM /usr/share/sounds/alsa/test.wav
+#
+# Bug/Feature: when softvol control is initialised from plugin and not
+# from AGL binding. At 1st run ctl has invalid TLV and cannot be
+# use. Bypass Solution:
+# * start audio-binder before playing sound (binding create control before softvol plugin)
+# * run a dummy aplay -DMyNavPCM "" to get a clean control
+#
+# References: https://www.spinics.net/lists/alsa-devel/msg54235.html
+# --------------------------------------------------------------------
+
+# ------------------------------------------------------
+# Mixer PCM allow to play multiple stream simultaneously
+# ------------------------------------------------------
+pcm.Speakers {
+ type dmix
+ slave {pcm "hw:v1340"} #Jabra Solmate 1
+ ipc_key 1001 # ipc_key should be unique to each dmix
+}
+
+# -----------------------------------------------------
+# Register ControllerHookPlugin (ToiBeFix fullpath)
+# -----------------------------------------------------
+pcm_hook_type.CtlHookPlugin {
+ install "AlsaInstallHook"
+ lib "/home/fulup/Workspace/Audio-4a/alsa-4a/build/alsa-hook/policy_alsa_hook.so"
+}
+
+
+# -------------------------------------------------------
+# Define one Audio Virtual Channel per Audio Roles
+# -------------------------------------------------------
+pcm.MusicPCM {
+ type softvol
+
+ # Point Slave on HOOK for policies control
+ slave.pcm "Speakers"
+
+ # name should match with HAL definition
+ control.name "Playback Multimedia"
+}
+
+pcm.NaviPCM {
+ type softvol
+
+ # Point Slave on HOOK for policies control
+ slave.pcm "Speakers"
+
+ # name should match with HAL definition
+ control.name "Playback Navigation"
+}
+
+pcm.UrgentPCM {
+ type softvol
+
+ # Point Slave on HOOK for policies control
+ slave.pcm "Speakers"
+
+ # name should match with HAL definition
+ control.name "Playback Emergency"
+}
+
+# ----------------------------------------------------
+# Define one hooked PCM channel per Audio Roles
+# ----------------------------------------------------
+pcm.Multimedia {
+ type hooks
+ slave {pcm "MusicPCM"}
+ 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:/var/tmp/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':'Entertainment', '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 music, value quit}
+ sig-31 {search event, value start}
+ sig-32 {search event, value start}
+ }
+ }
+ }
+}
+
+pcm.Navigation {
+ type hooks
+ slave {pcm "NaviPCM"}
+ 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:/var/tmp/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':'Guidance', 'endpoint_type': 'sink'}"
+ set_stream_state "{'state': 'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ release-role "{'uid':'alsa-hook-client'}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search navi, value quit}
+ sig-31 {search event, value start}
+ sig-32 {search event, value start}
+ }
+ }
+ }
+}
+
+pcm.Emergency {
+ type hooks
+ slave {pcm "UrgentPCM"}
+ 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:/var/tmp/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':'Emergency', 'endpoint_type': 'sink'}"
+ set_stream_state "{'state': 'running'}"
+ }
+
+ # api subcall to request a role
+ release {
+ release-role "{'uid':'alsa-hook-client'}"
+ }
+
+ # map AGL event on Unix signal. Search in event for json key=value
+ events {
+ sig-02 {search navi, value quit}
+ sig-31 {search event, value start}
+ sig-32 {search event, value start}
+ }
+ }
+ }
+}