Jump to content

Enable i2s1 in NanoPC-T3Plus


destmaster

Recommended Posts

In the nanopcT3+ board I need to enable the I2S1 (14 pin header) in Desktop version.
I need to have the I2S1 peripheal as SLAVE and a MCLK of 48kHz and 192kHz (better if other clock speed are supported).
The "aplay -l" and "arecord -l" commands must show the I2S1 as a sound card with input ad output device.

I've tried to do the job but I'm a newbbie on linux and embedded linux. Following the official FriendlyArm wiki, on a host PC I've downloaded the kernel source, modified the dtsi file to enable i2s, recompiled the kernel and U-boot and all steps seem work fine.

Now I don't know how to do a final steps to have a SD bootable image with eflasher to load and test my distro in the NanoPC T3+ emmc.

Anyone can explain step by step (from download the source code up to flash the bootable image (also with emmcflasher inside) to SDcard) how to do to enable this feature in Desktop version of Armbian.
Thanks in advance!

Link to comment
Share on other sites

  • Tido changed the title to Enable i2s1 in NanoPC-T3Plus
4 hours ago, destmaster said:

how to do to enable this feature


Enabling I2S1 should be done similar way, but this feature was not tested on this particular board. I can just hope it works - we use more recent but also changed (to some extend) kernel for T3. You usually only need to manipulate board device tree .DTB file. You don't need to recompile kernel to manipulate hw functions. On some boards we use DT overlays, where functions are prepared and you can enable/disable even in more simple fashion.

 

Installing to eMMC https://docs.armbian.com/User-Guide_Getting-Started/#how-to-install-to-emmc-nand-sata-usb

Link to comment
Share on other sites

20 hours ago, destmaster said:
Following the official FriendlyArm wiki, on a host PC I've downloaded the kernel source, modified the dtsi file to enable i2s, recompiled the kernel and U-boot and all steps seem work fine.

Can you give a link to the FriendlyArm wiki page that you are talking about please? I don't see any instructions on modifying the dtsi on the NanoPC-T3 Plus page.

 

You can install the standard Armbian image then use `dtc` (device tree compiler) to decompile the flattened device tree .dtb somewhere under /boot/dtb, then edit the .dts, then recompile it to .dtb. This is not the only way, maybe not even the best way, but it is one way to do it. If you are lucky the Armbian .dtb already has the node for i2s1 and you can just edit a few parameters.

 

My understanding though is that it is not enough to enable the i2s, you also need a codec and to set up a simple-audio-card node. But please provide the link to the FriendlyArm wiki as this will help to be clear about what you are trying to do.

Link to comment
Share on other sites

29 minutes ago, s_frit said:

Can you give a link to the FriendlyArm wiki page that you are talking about please? I don't see any instructions on modifying the dtsi on the NanoPC-T3 Plus page.

 

You can install the standard Armbian image then use `dtc` (device tree compiler) to decompile the flattened device tree .dtb somewhere under /boot/dtb, then edit the .dts, then recompile it to .dtb. This is not the only way, maybe not even the best way, but it is one way to do it. If you are lucky the Armbian .dtb already has the node for i2s1 and you can just edit a few parameters.

 

My understanding though is that it is not enough to enable the i2s, you also need a codec and to set up a simple-audio-card node. But please provide the link to the FriendlyArm wiki as this will help to be clear about what you are trying to do.

Hi s_frit,

I've followed the instruction at http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T3#Make_Your_Own_OS_Image 

I've edited the dts file before recompile the kernel.

 

Link to comment
Share on other sites

3 hours ago, destmaster said:

I've followed the instruction at http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T3#Make_Your_Own_OS_Image 

I've edited the dts file before recompile the kernel.

 

Ok, I thought perhaps you were following some special instructions for editing the dts.

 

I am working through a similar process to enable i2s1 on the NanoPC T4. So far I am just converting and editing the dtb files in a standard Armbian install. You can also install dtbo overlays, which I think is more robust.

Link to comment
Share on other sites

On 2/5/2019 at 2:43 PM, s_frit said:

 

Ok, I thought perhaps you were following some special instructions for editing the dts.

 

I am working through a similar process to enable i2s1 on the NanoPC T4. So far I am just converting and editing the dtb files in a standard Armbian install. You can also install dtbo overlays, which I think is more robust.

Hi s_frit,

thank you for you reply.

I've used dtc to decompile, edit and recompile the dtb files. Now the i2s1 seems to be enabled; the problem that I've is that the audio card that I've added in dtb is not available... listing the audio device using "aplay -l" , "arecord -l" "cat /proc/asound/cards"  and also /proc/asound/pcm" commands not show the new peripheal..  Any suggestion ?

How I can install dtbo overlays to edit dtb in more robust way?

Link to comment
Share on other sites

Hi Destmaster, Sorry about the delay. I've been away.

 

I would check the startup log for relevant messages by running `dmesg`. If you have compiled any loadable kernel modules, check that they are being loaded by running `lsmod`.

 

It would make it easier for people to help if you say exactly what you edited in the dtb.

 

This is a good talk if you haven't seen it: https://www.youtube.com/watch?v=kb1yAt9d2k8 (ASoC: Supporting Audio on an Embedded Board, Alexandre Belloni). A a bunch of troubleshooting suggestions are given near the end.

 

 

As for device tree overlays: overlays are something you can copy to your /boot dir without having to recompile the base .dtb (and potentially they will keep working after you upgrade Armbian). However I'm not 100% sure how device tree overlays are selected on Armbian (try searching the forum). Here are some links:

A google search will give a bunch of tutorials and info on device tree overlays.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines