i.MX8M Mini PDM SNR issue

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

i.MX8M Mini PDM SNR issue

2,926 Views
m_c
Senior Contributor I

Customer modified the definition of OSR in fsl_micfil.h from 0 to 8 as below to let PDM clock worked at 3.072MHz when recording by 48KHz sampling rate.

#define MICFIL_CTRL2_OSR_DEFAULT  (8 << MICFIL_CTRL2_CICOSR_SHIFT)

 

Customer also set “MICFIL Quality Select” to 1 and all “CH? Gain” to 15 , but recording SNR becomes to very low.

 

Read back MICFIL Control register 2:

root@imx8mmevk:/usr# /unit_tests/memtool -32 0x30080004 1

E

Reading 0x1 count starting at address 0x30080004

 

0x30080004:  02080010

How to improve recording quality?

Labels (1)
0 Kudos
Reply
6 Replies

1,997 Views
aldo_ricci
Contributor I

Hi, 

I think I have a similar problem. I'm trying to record 4 PDM mics, but I'm getting a very big DC-offset in the acquired data:

aldo_ricci_0-1632219475953.png

I have enabled DC remover control via alsamixer, and double checked that the applied register value is correct. Unfortunately, the DC offset does not change. Do you have any idea why?

 

Thanks

0 Kudos
Reply

2,457 Views
igorpadykov
NXP Employee
NXP Employee

Hi m.c.

for quality one can check PDM registers value and compare with

Table 13-57. Quality Modes i.MX 8M Mini Applications Processor Reference Manual

also may be useful to look at Table 7-9. PDM Microphone controls attached Linux Manual

and pdm unit test

mxc_pdm_test\test - imx-test - i.MX Driver Test Application Software 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

2,457 Views
m_c
Senior Contributor I

Customer verify settings as below.

root@imx8mmevk:/usr/share/sounds/alsa# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: imxaudiomicfil [imx-audio-micfil], device 0: micfil hifi snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: pcm1862audio [pcm1862-audio], device 0: Audio pcm1862.1-004a-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

root@imx8mmevk:/usr/share/sounds/amixer -c 1 cset name='MICFIL Quality Select' 1
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=1

root@imx8mmevk:/usr/share/sounds/alsa# amixer -c 1 cget name='CH0 Gain'
numid=1,iface=MIXER,name='CH0 Gain'
; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
: values=15
| dBscale-min=0.00dB,step=1.00dB,mute=0

root@imx8mmevk:/usr/share/sounds/alsa# amixer -c 1 cget name='CH1 Gain'
numid=2,iface=MIXER,name='CH1 Gain'
; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
: values=15
| dBscale-min=0.00dB,step=1.00dB,mute=0

root@imx8mmevk:/usr/share/sounds/alsa# amixer -c 1 cget name='CH2 Gain'
numid=3,iface=MIXER,name='CH2 Gain'
; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
: values=15
| dBscale-min=0.00dB,step=1.00dB,mute=0

root@imx8mmevk:/usr/share/sounds/alsa# amixer -c 1 cget name='CH3 Gain'
numid=4,iface=MIXER,name='CH3 Gain'
; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
: values=15
| dBscale-min=0.00dB,step=1.00dB,mute=0

root@imx8mmevk:/usr/share/sounds/alsa# amixer -c 1 cget name='CH4 Gain'
numid=5,iface=MIXER,name='CH4 Gain'
; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
: values=15
| dBscale-min=0.00dB,step=1.00dB,mute=0

root@imx8mmevk:/usr/share/sounds/alsa# amixer -c 1 cget name='CH5 Gain'
numid=6,iface=MIXER,name='CH5 Gain'
; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
: values=15
| dBscale-min=0.00dB,step=1.00dB,mute=0

root@imx8mmevk:/usr/share/sounds/alsa# amixer -c 1 cget name='Clock Source'
numid=16,iface=MIXER,name='Clock Source'
; type=ENUMERATED,access=rw------,values=1,items=4
; Item #0 'Auto'
; Item #1 'AudioPLL1'
; Item #2 'AudioPLL2'
; Item #3 'ExtClk3'
: values=0

root@imx8mmevk:/usr/share/sounds/alsa# arecord -Dhw:1,0 -r 48000 -f S16_LE -c 6 > 48:3.072M.wav
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 6

0 Kudos
Reply

2,457 Views
igorpadykov
NXP Employee
NXP Employee

pdm frequency settings are tightly linked to each other, so one can recheck its

requirements given on

pastedImage_1.jpg

Best regards
igor

0 Kudos
Reply

2,457 Views
m_c
Senior Contributor I

that’s why change #define MICFIL_CTRL2_OSR_DEFAULT (8 << MICFIL_CTRL2_CICOSR_SHIFT)
to let PDM clock works at 3.072MHz when we record in 48KHz. The SNR is bad.

But If change back #define MICFIL_CTRL2_OSR_DEFAULT (0 << MICFIL_CTRL2_CICOSR_SHIFT)
The PDM clock works at 3.072MHz when we recording in 24KHz. The result is good for us.

0 Kudos
Reply

2,457 Views
igorpadykov
NXP Employee
NXP Employee

there are no guidelines how set good SNR and explanation why its is bad

on some settings. There are quite complicated digital filterings and there is no

formula how achieve good SNR and high volume. All such settings can be found

experimentally. Linux Manual and Demo Image just gives some tested PDM configurations

which seem work well,

Best regards
igor