IMX8M Plus - digital PDM MIC connection

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8M Plus - digital PDM MIC connection

Jump to solution
434 Views
haryanl
Contributor IV

Dear Team,

Currently we only use 1 PDM MIC SPH0655LM4H-1, but cannot record.
Is it mandatory to connect to PDM_BIT_STREAM0 first?
we are connecting to PDM_BIT_STREAM1 pin.

If we have to connect to PDM_BIT_STREAM0 first, is there any way to fix it without repairing the hardware?

haryanl_0-1704791017480.png

Thanks in advance 

Kind regards,

Tags (4)
0 Kudos
1 Solution
418 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello, I hope you are doing well.

It should not be an issue use PDM_BIT_STREAM1 and not PDM_BIT_STREAM0 first.

Is it recognized correctly?

Do you have data signals from the MIC?

Best regards.

View solution in original post

0 Kudos
6 Replies
419 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello, I hope you are doing well.

It should not be an issue use PDM_BIT_STREAM1 and not PDM_BIT_STREAM0 first.

Is it recognized correctly?

Do you have data signals from the MIC?

Best regards.

0 Kudos
415 Views
haryanl
Contributor IV

Hi JorgeCas,

I use the following command:
"arecord -Dsysdefault:CARD=imxaudiomicfil -f S32_LE -d30 -r 48000 capture.wav -vvv"

When I connect the MIC to PDM_BIT_STREAM0, I can record, save the .wav file, and replay it.

but when I connect to PDM_BIT_STREAM1, the error "Max peak (6000 samples): 0x7fffe000 #################### 99%" appears continuously. It appears that audio data is not being recorded
Is there any way to fix it?

Below is the log in 2 cases:

  • 1. connect to PDM_BIT_STREAM0:
    root@imx8mp-lpddr4-evk:~# arecord -Dsysdefault:CARD=imxaudiomicfil -f S32_LE -d30 -r 48000 capture.wav -vvv
    Recording WAVE 'capture.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Mono
    Plug PCM: Hardware PCM card 3 'imx-audio-micfil' device 0 subdevice 0
    Its setup is:
      stream       : CAPTURE
      access       : RW_INTERLEAVED
      format       : S32_LE
      subformat    : STD
      channels     : 1
      rate         : 48000
      exact rate   : 48000 (48000/1)
      msbits       : 32
      buffer_size  : 24000
      period_size  : 6000
      period_time  : 125000
      tstamp_mode  : NONE
      tstamp_type  : MONOTONIC
      period_step  : 1
      avail_min    : 6000
      period_event : 0
      start_threshold  : 1
      stop_threshold   : 24000
      silence_threshold: 0
      silence_size : 0
      boundary     : 6755399441055744000
      appl_ptr     : 0
      hw_ptr       : 0
    Max peak (6000 samples): 0x7fffe600 #################### 99%
    Max peak (6000 samples): 0x0029a000 #                    0%
    Max peak (6000 samples): 0x0035c600 #                    0%
    Max peak (6000 samples): 0x00272a00 #                    0%
    Max peak (6000 samples): 0x001ccf00 #                    0%
    Max peak (6000 samples): 0x00118700 #                    0%
    Max peak (6000 samples): 0x00151100 #                    0%
    Max peak (6000 samples): 0x0016c000 #                    0%
    Max peak (6000 samples): 0x00179b00 #                    0%
    Max peak (6000 samples): 0x00240e00 #                    0%
    Max peak (6000 samples): 0x004b4b00 #                    0%
    Max peak (6000 samples): 0x01696100 #                    1%
    Max peak (6000 samples): 0x01db8600 #                    1%
    Max peak (6000 samples): 0x02843700 #                    1%
    Max peak (6000 samples): 0x0f26a000 ###                  11%
    Max peak (6000 samples): 0x5c5a1200 ###############      72%
    Max peak (6000 samples): 0x03f88f00 #                    3%
    Max peak (6000 samples): 0x0faada00 ###                  12%
    Max peak (6000 samples): 0x7e059d00 #################### 98%
    Max peak (6000 samples): 0x201da200 ######               25%
    Max peak (6000 samples): 0x74122700 ###################  90%
    Max peak (6000 samples): 0x7ca0a200 #################### 97%
    Max peak (6000 samples): 0x7bbdb700 #################### 96%
    Max peak (6000 samples): 0x75d63500 ###################  92%
    Max peak (6000 samples): 0x7c29a300 #################### 97%
    Max peak (6000 samples): 0x7f1c0d00 #################### 99%
    Max peak (6000 samples): 0x7b097800 #################### 96%
    Max peak (6000 samples): 0x03dff200 #                    3%
    Max peak (6000 samples): 0x02bd9c00 #                    2%
    Max peak (6000 samples): 0x0222ad00 #                    1%
    Max peak (6000 samples): 0x01827100 #                    1%
    Max peak (6000 samples): 0x00ac8d00 #                    0%
    Max peak (6000 samples): 0x001a8000 #                    0%
    ^CAborted by signal Interrupt...
    Max peak (6000 samples): 0x001cd700 #                    0%
  • 2. Connect to PDM_BIT_STREAM1:
    root@imx8mp-lpddr4-evk:~# arecord -Dsysdefault:CARD=imxaudiomicfil -f S32_LE -d30 -r 48000 capture.wav -vvv
    Recording WAVE 'capture.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Mono
    Plug PCM: Hardware PCM card 2 'imx-audio-micfil' device 0 subdevice 0
    Its setup is:
      stream       : CAPTURE
      access       : RW_INTERLEAVED
      format       : S32_LE
      subformat    : STD
      channels     : 1
      rate         : 48000
      exact rate   : 48000 (48000/1)
      msbits       : 32
      buffer_size  : 24000
      period_size  : 6000
      period_time  : 125000
      tstamp_mode  : NONE
      tstamp_type  : MONOTONIC
      period_step  : 1
      avail_min    : 6000
      period_event : 0
      start_threshold  : 1
      stop_threshold   : 24000
      silence_threshold: 0
      silence_size : 0
      boundary     : 6755399441055744000
      appl_ptr     : 0
      hw_ptr       : 0
    Max peak (6000 samples): 0x7fffe500 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
    Max peak (6000 samples): 0x7fffe000 #################### 99%
