This is a cache of https://discuss.96boards.org/t/dragonboard-845c-rb3-aosp-how-to-use-integrated-dmics/12151. It is a snapshot of the page at 2024-10-31T14:23:44.709+0000.
<strong>dragonboard</strong> 845c RB3 AOSP: how to use integrated DMICs? - <strong>dragonboard</strong> 845c - 96Boards Forum

dragonboard 845c RB3 AOSP: how to use integrated DMICs?

Hello,
I am working on a dragonboard 845c RB3 (navigation mezzanine) with AOSP Automotive (branch master).
I want to use Digital microphones (DMIC) which are integrated on Navigation mezzanine.

I tried to capture data with tinycap:

  • 1 channel

    qc_rb3:/data/sound # tinycap essai.wav -D 0 -d 2 -c 1 -r 48000
    Capturing sample: 1 ch, 48000 hz, 16 bit
    start errorCaptured 0 frames

in dmesg, I obtained:

[16514.355412] MultiMedia3: ASoC: no backend DAIs enabled for MultiMedia3
[16514.362820] MultiMedia3: ASoC: dpcm_fe_dai_prepare() failed (-22)
  • 2 channels
    qc_rb3:/data/sound # tinycap essai.wav -c 2 -r 48000 -D 0 -d 2
    Capturing sample: 2 ch, 48000 hz, 16 bit
    start errorCaptured 0 frames

    [ 2111.005727] MultiMedia3: ASoC: no backend DAIs enabled for MultiMedia3
    [ 2111.016556] MultiMedia3: ASoC: dpcm_fe_dai_prepare() failed (-22)

Same things with device 1:
qc_rb3:/data/sound # tinycap essai.wav -D 0 -d 1 -c 1 -r 48000
Capturing sample: 1 ch, 48000 hz, 16 bit
start errorCaptured 0 frames

[17413.160151] MultiMedia2: ASoC: no backend DAIs enabled for MultiMedia2
[17413.167638] MultiMedia2: ASoC: dpcm_fe_dai_prepare() failed (-22)

qc_rb3:/data/sound # tinycap essai.wav -c 2 -r 48000 -D 0 -d 1                                                                                                    
Capturing sample: 2 ch, 48000 hz, 16 bit
start errorCaptured 0 frames

[ 2021.304115] MultiMedia2: ASoC: no backend DAIs enabled for MultiMedia2
[ 2021.311572] MultiMedia2: ASoC: dpcm_fe_dai_prepare() failed (-22)

I also tried with an application ‘Voice Recorder_v54.1_apkpure.com.apk’.
When starting recording, the application says that microphone is already used by an other application.

I see some tips to enable microphones under Linux Embedded, but the tool used is not available under AOSP.
I also see ways to configure mixer with tinymix or with /vendor/etc/mixer_paths.xml. But with 1257 items, I am a little bit confused.

Thanks in advance for help.

Regards

Hello,

Finally, I found solution.

  • Mixer has to be setup to enable microphones. In device/linaro/dragonboard/etc/mixer_paths.xml
--- etc/mixer_paths.xml	2022-09-26 19:45:37.511443731 +0200
+++ etc/mixer_paths.xml	2022-11-09 10:40:42.417621951 +0100
@@ -1,7 +1,20 @@
 <mixer>
     <!-- Enable HDMI out for db845c -->
     <path name="hdmi_db845c">
+        <!-- Enable HDMI out -->
         <ctl name="QUAT_MI2S_RX Audio Mixer MultiMedia1" value="1" />
+        <!-- Enable DMIC0/DMIC1 inputs -->
+        <ctl name="AIF1_CAP Mixer SLIM TX7" value="1" />
+        <ctl name="AIF1_CAP Mixer SLIM TX8" value="1" />
+        <ctl name="CDC_IF TX7 MUX" value="DEC7" />
+        <ctl name="CDC_IF TX8 MUX" value="DEC8" />
+        <ctl name="ADC MUX7" value="DMIC" />
+        <ctl name="DMIC MUX7" value="DMIC0" />
+        <ctl name="ADC MUX8" value="DMIC" />
+        <ctl name="DMIC MUX8" value="DMIC1" />
+        <ctl name="DEC7 Volume" value="100" />
+        <ctl name="DEC8 Volume" value="100" />
+        <ctl name="MultiMedia3 Mixer SLIMBUS_0_TX" value="1" />
     </path>
 
     <!-- Enable HDMI out for rb5 -->
  • Audio primary has to be patched. In device/linaro/dragonboard/audio/
--- audio/audio_hw.h	2022-11-09 09:55:31.216303388 +0100
+++ audio/audio_hw.h	2022-11-08 18:43:31.852842874 +0100
@@ -24,7 +24,7 @@
 
 #define PORT_HDMI 0
 #define PORT_INTERNAL_SPEAKER 1
-#define PORT_BUILTIN_MIC 3
+#define PORT_BUILTIN_MIC 2
 
 #define MIXER_XML_PATH "/vendor/etc/mixer_paths.xml"
 /* Minimum granularity - Arbitrary but small value */
--- audio/audio_hw.c 2022-11-09 09:55:31.216303388 +0100
+++ audio/audio_hw.c 2022-11-08 18:43:31.852842874 +0100|
@@ -1045,7 +1047,7 @@
     } else {
         in->config.rate = CAPTURE_CODEC_SAMPLING_RATE;
     }
-    in->config.format = PCM_FORMAT_S32_LE;
+    in->config.format = PCM_FORMAT_S16_LE;
     in->config.period_size = CAPTURE_PERIOD_SIZE;
     in->config.period_count = CAPTURE_PERIOD_COUNT;