PulseAudio / gstreamer not working with I2S microphone connected to Rubik Pi

According to the docs pins 12, 35 and 38 should default to the i2s clock, ws and data functions, but i’m unable to get a microphone to work when it’s connected to these pins. I’ve tried using pulseaudio, tinycap and gstreamer to make a recording, but all it records is white noise. It doesn’t matter which device I use with these programs, i always get white noise. The QCS6490 docs imply the correct device is regular2 and they give the example:

parec -v --rate=48000 --format=s16le --channels=1 --file-format=wav /opt/test.wav --device=regular2

Is there some config / device tree change that needs to be made to get i2s mics to work?

My microphone works correctly - if i connect it to the same numbered pins on a raspbery pi 5, then i can record high quality audio using arecord.

Dear customer,
May I inquire about the version of Linux you are using, or is it a different version?

Thanks for your reply kinkin, I am running Qualcomm Linux 1.3-ver.1.1

Dear customer,we are currently syncing this issue internally.

Dear customer
Please refer to the following commands for testing.

systemctl stop pulseaudio
agmcap /home/my.wav -D 100 -d 101 -r 48000 -b 16 -c 2 -i MI2S-LPAIF_AUD-TX-SECONDARY -dkv 0xA3000003

I tried the above, but it returns:

root@rubikpi:~# agmcap /home/my.wav -D 100 -d 101 -r 48000 -b 16 -c 2 -i MI2S-LPAIF_AUD-TX-SECONDARY -dkv 0xA3000003
Entry not found
Invalid input, entry not found for MI2S-LPAIF_AUD-TX-SECONDARY

I can see that device exists though:

root@rubikpi:~# cat /proc/asound/pcm
00-00: MI2S-LPAIF-TX-PRIMARY multicodec-0 :  : capture 1
00-01: MI2S-LPAIF-RX-PRIMARY multicodec-1 :  : playback 1
00-02: TDM-LPAIF-TX-PRIMARY msm-stub-aif0-tx-2 :  : capture 1
00-03: TDM-LPAIF-RX-PRIMARY msm-stub-aif0-rx-3 :  : playback 1
00-04: MI2S-LPAIF_RXTX-RX-PRIMARY msm-stub-aif0-rx-4 :  : playback 1
00-05: MI2S-LPAIF_RXTX-TX-PRIMARY msm-stub-aif0-tx-5 :  : capture 1
00-06: MI2S-LPAIF_VA-RX-PRIMARY msm-stub-aif0-rx-6 :  : playback 1
00-07: MI2S-LPAIF_VA-TX-PRIMARY msm-stub-aif0-tx-7 :  : capture 1
00-08: MI2S-LPAIF_AUD-RX-SECONDARY msm-stub-aif0-rx-8 :  : playback 1
00-09: MI2S-LPAIF_AUD-TX-SECONDARY msm-stub-aif0-tx-9 :  : capture 1

Dear customer
Please add the following content to /etc/backend_conf.xml:
<device name="MI2S-LPAIF_AUD-TX-SECONDARY" rate="48000" ch="1" bits="16" />
After the addition is complete, run the following command:

systemctl stop pulseaudio
agmcap /home/my.wav -D 100 -d 101 -r 48000 -b 16 -c 1 -i MI2S-LPAIF_AUD-TX-SECONDARY -dkv 0xA3000003

I no longer get the error from before:

root@rubikpi:~# agmcap /home/my.wav -D 100 -d 101 -r 48000 -b 16 -c 1 -i MI2S-LPAIF_AUD-TX-SECONDARY -dkv 0xA3000003
pcm_plug_open: dlopen successful for libagm_pcm_plugin.so
Capturing sample: 1 ch, 48000 hz, 16 bit
diag: Diag_LSM_Init: invoked for pid: 1548 with init_count: 0
diag:successfully connected to socket 16
diag: Diag_LSM_Init: done for pid: 1548 with init_count: 1
diag: Successfully registered commands with the driver
^CCaptured 606208 frames

But unfortunately the wav file is all null - no white noise even:

Dear customer,
In coordination with the R&D, this is a known issue that is currently anticipated to be resolved in the upcoming September release.

Thanks for the update kinkin. Any chance i could apply this fix/patch myself? Could you please let me know what time in September the release is planned for?

Dear customer,
As this issue pertains to modifications that have not yet been open-sourced, individual users may encounter difficulties. Of course, you are welcome to await the official release, which is currently scheduled for early September.

1 Like

Hi kinkin,

I’ve updated to the latest release of Qualcomm linux for the Rubik PI (Qualcomm Linux 1.5-ver.1.1), but unfortunately audio recording still doesn’t seem to work for me:

parec -v --rate=48000 --format=s16le --channels=1 --file-format=wav /opt/test.wav --device=regular2

produces white noise. If i add MI2S-LPAIF_AUD-TX-SECONDARY to backend_conf.xml and run:

agmcap /home/my.wav -D 100 -d 101 -r 48000 -b 16 -c 1 -i MI2S-LPAIF_AUD-TX-SECONDARY -dkv 0xA3000003

then i get the following error:

mixer_plugin_open: failed to open plugin, err: -131
Failed to open mixer
Captured 0 frames

Kindly execute the following test commands:
systemctl stop pulseaudio
Recording:
agmcap /opt/my.wav -D 100 -d 101 -r 48000 -b 16 -c 1 -i MI2S-LPAIF-TX-TERTIARY -dkv 0xA3000003
Playback:
agmplay /opt/my.wav -D 100 -d 100 -i MI2S-LPAIF-RX-TERTIARY

Unfortunately it seems to be the same as before where the wav file contains a header but all null data:

Have you made any modifications to the software (devicetree)? If so, please share them with us.

I haven’t made any modifications to the device tree and i am using the pre-built image for the rubik-pi (downloaded from https://thundercomm.s3.dualstack.ap-northeast-1.amazonaws.com/uploads/web/rubik-pi-3/20250905/FlatBuild_RUBIKPi-3_xx.xx_LE1.0.R.debug.FC.r001004.zip)

Could you kindly share the link to the I2S microphone you are currently using?

It’s the Adafruit I2S MEMS Microphone Breakout - ICS-43434. It works when connected to the same numbered pins on my raspberry pi 5, see: Raspberry Pi Wiring & Test | Adafruit I2S MEMS Microphone Breakout | Adafruit Learning System

Code modifications are required to support this device.
Could you have an environment available for modifying, building, and debugging?

Do you mean the one described here: Yocto Project User Guide | RUBIK Pi Documentation ?