1 1
destmaster

Enable i2s1 in NanoPC-T3Plus

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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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.

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1