I2S INPUT on C2

Moderators: odroid, mdrjr

I2S INPUT on C2

Unread postby elium » Tue Sep 04, 2018 6:40 pm

Hi,

I use the odroid-c2_rev0.2 Board with Buildroot Linux.
Now I should implement I2S audio capture on C2.

So, I have some questions on the topic:
1. Is I2S INPUT possible with C2 (i.e. with default ODROID-C2 DTS inside buildroot)?
2. Is I2S INPUT (capture) supported by amlogic sound drivers?
3. Which pins should be used for I2S INPUT (DATA_IN, LR_CLK, BCLK) ?
4. Is it possible (and how) to configure I2S INPUT either as slave or master?

Thanks in advance.
elium
 
Posts: 12
Joined: Sat Dec 24, 2016 7:55 pm
languages_spoken: english
ODROIDs: ODROID-C2

Re: I2S INPUT on C2

Unread postby tobetter » Tue Sep 04, 2018 6:56 pm

elium wrote:Hi,

I use the odroid-c2_rev0.2 Board with Buildroot Linux.
Now I should implement I2S audio capture on C2.

So, I have some questions on the topic:
1. Is I2S INPUT possible with C2 (i.e. with default ODROID-C2 DTS inside buildroot)?
2. Is I2S INPUT (capture) supported by amlogic sound drivers?
3. Which pins should be used for I2S INPUT (DATA_IN, LR_CLK, BCLK) ?
4. Is it possible (and how) to configure I2S INPUT either as slave or master?

Thanks in advance.

From my understanding, maybe not accurate for your requirements, technically I2S pin header on ODROID-C2 can be muxed as I2S input but it's not been tested by HK team. Also the I2S driver source/soc/aml/m8/aml_pcm_dai.c can capture the audio stream if the board is properly configured.
User avatar
tobetter
 
Posts: 2555
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: I2S INPUT on C2

Unread postby elium » Tue Sep 04, 2018 8:14 pm

Should I use pins from J7 Header for I2S INPUT :
GPIOAO.BIT6 -> I2S_IN
GPIOAO.BIT8 -> I2S_MCLK
GPIOAO.BIT9 -> I2S_BCLK
GPIOAO.BIT10 -> I2S_LRCK
am I right?

Also what modifications are required to get the proper board configuration for I2S driver capture?
Do you mean some DTS changes?
elium
 
Posts: 12
Joined: Sat Dec 24, 2016 7:55 pm
languages_spoken: english
ODROIDs: ODROID-C2

Re: I2S INPUT on C2

Unread postby tobetter » Wed Sep 05, 2018 10:46 am

elium wrote:Should I use pins from J7 Header for I2S INPUT :
GPIOAO.BIT6 -> I2S_IN
GPIOAO.BIT8 -> I2S_MCLK
GPIOAO.BIT9 -> I2S_BCLK
GPIOAO.BIT10 -> I2S_LRCK
am I right?

According to the datasheet, it is.
Also what modifications are required to get the proper board configuration for I2S driver capture?
Do you mean some DTS changes?

I am not sure since I haven't tried yet.
User avatar
tobetter
 
Posts: 2555
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: I2S INPUT on C2

Unread postby odroid » Wed Sep 05, 2018 10:51 am

One user successfully configured the I2S input after changing the device-tree file. He could record the sound from UDA1380 CODEC on the J7 header.
viewtopic.php?f=139&t=20413#p143235
User avatar
odroid
Site Admin
 
Posts: 29067
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: I2S INPUT on C2

Unread postby brad » Wed Sep 05, 2018 11:39 am

odroid wrote:One user successfully configured the I2S input after changing the device-tree file. He could record the sound from UDA1380 CODEC on the J7 header.
viewtopic.php?f=139&t=20413#p143235


To extend the uda1380 implementation for the Odroid C2 I am trying to produce a machine driver for 4.18.x kernel which would include input / output I2S and control of the UDA1380 via I2C. Its based on onno of the WIP Meson audio-core at Jerome Brunet's git https://github.com/jeromebrunet/linux/t ... n/gx-audio

Trying to work out the clocks and divisors requirements at the moment for bit and word clocks and also separating the device from the HDMI I2S for compatibility.

Im looking to support capture and playback channels to see how they perform. I will be spending a few more hours on it later today.
brad
 
Posts: 731
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2 N1

Re: I2S INPUT on C2

Unread postby brad » Sun Sep 09, 2018 2:37 pm

Still trying to get mainline kernel i2c to control a simple uda1380 I2S board and in my journey I came across code being implemented for the meson-axg platform with what seems full linux audio support. I want a board with A11x family soc in it exposing those IO's! Hopefully Jerome Brunet who is implementing the drivers for the axg can continue the good work for gxbb which is what the C2 is.

In the meantime I will configure a pcm5102 driver manually for input and output as I can control the uda1380 via i2cset commands.
brad
 
Posts: 731
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2 N1

Re: I2S INPUT on C2

Unread postby brad » Thu Sep 13, 2018 5:26 pm

In regards to the audio being implemented for mainline kernel, the i2s output interface is mmap'able and appears to work well with jackd sound server :) now to try to define a capture device for i2s input and test the same (and also the additional i2s output channel on the 40pin header)
brad
 
Posts: 731
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2 N1

Re: I2S INPUT on C2

Unread postby odroid » Thu Sep 13, 2018 6:12 pm

Great news! :o
Did you try @scpcom's Kernel 4.18.7 for testing the jackd?
viewtopic.php?f=135&t=22717&start=900#p233591
User avatar
odroid
Site Admin
 
Posts: 29067
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: I2S INPUT on C2

Unread postby brad » Fri Sep 14, 2018 4:47 pm

odroid wrote:Great news! :o
Did you try @scpcom's Kernel 4.18.7 for testing the jackd?
viewtopic.php?f=135&t=22717&start=900#p233591


Not as yet, something seems odd at the moment in the i2s output, I plugged the output into a stereo to really test out the quality and it kind of sounds like it is playing through an old 1960's radio. The HDMI seems the same so I don't think the i2s output format is correctly set at the moment. Investigating this for the moment.
brad
 
Posts: 731
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2 N1

Re: I2S INPUT on C2

Unread postby brad » Sun Sep 16, 2018 7:52 pm

brad wrote:Not as yet, something seems odd at the moment in the i2s output, I plugged the output into a stereo to really test out the quality and it kind of sounds like it is playing through an old 1960's radio. The HDMI seems the same so I don't think the i2s output format is correctly set at the moment. Investigating this for the moment.


After some hours of trial and error, radical experimentation and hacking various parameters I now have almost perfect I2S output on the uda1380. In the end it was very simple, invert the AOCLK in the clk control!!!!!

The not quiet perfect part is a few lost bits in my left hand speaker every now and then which I can just hear so ill try see if I can solve this now.
brad
 
Posts: 731
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2 N1

Re: I2S INPUT on C2

Unread postby brad » Mon Sep 17, 2018 6:20 pm

brad wrote:The not quiet perfect part is a few lost bits in my left hand speaker every now and then which I can just hear so ill try see if I can solve this now.


Well that seems to be related to my 20cm dupoint wires, the clocks ones are picking up some interference. I want to now try see if I can get some audio in working.

Ill produce and post a testing patch in mainline kernel thread for some testing of I2S output on various devices viewtopic.php?f=135&t=22717
brad
 
Posts: 731
Joined: Tue Mar 29, 2016 1:22 pm
Location: Australia
languages_spoken: english
ODROIDs: C2 N1


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 3 guests