I2S output on N2

Post Reply
chaucer88
Posts: 1
Joined: Mon Jul 29, 2019 7:28 pm
languages_spoken: english
ODROIDs: N2 XU4 XU3
Has thanked: 0
Been thanked: 0
Contact:

I2S output on N2

Unread post by chaucer88 » Mon Jul 29, 2019 7:54 pm

Hi I have an application where I would like to access the I2S output on the N2 rather than the built in DAC, is this possible? The reason is I need to connect to another I2S device.

Many thanks!

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: I2S output on N2

Unread post by odroid » Tue Jul 30, 2019 11:09 am

Which I2S devices do you want to connect?

We tested TI's PCM5102 DAC output via unpopulated 7pin header on the N2 board long time ago and it worked well.
But you have to modify the Kernel configuration and device-tree files.

ponots03
Posts: 14
Joined: Thu Jul 18, 2019 11:26 pm
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 6 times
Been thanked: 0
Contact:

Re: I2S output on N2

Unread post by ponots03 » Tue Aug 06, 2019 8:47 pm

Hello, I am also interested in this. Could you provide more details regarding kernel config & device-tree modifications that are needed to enable I2S ? We want to use an external DAC on a daughter board.

thanks,

cap00k
Posts: 92
Joined: Tue May 21, 2013 10:46 am
languages_spoken: english
ODROIDs: ODROID
Has thanked: 0
Been thanked: 10 times
Contact:

Re: I2S output on N2

Unread post by cap00k » Wed Aug 14, 2019 5:28 pm

Hi
I had modified the device-tree for I2s output at 7-pin header.
It has been tested with Odroid-N2 + HiFi-Shield+.

Applies the attached file and results in "aplay -l".

Code: Select all

root@odroid:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: AMLAUGESOUND [AML-AUGESOUND], device 0: SPDIF-B-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 1: TDM-C-T9015-audio-hifi T9015-audio-hifi-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 2: SPDIF-dit-hifi dit-hifi-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 3: TDM-B-dummy dummy-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@odroid:~# 
And, run speaker-test.

Code: Select all

root@odroid:~# speaker-test -Dhw:0,3 -c 2 -t wav                                                                                                      

speaker-test 1.1.3

Playback device is hw:0,3
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 65536
Period size range from 16 to 32768
Using max buffer size 65536
Periods = 4
was set period_size = 16384
was set buffer_size = 65536
 0 - Front Left
 1 - Front Right
Time per period = 1.721603
 0 - Front Left
 1 - Front Right
Time per period = 3.070379
Attachments
odroid-n2-i2s-sound.zip
(1.22 KiB) Downloaded 51 times
These users thanked the author cap00k for the post:
ponots03 (Thu Aug 22, 2019 12:46 am)

ponots03
Posts: 14
Joined: Thu Jul 18, 2019 11:26 pm
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 6 times
Been thanked: 0
Contact:

Re: I2S output on N2

Unread post by ponots03 » Fri Nov 15, 2019 12:14 am

Hi ,

Thank you again for your posting regarding how to enable I2S on Odroid-N2 and for providing the diff file. We are having issues replicating what you posted. Please see below. Any further help to resolve this issue will be much appreciated. Do let us know if you need more information from us.

OS : Android 9
Device : Odroid-N2.

We incorporated the changes that you posted to file mesong12_odroid_common.dtsi

when we do tinymix we see only the default soundcard. We don't see any other devices.

odroidn2:/ # tinymix
Mixer name: 'AML-AUGESOUND'
Number of controls: 38
ctl type num name value
0 ENUM 1 I2SIn CLK 0
1 INT 1 TDM MCLK Fine Setting 12287994
2 ENUM 1 SPDIFIN audio samplerate N/A
3 ENUM 1 SPDIFIN Audio Type LPCM
4 ENUM 1 Audio spdif format 2 CH PCM
.
.
.


odroidn2:/ # tinymix -D 1
Failed to open mixer
19|odroidn2:/ # tinymix -D 2
Failed to open mixer
19|odroidn2:/ # tinymix -D 3
Failed to open mixer
cap00k wrote:
Wed Aug 14, 2019 5:28 pm
Hi
I had modified the device-tree for I2s output at 7-pin header.
It has been tested with Odroid-N2 + HiFi-Shield+.

Applies the attached file and results in "aplay -l".

Code: Select all

root@odroid:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: AMLAUGESOUND [AML-AUGESOUND], device 0: SPDIF-B-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 1: TDM-C-T9015-audio-hifi T9015-audio-hifi-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 2: SPDIF-dit-hifi dit-hifi-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: AMLAUGESOUND [AML-AUGESOUND], device 3: TDM-B-dummy dummy-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@odroid:~# 
And, run speaker-test.

Code: Select all

root@odroid:~# speaker-test -Dhw:0,3 -c 2 -t wav                                                                                                      

speaker-test 1.1.3

