imx8mmini sai1 max sample rates hi sai1 connect a codecs support sample rates 768khz/32bit. SAI1-RX0 connect codec_DOUT. have no data with 768khz/32bit and L/R channels to read.but SAI1-TXFS/SAI1-TXC could output 768khz/49.152Mhz. read L/R channels with 768khz/16bit and 384khz/32bit is ok.kernel version 6.1.36. thanks. Re: imx8mmini sai1 max sample rates about codecs dts as below: sofia_0571_0-1784080120640.png run arecord cmd with "-f S32_LE -r 384000 -c 2 -d 1 test.wav" or "-f S16_LE -r 786000 -c 2 -d 1 test.wav" is ok. but run with "-f S32_LE -r 768000 -c 2 -d 1 test.wav",test.wav is NULL. Re: imx8mmini sai1 max sample rates Hello,
Could you please share your device tree configuration?
Which CODEC are you using?
Best regards. Re: imx8mmini sai1 max sample rates Hello,
If you are getting errors related to the sample rate, could be caused by clock source since it is not able to generate the necessary frequency for that sample rate.
Sometimes, is needed to use a dedicated clock source such as an external clock to get an specific sample rate.
Best regards. Re: imx8mmini sai1 max sample rates when read with 768kHz 32bit x 2 channel,SAI1_TXFS/SAI1_TXC output is ok(768khz/49.152Mhz),The codec data output pin (connect to SAI1_RX0)has data output when checked with an oscilloscope.Is it possible that imx8mmini sdma is not worKing? Re: imx8mmini sai1 max sample rates Hello,
Do you get underflow or overflow errors during testing?
Best regards. Re: imx8mmini sai1 max sample rates get kernel print errors during testing as below: [ 506.336480] [858] wait_for_avail:1936: asoc-simple-card sound-pcmdev: capture write error (DMA or IRQ trouble?) Re: imx8mmini sai1 max sample rates Hello,
Please share your dmesg:
dmesg | grep -i -E "xrun|overrun|dma|fifo|sdma|sai"
With that error log the issue could be caused by an overrun, please try to increase period and buffer size, for example:
arecord -D hw:0,0 -f S32_LE -r 768000 -c 2 --buffer-size=65536 --period-size=8192 -d 5 test.wav
Best regards. Re: imx8mmini sai1 max sample rates hi JorgeCas: thanks for your reply. the same error when increase period and buffer size. ------------------------------------ root@mx8mm:/tmp# arecord -v -D hw:0,0 -f S16_LE -r 768000 -c 2 -d 1 test.wav Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 768000 Hz, Stereo Hardware PCM card 0 'pcmdev-audio' device 0 subdevice 0 Its setup is: stream : CAPTURE access : RW_INTERLEAVED format : S16_LE subformat : STD channels : 2 rate : 768000 exact rate : 768000 (768000/1) msbits : 16 buffer_size : 131064 period_size : 16383 period_time : 21332 tstamp_mode : NONE tstamp_type : MONOTONIC period_step : 1 avail_min : 16383 period_event : 0 start_threshold : 1 stop_threshold : 131064 silence_threshold: 0 silence_size : 0 boundary : 9222809086901354496 appl_ptr : 0 hw_ptr : 0 root@mx8mm:/tmp# ls test.wav -la -rw-r--r-- 1 root root 3072044 Jul 22 22:09 test.wav root@mx8mm:/tmp# arecord -D hw:0,0 -f S32_LE -r 768000 -c 2 --buffer-size=65536 --period-size=8192 -d 5 test.wav Recording WAVE 'test.wav' : Signed 32 bit Little Endian, Rate 768000 Hz, Stereo arecord: pcm_read:2221: read error: Input/output error root@mx8mm:/tmp# dmesg | grep -i -E "xrun|overrun|dma|fifo|sdma|sai" [ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000b8400000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node vdevbuffer@b8400000, compatible id shared-dma-pool [ 0.000000] DMA [mem 0x0000000040000000-0x00000000bfffffff] [ 0.000000] DMA32 empty [ 0.000000] Policy zone: DMA [ 0.043871] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations [ 0.044176] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.044364] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.105243] iommu: DMA domain TLB invalidation policy: strict mode [ 0.195002] imx-sdma 302c0000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2 [ 0.195018] imx-sdma 302c0000.dma-controller: Falling back to sysfs fallback for: imx/sdma/sdma-imx7d.bin [ 0.199761] mxs-dma 33000000.dma-controller: initialized [ 1.996379] mmc2: SDHCI controller on 30b60000.mmc [30b60000.mmc] using ADMA [ 2.786360] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] using ADMA [ 8.812860] imx-sdma 302c0000.dma-controller: firmware found. [ 8.818748] imx-sdma 30bd0000.dma-controller: firmware found. [ 8.825901] imx-sdma 30bd0000.dma-controller: loaded firmware 4.6 [ 91.326700] [857] soc_hw_sanity_check:775: 30010000.sai-pcmdevice-codec: ASoC: pcmdevice-codec <-> 30010000.sai info: [ 91.326722] [857] soc_hw_sanity_check:777: 30010000.sai-pcmdevice-codec: ASoC: rate mask 0x154c0 [ 91.326728] [857] soc_hw_sanity_check:778: 30010000.sai-pcmdevice-codec: ASoC: ch min 2 max 8 [ 91.326734] [857] soc_hw_sanity_check:780: 30010000.sai-pcmdevice-codec: ASoC: rate min 44100 max 768000 [ 91.342776] [857] fsl_sai_set_bclk:460: fsl-sai 30010000.sai: ratio 2 for freq 24576000Hz based on clock 49152000Hz [ 91.342784] [857] fsl_sai_set_bclk:481: fsl-sai 30010000.sai: best fit: clock id=1, div=2, deviation =0 [ 91.343315] [857] dapm_update_dai_unlocked:2698: fsl-sai 30010000.sai: Update DAI routes for 30010000.sai capture [ 113.965788] [861] soc_hw_sanity_check:775: 30010000.sai-pcmdevice-codec: ASoC: pcmdevice-codec <-> 30010000.sai info: [ 113.965809] [861] soc_hw_sanity_check:777: 30010000.sai-pcmdevice-codec: ASoC: rate mask 0x154c0 [ 113.965816] [861] soc_hw_sanity_check:778: 30010000.sai-pcmdevice-codec: ASoC: ch min 2 max 8 [ 113.965822] [861] soc_hw_sanity_check:780: 30010000.sai-pcmdevice-codec: ASoC: rate min 44100 max 768000 [ 113.977610] [861] fsl_sai_set_bclk:460: fsl-sai 30010000.sai: ratio 1 for freq 49152000Hz based on clock 49152000Hz [ 113.977618] [861] fsl_sai_set_bclk:481: fsl-sai 30010000.sai: best fit: clock id=1, div=1, deviation =0 [ 113.978149] [861] dapm_update_dai_unlocked:2698: fsl-sai 30010000.sai: Update DAI routes for 30010000.sai capture [ 124.127055] [861] wait_for_avail:1936: asoc-simple-card sound-pcmdev: capture write error (DMA or IRQ trouble?) root@mx8mm:/tmp# ls test.wav -la -rw-r--r-- 1 root root 44 Jul 22 22:09 test.wav root@mx8mm:/tmp#
記事全体を表示