0 Kudos
408 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello, 

I tried to replicate the issue, but I was not able to do it.

Maybe you could try to use plughw, such as:

arecord -D plughw:1,0 -f S32_LE -d10 -r 48000 capture.wav -vvv

Also, could you please try to with a different quality with amixer, for example:

root@imx8mpevk:~# amixer -c 1 cset name='MICFIL Quality Select' 0
numid=9,iface=MIXER,name='MICFIL Quality Select'
  ; type=ENUMERATED,access=rw------,values=1,items=6
  ; Item #0 'High'
  ; Item #1 'Medium'
  ; Item #2 'Low'
  ; Item #3 'VLow0'
  ; Item #4 'Vlow1'
  ; Item #5 'Vlow2'
  : values=0

Best regards.

0 Kudos
402 Views
haryanl
Contributor IV

Hi JorgeCas,

I tried your command, but errors appear

 

root@imx8mp-lpddr4-evk:~# amixer -c 1 cset name='MICFIL Quality Select' 0
amixer: Cannot find the given element from control sysdefault:1
root@imx8mp-lpddr4-evk:~# arecord -D plughw:1,0 -f S32_LE -d10 -r 48000 capture.wav -vvv
arecord: main:831: audio open error: No such file or directory

 

 

I then tried changing the command as follows:

 

root@imx8mp-lpddr4-evk:~# amixer  -Dsysdefault:CARD=imxaudiomicfil cset name='MICFIL Quality Select' 0
numid=9,iface=MIXER,name='MICFIL Quality Select'
  ; type=ENUMERATED,access=rw------,values=1,items=8
  ; Item #0 'Medium'
  ; Item #1 'High'
  ; Item #2 'N/A'
  ; Item #3 'N/A'
  ; Item #4 'VLow2'
  ; Item #5 'VLow1'
  ; Item #6 'VLow0'
  ; Item #7 'Low'
  : values=0

 

root@imx8mp-lpddr4-evk:~# arecord -Dsysdefault:imxaudiomicfil -f S32_LE -d10 -r 48000 capture.wav -vvv
Recording WAVE 'capture.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Mono
Plug PCM: Hardware PCM card 2 'imx-audio-micfil' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 24000
  period_size  : 6000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 6000
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 24000
  silence_threshold: 0
  silence_size : 0
  boundary     : 6755399441055744000
  appl_ptr     : 0
  hw_ptr       : 0
 
Max peak (6000 samples): 0x00fe0900 #                    0%
Max peak (6000 samples): 0x00fe0900 #                    0%
Max peak (6000 samples): 0x00fe0900 #                    0%
~~~( ellipsis)~~~~
Max peak (6000 samples): 0x00fe0900 #                    0%
Max peak (6000 samples): 0x00fe0900 #                    0%
Max peak (6000 samples): 0x00fe0900 #                    0%
root@imx8mp-lpddr4-evk:~#

 

When running record, it returns all 0%

Is there any way to fix it?
Best regards,

0 Kudos
396 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

Is sound card 1,0 of -Dplughw the same as imxaudiomicfil on your system? The -D plughw:1,0 of my example command corresponds to my list of sound cards and sub-devices detected, you should try with imxaudiomicfil as is showed on your command log of:

arecord -l

The same applies to amixer -c <your mic>

 Best regards.

0 Kudos
349 Views
haryanl
Contributor IV

Hello JorgeCas,
My Software team is trying to debug it
Thank you for your support
I would like to temporarily close this topic

Best regards,