From a8b725529c9e24c284542a7a0af530d8dd7fa61f Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Wed, 17 Jul 2019 15:23:51 +0200 Subject: Add an example json configuration Add an example json configuration files to show how to write "haldependencies" and "halmap" sections. BUG-AGL: SPEC-2683 Change-Id: I3642677ec6aae6144d2e30dc3f3680ebf473dccf Signed-off-by: Jonathan Aillet --- 4a-hal-cfg-example/hal-4a-example.json | 272 +++++++++++++++++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 4a-hal-cfg-example/hal-4a-example.json (limited to '4a-hal-cfg-example') diff --git a/4a-hal-cfg-example/hal-4a-example.json b/4a-hal-cfg-example/hal-4a-example.json new file mode 100644 index 0000000..ad02ece --- /dev/null +++ b/4a-hal-cfg-example/hal-4a-example.json @@ -0,0 +1,272 @@ +{ + "$schema": "http://iot.bzh/download/public/schema/json/ctl-schema.json", + "metadata": { + "uid": "EXAMPLE-4A-HAL", + "version": "0.99", + "api": "4a-hal-example", + "require": [ "alsacore", "smixer" ], + "info": "4a hal design to show all 4a-hal binding functionalities related to json configuration files", + "author": "Jonathan Aillet", + "date": "2019-07-17" + }, + "resources": [ + { + "uid": "hal-bluealsa", + "info": "Bluealsa hal plugin", + "params": { + "sco": { + "mic": "CSL-CM106-8CH-USB", + "zone": "full-stereo", + "delayms": 800 + }, + "a2dp": { + "zone": "full-stereo", + "delayms": 500 + } + }, + "libs": ["hal-bluealsa.ctlso"] + } + ], + "controls": [ + { + "uid": "ping", + "info": "Ping hal", + "action": "api://4a-hal-manager#ping" + } + ], + "haldependencies" : [ + { + "uid" : "generic-usb", + "class" : "dynamic", + "cardPath" : "/dev/snd/by-id/usb-0d8c_USB_Sound_Device-00", + "cardLongName" : "USB Sound Device" + }, + { + "uid" : "m3kf-radio", + "class" : "static", + "cardPath" : "/dev/snd/by-path/platform-sound@2", + "cardId" : "radio" + }, + { + "uid" : "m3-jack-output", + "class" : "mandatory", + "cardPath" : [ + "/dev/snd/by-path/platform-sound@1", + "/dev/snd/by-path/platform-sound" + ], + "cardShortName" : "ak4613" + }, + { + "uid" : "minnow-hdmi-output", + "AnyOf" : { + "cardPath" : "/dev/snd/by-path/pci-0000:00:1b.0", + "cardMixerName" : "example" + }, + "cardLongName" : "HDA Intel PCH", + "playbackDeviceId" : "HDMI 0" + } + ], + "halmap": [ + { + "uid" : "halmap-generic-usb", + "info" : "HalMap for a generic usb audio device", + "target" : "generic-usb", + "controls" : [ + { + "uid": "agl-master-playback-volume", + "alsa": { + "numid": 8, + "value": 80 + } + }, + { + "uid": "hal-ping", + "info": "ping this hal through alsa", + "alsa": { + "name": "Hal-Ping", + "value": 20, + "create": + { + "type": "INTEGER", + "count": 1, + "minval": 0, + "maxval": 100, + "step": 1 + } + }, + "action": "api://4a-hal-csl-cm106-8ch-usb#ping" + } + ] + }, + { + "uid" : "halmap-m3-jack", + "target" : "m3-jack-output", + "controls" : [ + { + "uid": "agl-master-capture-volume", + "alsa": { + "name": "DVC In Capture Volume" + } + } + ] + }, + { + "uid" : "halmap-minnow-hdmi", + "target" : "minnow-hdmi-output", + "controls" : [ + { + "uid": "agl-master-playback-switch", + "alsa": { + "name": "IEC958 Playback Switch", + "value": 1 + } + } + ] + } + ], + "halmixer": { + "uid": "example", + "mixerapi": "smixer", + "prefix": "example", + "ramps": [ + { + "uid": "ramp-very-fast", + "delay": 50, + "up": 6, + "down": 10 + }, + { + "uid": "ramp-fast", + "delay": 50, + "up": 2, + "down": 10 + }, + { + "uid": "ramp-normal", + "delay": 50, + "up": 2, + "down": 4 + }, + { + "uid": "ramp-slow", + "delay": 50, + "up": 2, + "down": 2 + }, + { + "uid": "ramp-very-slow", + "delay": 100, + "up": 1, + "down": 1 + } + ], + "playbacks" : { + "uid": "2CH-GENERIC-USB", + "path": "/dev/snd/by-id/usb-0d8c_USB_Sound_Device-00", + "params": { + "rate": 48000 + }, + "sink": { + "channels": [ + { + "uid": "front-right", + "port": 0 + }, + { + "uid": "front-left", + "port": 1 + } + ] + } + }, + "captures": { + "uid": "2CH-GENERIC-USB", + "path": "/dev/snd/by-id/usb-0d8c_USB_Sound_Device-00", + "params": { + "rate": 48000 + }, + "source": { + "channels": [ + { + "uid": "mic-right", + "port": 0 + }, + { + "uid": "mic-left", + "port": 1 + } + ] + } + }, + "zones": [ + { + "uid": "full-stereo", + "sink": [ + { + "target": "front-right", + "channel": 0 + }, + { + "target": "front-left", + "channel": 1 + } + ] + }, + { + "uid": "front-seats", + "sink": [ + { + "target": "front-right", + "channel": 0 + }, + { + "target": "front-left", + "channel": 1 + } + ] + } + ], + "streams": [ + { + "uid": "multimedia", + "verb": "multimedia", + "zone": "full-stereo", + "volume": 60, + "mute": false, + "params": { + "rate": 48000 + } + }, + { + "uid": "navigation", + "verb": "navigation", + "zone": "front-seats", + "volume": 70, + "mute": false, + "params": { + "rate": 48000 + } + }, + { + "uid": "emergency", + "verb": "emergency", + "zone": "front-seats", + "volume": 60, + "mute": false, + "params": { + "rate": 48000 + } + }, + { + "uid": "radio_stream", + "verb": "radio_stream", + "zone": "full-stereo", + "volume": 70, + "mute": true, + "params": { + "rate" : 48000 + } + } + ] + } +} -- cgit 1.2.3-korg