Jump to content

I2S activation


gordian

Recommended Posts

Hello, 

 

I'd like to use I2S output on my A20, I can see on armbian website 

 

 

 

Enabled audio devices: analog, HDMI, spdif and I2S (if wired and enabled in HW configuration)

 

but I have no idea on how to activate the HW configuration.

 

I tried to simply plug i2s input and output and type aplay -l but the system can't see any soundcard

 

Can you please help ?

 

Cheers

 

 

 

Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

You need to enable it in .fex configuration. It's enabled by default on Cubietruck, but on BananaPRO you need to use bananapipro.fex and activate it.

 

https://github.com/igorpecovnik/lib/blob/second/config/bananapipro.fex#L943

[i2s_para]
i2s_used = 1
i2s_channel = 2
i2s_mclk = port:PB05<2><1><default><default>
i2s_bclk = port:PB06<2><1><default><default>
i2s_lrclk = port:PB07<2><1><default><default>
i2s_dout0 = port:PB08<2><1><default><default>
i2s_dout1 =
i2s_dout2 =
i2s_dout3 =
i2s_din = port:PB12<2><1><default><default>

Note that I2S is not wired to connector on all A20 boards. I know that Banana PRO and Cubietruck works.

Link to comment
Share on other sites

thanks for your lightspeed reply  :)

 

I feel a bit stupid but I can't find any .fex file in my system

 

edit :

tried Vanilla and Legacy kernel and I can't find any .fex file anywhere that is maybe part of the problem

You must convert /boot/script.bin to fex by bin2fex tool, edit and convert back by fex2bin tool.

What device do you want to connect? I have piface with LCD display, which is also connected by SPI (MCP23s17 expander), I tried it some time before with my R1, but without success. If you will make SPI working, post your experiences here, please :)

Link to comment
Share on other sites

Hello Igor,

 

I managed to install your image on nand Lime2, as well edited the .bin file to enable I2S.

 

When I play a wav track with a aplay, following error occurs:

 

[iIS] dma trigger start

[iIS] 0x01c22400+0x24 = 0x91, line= 256

aplay: pcm_write:1710: [write error: Input/output error

[iIS] dma trigger stop

 

Any idea what could be the cause ?

 

Kindregards

drummer44

Link to comment
Share on other sites

Hi Igor,

 

ok, after remapping in script.bin to i2s_dout0 and PB08 it seems to be gone.

 

Yet, if I now play a 192kHz 24bit WAV file the output in aplay shows only 'signed 16 bit Little Endian, Rate 192kHz, Stereo.

 

Playing the same song in 24 bit 192 kHz m4a format outputs 'unsigned 8 bit, Rate 8kHz, Mono ... Any ideas ?

Was the iis driver not supposed to enable 24 bit as well ?

 

Q- are u using Nikkovs kernel patch to enable sunxi7 soc or which do you use ?

 

http://www.cubieforums.com/index.php/topic,1081.30.html

 

Do we need to write a new kernel driver file in order to enable ALL 3 I2S channels accordingly.

Why: Want to use lime2 as 2-way digital crossover - hence 4 channels needed ....

 

Yet when I look at all available kernel patches, only 2 iis channels are enabled and only one i2s line om A20.

 

Wouls highly appreciate any thoughts.

 

Thank you

drummer44

Link to comment
Share on other sites

Hi,

 

Info/update:

 

if I disable sunxi-codec - the onboard DAC - in script.bin and only enable the sunxi-sndi2s, the above mentioned DMA and Pcm error occurs.

This is independent, to which i2s line on A20 I map ... Unfortunately ....

 

so, eihter way, the 24 bit challenge remains.

My assumption that nikkovs a20 i2s patch would be needed ...

Kind regards

drummer44

Link to comment
Share on other sites

Hi Igor,

wow, quite a response time. Many thanks :),

 

So, do we have an understanding, that i2s only works with nikkovs patch ? Yes/no ?

Or did somebody successfully connect and play a i2s dac to your current sunxi i2s driver version ?

 

My strong assumption is, that your wonderfull image would only work for i2s on a20 with this part merged:

 

https://github.com/nikkov/linux-sunxi/tree/dan-3.4.106/sound/soc/sunxi/i2splus the patches described the mentioned thread ...

 

Ok, any plans to merge nikkovs stuff into you line soon ?

 

If not, any good tips how I could merge myself into your mainline, where is your repo located ?

 

Kind regards

drummer44

Link to comment
Share on other sites

I2S works with current driver which is from Nikkov. Working is confirmed by some people. (I don't have I2S hw)

 

https://github.com/dan-and/linux-sunxi

I am using this repo together with Daniel. He is working mostly on official patches, me unofficial.

 

No idea when things will be merged ... it's one of the small / not urgent tasks.

 

Help is always welcome!  :)

Link to comment
Share on other sites

Hi Igor,

Ok.

 

Do you have links available in this forum to "some people ..." that reported i2s works for them ?

 

Their experience would sure help to hunt this pcm error down .... :).

 

"Help is always welcome" - how do you see this welcome in detail ? Requests on github, own branches, kernel versions ?

Can you be a little bit explicit ?

 

Thank you and kind regards.

Link to comment
Share on other sites

http://www.lemaker.org/forum.php?mod=viewthread&tid=11807&extra=page%3D1&page=2

http://forum.armbian.com/index.php/topic/147-i2s-force-mclk/?hl=sound

 

Help. Request on github or prepared patch against my branch ... For me is just a little more work than replaying to this post but it helps ;)

 

I am having a selection of patches which eventually are merged but until then, they are here:

https://github.com/igorpecovnik/lib/tree/second/patch

Link to comment
Share on other sites

Hello

 

for me i2s working fantastic in olinuxino micro - in lime2 unfortunetly no -h/w problems ? check my post at olimex board

Armbian_4.2_Micro_Debian_wheezy_3.4.108

 

for micro:

 

1. configure fex

[i2s_para]
i2s_used = 1
i2s_channel = 2
i2s_mclk = port:PB05<2><1><default><default>
i2s_bclk = port:PB06<2><1><default><default>
i2s_lrclk = port:PB07<2><1><default><default>
i2s_dout0 = port:PB08<2><1><default><default>
i2s_dout1 =
i2s_dout2 =
i2s_dout3 =
i2s_din = port:PB12<2><1><default><default>

2. add modules to /etc/modules

sndspdif 
sunxi-sndspdif 
sunxi-spdif  
sunxi-spdma

3. reboot :)

 

after this you can check your audio card

root@micro:~# cat /proc/asound/cards
 0 [sunxicodec     ]: sunxi-CODEC - sunxi-CODEC
                      sunxi-CODEC  Audio Codec
 1 [sunxisndspdif  ]: sunxi-sndspdif - sunxi-sndspdif
                      sunxi-sndspdif
 2 [sunxisndi2s    ]: sunxi-sndi2s - sunxi-sndi2s
                      sunxi-sndi2s

 0 = analog output

 1 = spdif

 2 = i2s

 

important that i2s working for me only in configuration 48KHZ and 44.1 KHz

 

i have tested it using

Digilent PmodI2S (CS4344)

My own board CS4351

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