Playback device is hw:0,3
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 65536
Period size range from 16 to 32768
Using max buffer size 65536
Periods = 4
was set period_size = 16384
was set buffer_size = 65536
 0 - Front Left
 1 - Front Right
Time per period = 1.721603
 0 - Front Left
 1 - Front Right
Time per period = 3.070379

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: I2S output on N2

Unread post by odroid » Fri Nov 15, 2019 10:32 am

He tested it on Ubuntu not Android.

ponots03
Posts: 14
Joined: Thu Jul 18, 2019 11:26 pm
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 6 times
Been thanked: 0
Contact:

Re: I2S output on N2

Unread post by ponots03 » Fri Nov 15, 2019 11:46 am

I understand. Do you have guidance as to how to enable and test I2S on J7 for Android?

Thanks!

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: I2S output on N2

Unread post by odroid » Sat Nov 16, 2019 11:11 am

We are working on it.

ponots03
Posts: 14
Joined: Thu Jul 18, 2019 11:26 pm
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 6 times
Been thanked: 0
Contact:

Re: I2S output on N2

Unread post by ponots03 » Sun Nov 17, 2019 12:21 am

thanks. Could you clarify on exactly on what you are working on ?
a)The instructions OR
b) the driver/HAL for I2S on J7 on Android ?

If it is the latter there is no point for us to spend any more time on I2S till you roll out necessary SoC components.

Also can you provide a best-guess estimated completion date ?

Is it easier to enable I2S on J2 (using TDMA on GPIOX 9,10,11 ) ? Has this been fully enabled on Android ? Ideally I am looking for two channels (Tx & Rx) but could make one work.

thanks,

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: I2S output on N2

Unread post by odroid » Mon Nov 18, 2019 4:15 pm

We are trying to enable the I2S sound output driver on Android as we enabled the SPDIF output in today's update. https://wiki.odroid.com/odroid-n2/os_im ... e_20191118
It may take two or three weeks but we can't guarantee that.
We have no idea how to implement the I2S input device driver on Android though.

BTW, what do you want to make with the I2S audio feature on Android?
These users thanked the author odroid for the post:
rooted (Tue Nov 19, 2019 12:36 am)

ponots03
Posts: 14
Joined: Thu Jul 18, 2019 11:26 pm
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 6 times
Been thanked: 0
Contact:

Re: I2S output on N2

Unread post by ponots03 » Tue Nov 19, 2019 1:03 am

thank you. Looking forward to that.

The I2S requirement is being driven by our per-existing codec that has I2S channels only. Application : high-fi speaker.
I2S input also would be desired for microphone connection through the same codec.

ponots03
Posts: 14
Joined: Thu Jul 18, 2019 11:26 pm
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 6 times
Been thanked: 0
Contact:

Re: I2S output on N2

Unread post by ponots03 » Tue Dec 03, 2019 1:10 am

Hi, I am checking to see if there is any update on the I2S enablement ? If this is still work in progress, do you have a revised estimate as to when it will be ready ?
odroid wrote:
Mon Nov 18, 2019 4:15 pm
We are trying to enable the I2S sound output driver on Android as we enabled the SPDIF output in today's update. https://wiki.odroid.com/odroid-n2/os_im ... e_20191118
It may take two or three weeks but we can't guarantee that.
We have no idea how to implement the I2S input device driver on Android though.

BTW, what do you want to make with the I2S audio feature on Android?

User avatar
odroid
Site Admin
Posts: 32690
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 212 times
Been thanked: 364 times
Contact:

Re: I2S output on N2

Unread post by odroid » Tue Dec 03, 2019 8:10 am

We may need 2~3 weeks for Android framework development.
These users thanked the author odroid for the post:
ponots03 (Wed Dec 04, 2019 1:15 pm)

ponots03
Posts: 14
Joined: Thu Jul 18, 2019 11:26 pm
languages_spoken: english
ODROIDs: odroid-n2
Has thanked: 6 times
Been thanked: 0
Contact:

Re: I2S output on N2

Unread post by ponots03 » Thu Dec 05, 2019 3:43 am

Looks like I2S was enabled on the 1204 release? Is it fully enabled or still awaiting Android Framework development ?
https://wiki.odroid.com/odroid-n2/os_im ... e_20191204
"Add I2S support on 7-pin pin header and selectable in ODROID Settings"

Luke.go
Posts: 352
Joined: Mon May 30, 2016 1:55 pm
languages_spoken: english
Has thanked: 5 times
Been thanked: 11 times
Contact:

Re: I2S output on N2

Unread post by Luke.go » Thu Dec 05, 2019 10:33 am

@ponots03 Yes, You can use I2S by selecting the audio output mode as I2S.
These users thanked the author Luke.go for the post:
ponots03 (Thu Dec 05, 2019 2:27 pm)

Post Reply

Return to “Android”

Who is online

Users browsing this forum: voodik and 0 guests