From 736138bfc9f7b455a96679e2d67fd922a8f16464 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Thu, 7 Jul 2022 16:19:07 +0000
Subject: [PATCH] README: document configuration file (MR 2)

q6voiced expects 2 variables in its OpenRC file to specify
the card and device IDs of the modem audio device, document this.
---
 README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/README.md b/README.md
index 56a2a18..e008586 100644
--- a/README.md
+++ b/README.md
@@ -26,3 +26,50 @@ allows voice call audio to work without activating audio manually.
 
 [msm8916-mainline/linux]: https://github.com/msm8916-mainline/linux
 [Hostless PCM streams]: https://www.kernel.org/doc/html/latest/sound/soc/dpcm.html#hostless-pcm-streams
+
+## Configuration
+
+The q6voiced daemon expects a configuration file in `/etc/conf.d/q6voiced`.
+The file looks like this:
+
+```
+q6voice_card=$CARD
+q6voice_device=$DEVICE
+```
+
+You can find the values for `$CARD` and `$DEVICE` using `alsactl info` from the `alsa-utils` package.
+You are looking for the modem audio device (example: `VoiceMMode1`) which is defined in your dts:
+
+**dts**
+```
+voicemmode1-dai-link {
+    link-name = "VoiceMMode1";
+    cpu {
+        sound-dai = <&q6voicedai VOICEMMODE1>;
+    };
+};
+```
+
+**alsactl info output**
+```
+- card: 0
+  id: SHIFT6mq
+  name: SHIFT6mq
+  longname: SHIFT6mq
+  mixer_name: 
+  components: 
+  controls_count: 1268
+  pcm:
+    - stream: PLAYBACK
+      devices:
+        ...
+        - device: 12
+          id: VoiceMMode1 (*)
+          name: 
+          subdevices:
+            - subdevice: 0
+              name: subdevice #0
+
+```
+
+In this case, the values are `$CARD=0` and `$DEVICE=12`.
-- 
GitLab