aboutsummaryrefslogtreecommitdiffstats
path: root/HAL-afb/HAL_MOST_UNICENS
diff options
context:
space:
mode:
authorTobias Jahnke <tjahnk@users.noreply.github.com>2017-08-11 13:52:51 +0200
committerTobias Jahnke <tjahnk@users.noreply.github.com>2017-08-16 16:00:50 +0200
commit4aec17e1d42c1b0f3f628342bf24120299a0c819 (patch)
tree6ca6433369231ee6fc06140c93ae2d046391209b /HAL-afb/HAL_MOST_UNICENS
parentabe141f1d4dd46fe2bda6cc56db0ceaa964d87b1 (diff)
Adds readme for HAL MOST UNICENS
Diffstat (limited to 'HAL-afb/HAL_MOST_UNICENS')
-rw-r--r--HAL-afb/HAL_MOST_UNICENS/README.md51
-rw-r--r--HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c7
2 files changed, 56 insertions, 2 deletions
diff --git a/HAL-afb/HAL_MOST_UNICENS/README.md b/HAL-afb/HAL_MOST_UNICENS/README.md
new file mode 100644
index 0000000..a0cc190
--- /dev/null
+++ b/HAL-afb/HAL_MOST_UNICENS/README.md
@@ -0,0 +1,51 @@
+
+# HAL for MOST Sound Card
+
+## Introduction
+This Hardware Abstraction Layer (HAL) is intended to control MOST audio via
+standard ALSA mixer controls. Therefore the HAL add's controls to the MOST sound
+card. Modification of the mixer controls is mapped to control commands which are
+send to MOST nodes.
+
+The HAL requires to access the UNICENS V2 binding which is setting up the MOST
+network and the MOST node.
+
+Please check the following required components:
+* MOST Linux Driver
+* User must be member of "audio" group
+* UNICENS V2 binding
+* [K2L MOST150 Audio 5.1 Kit](https://www.k2l.de/products/74/MOST150%20Audio%205.1%20Kit/)
+
+## Possible Modifications
+Check if you need to adapt the default path for UNICENS configuration, e.g.
+```
+#define XML_CONFIG_PATH "/opt/AGL/unicens2-binding/config_multichannel_audio_kit.xml"
+```
+
+Check if you need to adapt the name of the MOST sound card.
+```
+#define ALSA_CARD_NAME "Microchip MOST:1"
+```
+
+You can check your MOST sound card name by calling ```aplay -l```, e.g.
+```
+aplay -l
+**** List of PLAYBACK Hardware Devices ****
+card 0: PCH [HDA Intel PCH], device 0: 92HD90BXX Analog [92HD90BXX Analog]
+ Subdevices: 1/1
+ Subdevice #0: subdevice #0
+card 1: ep016ch [Microchip MOST:1], device 0: ep01-6ch []
+ Subdevices: 1/1
+ Subdevice #0: subdevice #0
+card 2: ep022ch [Microchip MOST:2], device 0: ep02-2ch []
+ Subdevices: 1/1
+ Subdevice #0: subdevice #0
+
+```
+Choose the first sound card with 6 channels, e.g. if you see ```ep01-6ch``` just
+take ```Microchip MOST:1```.
+
+If you get messed up with card enumeration the following action may help:
+- Unplug your MOST USB hardware from target
+- Call ```sudo rm /var/lib/alsa/asound.state```
+- Connect MOST USB hardware after reboot or restart of ALSA
diff --git a/HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c b/HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c
index a5971fb..2cffe8d 100644
--- a/HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c
+++ b/HAL-afb/HAL_MOST_UNICENS/hal_most_unicens.c
@@ -23,6 +23,9 @@
#include "wrap_unicens.h"
#include "wrap_volume.h"
+#define XML_CONFIG_PATH "/home/agluser/DEVELOPMENT/AGL/BINDING/unicens2-binding/data/config_multichannel_audio_kit.xml"
+#define ALSA_CARD_NAME "Microchip MOST:1"
+
#define PCM_MAX_CHANNELS 6
static int master_volume;
@@ -84,7 +87,7 @@ STATIC alsaHalMapT alsaHalMap[]= {
/* HAL sound card mapping info */
STATIC alsaHalSndCardT alsaHalSndCard = {
- .name = "Microchip MOST:1", /* WARNING: name MUST match with 'aplay -l' */
+ .name = ALSA_CARD_NAME, /* WARNING: name MUST match with 'aplay -l' */
.info = "HAL for MICROCHIP MOST sound card controlled by UNICENS binding",
.ctls = alsaHalMap,
.volumeCB = NULL, /* use default volume normalization function */
@@ -113,7 +116,7 @@ STATIC int unicens_service_init() {
goto OnErrorExit;
}
- err = wrap_ucs_initialize_sync("/home/agluser/DEVELOPMENT/AGL/BINDING/unicens2-binding/data/config_multichannel_audio_kit.xml");
+ err = wrap_ucs_initialize_sync(XML_CONFIG_PATH);
if (err) {
AFB_ERROR("Failed to initialize UNICENS binding");
goto OnErrorExit;