I2S Slave mode for N2/N2+

Post Reply
Nik76
Posts: 10
Joined: Mon Jan 04, 2021 12:41 pm
languages_spoken: english
ODROIDs: C2, C4, N2+
Has thanked: 6 times
Been thanked: 1 time
Contact:

I2S Slave mode for N2/N2+

Post by Nik76 »

Dear Odroid team,
Could you please help with enabling slave mode for I2S output of N2+?

I'm using N2+ as a digital source for Hi-End audio system.
The DSP in my system is locked to 96KHz samle rate and could feed high precision SCLK and LRCK clocks to external sources.

Major N2+ advantage is high speed Cortex A73 cores which could handle advanced sample rate convertors (i.e. libsamplerate) with highest quality settings.
A53 corest have just not enough processing power to handle that.

The plan is to feed high precision external I2S clocks to N2+ (SCLK and LRCK) to get jitter-free digital output.
According to Amlogic S922X Data Sheet, I2S output should work with both internal (master mode) and external (slave mode) clock sources.
As far as I unerstood the Data Sheet, the same S922X pins used for SCLK and LRCK output might be switched to input mode and receive clocks from external generators.
So, with proper software changes, I should be able to connect external clock generators to J7 pins 5-6 and get time-perfect data from pin 7

Any help with enabling external clocks for I2S output would be greatly appreciated.
There's a significant audiophile community looking for modern SBC with I2S slave mode enabled and N2+ looks like a best fit.

Thanks in advance!

brad
Posts: 1421
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 128 times
Been thanked: 208 times
Contact:

Re: I2S Slave mode for N2/N2+

Post by brad »

I did some looking at this myself and might be able to possibly assist with some configuration to enable a test on a mainline kernel. Could you provide some more information

- What would you be using as MCLK? ie do you need to source this from the N2?
- Which formats are being used on the I2S interface (pcm, I2S, left or right justified)
- How many channels?
- Can you provide a datasheet for the chip / device being connecting to?

My testing at the moment is on the C4 in master mode (which is very similar) and no issues outputting 24 bit (probably even 32 bit) at 192Khz, there are some things to change to test slave mode which would need a test and I don't have the high end hardware you do but I can try with a lower end device maybe for a test setup. I have an N2 & N2+ also but would have to solder in some header pins to test.
These users thanked the author brad for the post:
Nik76 (Wed Apr 21, 2021 9:48 am)

Nik76
Posts: 10
Joined: Mon Jan 04, 2021 12:41 pm
languages_spoken: english
ODROIDs: C2, C4, N2+
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: I2S Slave mode for N2/N2+

Post by Nik76 »

Thanks a lot for contribution, brad

I'm using ADAU 1445 DSP with standard I2S data input format as follows.
Image

MCLK is generated externally and I don't need it from N2.
Whole idea is to avoid any clocks generated by Odroid in I2S data path.

Two channels is enough and external clocks are locked at 96 KHz.
Odroid's audio outbut will be resampled to 96KHz by lisbamplerate to match external clocks.

Here's the link to ADAU 1445 datasheet https://www.analog.com/media/en/technic ... 5_1446.pdf

brad
Posts: 1421
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 128 times
Been thanked: 208 times
Contact:

Re: I2S Slave mode for N2/N2+

Post by brad »

Will have a look over the next few days and see what I can work out. BTW the resampling can be done in hardware I think so probably no need to use software and CPU for mainline kernel. Additionally clocks seem very accurate (but I don't have accurate oscilloscope to check this)
These users thanked the author brad for the post:
Nik76 (Fri Apr 23, 2021 7:48 am)

Nik76
Posts: 10
Joined: Mon Jan 04, 2021 12:41 pm
languages_spoken: english
ODROIDs: C2, C4, N2+
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: I2S Slave mode for N2/N2+

Post by Nik76 »

Great, thanks a lot, brad!
I'm aware about hardware resampling, but usually its quality is inferior to advanced software resamplers like libsamplerate.

Correct, Odroid clocks are quite good and much more accutate than ones on vast majority of other SBCs (I tried tons of them).
Hovewer it's still generated by PLLs and cannot match high precision clocks from HQ audio gear.

I have Beaglebone setup in I2S slave mode clocked externally. Quality wise it sounding much better than any SBC in I2S master mode.
Beaglebone is obviously outdated and N2+ looks like a perfect replacement.
These users thanked the author Nik76 for the post:
brad (Fri Apr 23, 2021 9:30 am)

brad
Posts: 1421
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 128 times
Been thanked: 208 times
Contact:

Re: I2S Slave mode for N2/N2+

Post by brad »

just letting you I'm still looking at this although I don't have much to test with. Do you have master clock to input to the Odroid as well as the bitclock and frame clock?
These users thanked the author brad for the post:
Nik76 (Thu May 06, 2021 4:17 am)

Nik76
Posts: 10
Joined: Mon Jan 04, 2021 12:41 pm
languages_spoken: english
ODROIDs: C2, C4, N2+
Has thanked: 6 times
Been thanked: 1 time
Contact:

Re: I2S Slave mode for N2/N2+

Post by Nik76 »

Hi brad,
Thanks for update, great to know that you're on it.
Yes, I can supply external master clock (128FS) in addition to bitclock and frame clock.
Kindly let me know if any other inputs might help.

P. S. I'll gladly do some testing on my side if that would help you.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 3 guests