AN00231 SPDIF-Receive-to-I2S-output-using-ASRC x->192kHz

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Post by xlordofpainx »

Yes I am running the original project on the Multi-channel board. How can i enable console output? Button 1 does change SR but in the code there isn't an option for 192 so ones I set 192 as default I2S is is kept like that. My only way of monitoring the system is with APx. Could you point me towards how I should proceed with getting console output?


ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

Open Makefile
Add -DDEBUG_PRINT_ENABLE=1 to the XCC_FLAGS

Code: Select all

XCC_FLAGS = -O3 -g -report -DDEBUG_PRINT_ENABLE=1
LED discription you can find here:
https://www.xmos.com/download/private/A ... rc1%29.pdf
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Post by xlordofpainx »

Yes, I have that option enabled by default, but compiling,running the program does not print. The console stays blank clean
Image this is how the code use to be, but in this case you would not cycle through 192 so I added:
Image


Image I do have the same option as you in the app config.
ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

Try this
Run Configurations -> Main tab -> Target I/O options -> select xSCOPE
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Post by xlordofpainx »

Image besides that I am only hearing buzzing , no music. Thanks for the tip, also- I hadn't used this option until now.
ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

What I see with my board:
Disconnect AES cable, run program

Code: Select all

Starting I2S
SR change in lib_audio_codec - 192000
Initializing I2S to 192000Hz and MCLK to 24576000Hz
spdif rate ave=0, valid=0, i2s rate=190994, valid=0, i2s_buff=-615, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=190994, valid=0, i2s_buff=-195, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=190994, valid=0, i2s_buff=-419, fs_ratio=0x4000000, nom_fs=0x4000000
Connect AES@48k cable

Code: Select all

New rate in SRC in=1, out=5
New rate in SRC in=1, out=5
spdif rate ave=48003, valid=1, i2s rate=191999, valid=1, i2s_buff=-9, fs_ratio=0x40010B7, nom_fs=0x4000000
spdif rate ave=48003, valid=1, i2s rate=191999, valid=1, i2s_buff=-2, fs_ratio=0x3FFFCCB, nom_fs=0x4000000
spdif rate ave=48003, valid=1, i2s rate=191999, valid=1, i2s_buff=-3, fs_ratio=0x3FFFDB6, nom_fs=0x4000000
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Post by xlordofpainx »

could you send me your software? Because I have made only the adjustments that you have spoke of. I will be able to make that APx test again tomorrow and I will post the results.
ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

Are you sure you have set
#define DEFAULT_FREQ_HZ_I2S 192000 ?

non_fs in your console output is 0x1000000. It's like i2s rate is 48k.

check main.xc -> asrc() uses defines, not digital values

Code: Select all

    fs_code_t in_fs_code = samp_rate_to_code(DEFAULT_FREQ_HZ_SPDIF);  //Sample rate code 0..5
    fs_code_t out_fs_code = samp_rate_to_code(DEFAULT_FREQ_HZ_I2S);
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Post by xlordofpainx »

I just tested some other options. But setting 192 as default only gives out 182.
Image

Starting I2S
SR change in lib_audio_codec - 192000
Initializing I2S to 192000Hz and MCLK to 24576000Hz
spdif rate ave=0, valid=0, i2s rate=182360, valid=0, i2s_buff=-141, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182314, valid=0, i2s_buff=-36, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182311, valid=0, i2s_buff=-90, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182360, valid=0, i2s_buff=-146, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182314, valid=0, i2s_buff=-40, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182311, valid=0, i2s_buff=-31, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182314, valid=0, i2s_buff=-86, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182360, valid=0, i2s_buff=-141, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182311, valid=0, i2s_buff=-35, fs_ratio=0x4000000, nom_fs=0x4000000
spdif rate ave=0, valid=0, i2s rate=182314, valid=0, i2s_buff=-91, fs_ratio=0x4000000, nom_fs=0x4000000
ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

What i2s rate is when you plug correct spdif input stream?
Post Reply