# Arecord failed

**URL:** <https://forums.developer.nvidia.com/t/arecord-failed/189819>\
**Category:** Jetson Nano\
**Tags:** audio\
**Created:** [September 22, 2021, 7:14am UTC](https://forums.developer.nvidia.com/t/arecord-failed/189819 "2021-09-22T07:14:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rd1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rd1](https://forums.developer.nvidia.com/u/rd1)\
**Post date:** [September 22, 2021, 7:14am UTC](https://forums.developer.nvidia.com/t/arecord-failed/189819/1 "2021-09-22T07:14:08Z")

</div>

we arecord failed.  
scala@localhost:~$ arecord -Dplughw:1,0 -q -N -f S16\_LE -r 44100 -d 10 -t wav /home/scala/1111.wav  
[4940.270392] rt5640 2-001c: Unsupported clock setting 44100 for DAI 0  
[4940.276763] rt5640 2-001c: ASoC: can’t set rt5640-aif1 hw params: -22  
[4940.283966] tegra-asoc: sound: ASoC: PRE\_PMU: x AIF1 Capture-I2S4 DAP Receive event failed: -22

---

<div class="post-metadata">

**Author:** ![jonathanh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jonathanh/32/14043_2.png) [@jonathanh](https://forums.developer.nvidia.com/u/jonathanh)\
**Post date:** [September 22, 2021, 7:47am UTC](https://forums.developer.nvidia.com/t/arecord-failed/189819/3 "2021-09-22T07:47:39Z")

</div>

Hello!

Per the rt5640 driver the error comes from [here](https://nv-tegra.nvidia.com/gitweb/?p=linux-4.9.git;a=blob;f=sound/soc/codecs/rt5640.c;h=79d02c958f1cf54cc0663448cd42c7f896b27a27;hb=43744be0144f1aefb06ade8e684fe5497d557e6f#l1759). Looking at the code that it cannot find a valid divider based upon the current sysclk setting for the codec.

The first question is who is the I2S master, is it Jetson or the codec? The second question is what clock is driving the codec MCLK?

Regards,  
Jon

---

<div class="post-metadata">

**Author:** ![rd1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rd1](https://forums.developer.nvidia.com/u/rd1)\
**Post date:** [September 22, 2021, 7:52am UTC](https://forums.developer.nvidia.com/t/arecord-failed/189819/4 "2021-09-22T07:52:41Z")

</div>

How to check I2S master, I think it should be Jetson, our hardware pins used DAP4 pins.  
And MCLK used AUD\_MCLK.

---

<div class="post-metadata">

**Author:** ![jonathanh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jonathanh/32/14043_2.png) [@jonathanh](https://forums.developer.nvidia.com/u/jonathanh)\
**Post date:** [September 22, 2021, 8:31am UTC](https://forums.developer.nvidia.com/t/arecord-failed/189819/5 "2021-09-22T08:31:51Z")

</div>

Hello!

Check the device-tree [dai-link node](https://nv-tegra.nvidia.com/gitweb/?p=device/hardware/nvidia/platform/t210/porg.git;a=blob;f=kernel-dts/tegra210-porg-p3448-common.dtsi;h=bf4875be6fd9c31f7d45364bd1e2bfef3d9a2404;hb=c8cc082dbe1e000244b9c243bcc679fe63d2a5c7#l407) for the appropriate I2S interface. By default, the dai-links have ’ bitclock-slave’ and ‘frame-slave’ indicating that the codec is the slave and Jetson is the master. If this has not been changed then Jetson is the master.

If that is the case, then you need to ensure that you modify the tegra audio machine driver to configure the codec sysclk appropriate during playback/record. If you refer to the [audio documentation](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/asoc_driver.19.2.html#wwpID0E0SV0HA) you will see a chapter called ’ Update the Machine Driver to Support a Custom Audio Card’ that describes how to add an init function to program the sysclk for the codec.

Regards,  
Jon

---

<div class="post-metadata">

**Author:** ![rd1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rd1](https://forums.developer.nvidia.com/u/rd1)\
**Post date:** [September 23, 2021, 5:55am UTC](https://forums.developer.nvidia.com/t/arecord-failed/189819/6 "2021-09-23T05:55:07Z")

</div>

Thank you, we had found our problem ,the case could close!

---

<div class="post-metadata">

**Author:** ![jonathanh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jonathanh/32/14043_2.png) [@jonathanh](https://forums.developer.nvidia.com/u/jonathanh)\
**Post date:** [September 23, 2021, 6:33am UTC](https://forums.developer.nvidia.com/t/arecord-failed/189819/7 "2021-09-23T06:33:00Z")

</div>

Hello!

Great. Thanks for letting us know.

Jon

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 15, 2021, 2:59am UTC](https://forums.developer.nvidia.com/t/arecord-failed/189819/9 "2021-10-15T02:59:31Z")

</div>


