Issue with -DI2S_CHANS_PER_FRAME=16 for TDM16

New to XMOS and XCore? Get started here.
dtns
Member++
Posts: 17
Joined: Sun Sep 01, 2024 6:05 pm

Issue with -DI2S_CHANS_PER_FRAME=16 for TDM16

Post by dtns »

I am currently working on a design which is using an AK5538 in TDM16 / TDM512 mode (fs*512) in chained mode.
A 1st AK5538 is filling the first 8 slots, a 2nd one the last ones.

If I set DI2S_CHANS_PER_FRAME=16 and -DXUA_PCM_FORMAT=XUA_PCM_FORMAT_TDM, the USB Host will simply hang and I will not see any clocks on my logic analyzer besides MCLK (BCK and LRCK are gone).
User avatar
lukehatpadl
Active Member
Posts: 37
Joined: Sat Jul 08, 2023 5:15 am

Post by lukehatpadl »

I can't speak to the USB stack (as I'm unfamiliar with it), but TDM16 at 48k is definitely possible with XS2.
User avatar
Ross
Verified
XCore Legend
Posts: 1154
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

is xcore slave or master?

Check all clocks are present and correct

Need more information to debug really, we expect this to work (though it's an unvalidated configuration)

Provide the output from xrun --dumpstate binary.xe, this might give us something to go on
Technical Director @ XMOS. Opinions expressed are my own
dtns
Member++
Posts: 17
Joined: Sun Sep 01, 2024 6:05 pm

Post by dtns »

I am using a XUF216-512-TQ128-C20A and it is I2S Master. I have 2 Crystal Oscillators on board besides the system xtal:
24.576MHZ
22.5792MHZ

In TDM8 mode I can see the clocks, in I2S mode as well, but not TDM16/512
User avatar
Ross
Verified
XCore Legend
Posts: 1154
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

If no clocks are present it might be the device has trapped. My guess would be running over the end of an array due to I2S_CHANS_PER_FRAME=16 being larger than the channel count maybe.

As I say, just a guess. if you run xrun --dumpstate <binary_name>.xe and take a look at the state of the XUA_AudioHub() task that should give some insight. If ET (exception type) is non-zero that would spell trouble.
Technical Director @ XMOS. Opinions expressed are my own
dtns
Member++
Posts: 17
Joined: Sun Sep 01, 2024 6:05 pm

Post by dtns »

I was finally able to dump the state with -DXUA_PCM_FORMAT=XUA_PCM_FORMAT_TDM -DI2S_CHANS_PER_FRAME=16

Code: Select all

reset post-attach
Done.

***** Active Cores *****
  Id   Target Id            Frame 
* 1.1  tile[0] core[0] (hw) 0x00040810 in ?? ()
  2.1  tile[1] core[0] (hw) 0x00043628 in ?? ()
  2.2  tile[1] core[1] (hw) 0x000412f0 in ?? ()
  2.3  tile[1] core[2] (hw) 0x00040bd0 in ?? ()
  2.4  tile[1] core[3] (hw) 0x000400aa in ?? ()
  2.5  tile[1] core[4] (hw) 0x000421cc in ?? ()

Thread 2.5 (tile[1] core[4] (hw)):

***** Call Stack *****
#0  0x000421cc in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x421cc:     ldap (lu10)     r11, 0xac
   0x421d0:     nop (0r)        
   0x421d2:     ldw (ru6)       r3, sp[0x2b]
   0x421d4:     setv (1r)       res[r3], r11
   0x421d6:     nop (0r)        

***** Registers *****
r0             0x4c4fc             312572
r1             0x4c3fc             312316
r2             0x0                 0
r3             0x80030902          -2147284734
r4             0x0                 0
r5             0x80030b02          -2147284222
r6             0x0                 0
r7             0x7ec90             519312
r8             0x80031402          -2147281918
r9             0x4c3fc             312316
r10            0x4c4fc             312572
r11            0x42430             271408
cp             0x47248             0x47248
dp             0x477c8             0x477c8
sp             0x7ec10             0x7ec10
lr             0x42389             0x42389
pc             0x421cc             0x421cc
sr             0x100               256
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x80031102          -2147282686
sed            0x0                 0
kep            0x40080             0x40080
ksp            0x0                 0x0

Thread 2.4 (tile[1] core[3] (hw)):

***** Call Stack *****
#0  0x000400aa in ?? ()
#1  0x000453f4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x400aa:     waiteu (0r)      *
   0x400ac:     entsp (u6)      0x2
   0x400ae:     bl (lu10)       0x3217
   0x400b2:     ldw (lru6)      r4, cp[0x97]
   0x400b6:     bf (ru6)        r4, 0x6

***** Registers *****
r0             0x80100             524544
r1             0x7eaf0             518896
r2             0x80000             524288
r3             0x4bbc0             310208
r4             0x0                 0
r5             0x4ba80             309888
r6             0x3334              13108
r7             0x20                32
r8             0x10                16
r9             0xa001              40961
r10            0x3                 3
r11            0x9                 9
cp             0x47248             0x47248
dp             0x477c8             0x477c8
sp             0x7e498             0x7e498
lr             0x45601             0x45601
pc             0x400aa             0x400aa
sr             0xf9                249
spc            0x453f4             0x453f4
ssr            0x19b               411
et             0x14                ET_ILLEGAL_RESOURCE (DI Resource Lane)
ed             0x7eaf0             518896
sed            0x10400             66560
kep            0x40080             0x40080
ksp            0x0                 0x0

Thread 2.3 (tile[1] core[2] (hw)):

***** Call Stack *****
#0  0x00040bd0 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x40bd0:     testct (2r)     r1, res[r1] *
   0x40bd2:     nop (0r)        
   0x40bd4:     bt (lru6)       r1, 0xb
   0x40bd8:     nop (0r)        
   0x40bda:     ldw (2rus)      r1, r0[0x2]

***** Registers *****
r0             0x4bbc0             310208
r1             0x80030702          -2147285246
r2             0x7eaec             518892
r3             0xffffffff          -1
r4             0x7eb8c             519052
r5             0x80031502          -2147281662
r6             0x7eb8c             519052
r7             0x7ff28             524072
r8             0x0                 0
r9             0x0                 0
r10            0x0                 0
r11            0x0                 0
cp             0x47248             0x47248
dp             0x477c8             0x477c8
sp             0x7eae8             0x7eae8
lr             0x451d9             0x451d9
pc             0x40bd0             0x40bd0
sr             0x140               320
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x0                 0
sed            0x0                 0
kep            0x40080             0x40080
ksp            0x0                 0x0

Thread 2.2 (tile[1] core[1] (hw)):

***** Call Stack *****
#0  0x000412f0 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x412f0:     bf (lru6)       r1, 0xea
   0x412f4:     clrsr (lu6)     0x2
   0x412f8:     stw (lru6)      r7, dp[0x12f5]
   0x412fc:     ldw (lru6)      r0, dp[0x12f8]
   0x41300:     stw (lru6)      r0, dp[0x549]

***** Registers *****
r0             0x0                 0
r1             0x0                 0
r2             0x4ba84             309892
r3             0x0                 0
r4             0x80030002          -2147287038
r5             0x0                 0
r6             0x4b6a8             308904
r7             0x0                 0
r8             0xbb80              48000
r9             0x1                 1
r10            0x38c               908
r11            0x0                 0
cp             0x47248             0x47248
dp             0x477c8             0x477c8
sp             0x7ecf0             0x7ecf0
lr             0x415b5             0x415b5
pc             0x412f0             0x412f0
sr             0x102               258
spc            0x412e4             0x412e4
ssr            0x102               258
et             0x0                 ET_NONE
ed             0x0                 0
sed            0x0                 0
kep            0x40080             0x40080
ksp            0x47890             0x47890

Thread 2.1 (tile[1] core[0] (hw)):

***** Call Stack *****
#0  0x00043628 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x43628:     waiteu (0r)      *
   0x4362a:     nop (0r)        
   0x4362c:     in (2r)         r0, res[r10] *
   0x4362e:     nop (0r)        
   0x43630:     setc (ru6)      res[r6], 0x1 *

***** Registers *****
r0             0x80030302          -2147286270
r1             0x765e929           124119337
r2             0x7fffffff          2147483647
r3             0x0                 0
r4             0x0                 0
r5             0x2                 2
r6             0x10c00             68608
r7             0x0                 0
r8             0x0                 0
r9             0x2                 2
r10            0x1                 1
r11            0x436c8             276168
cp             0x47248             0x47248
dp             0x477c8             0x477c8
sp             0x7edf0             0x7edf0
lr             0x43835             0x43835
pc             0x43628             0x43628
sr             0x141               321
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x1                 1
sed            0x0                 0
kep            0x40080             0x40080
ksp            0x0                 0x0

Thread 1.1 (tile[0] core[0] (hw)):

***** Call Stack *****
#0  0x00040810 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x40810:     in (2r)         r8, res[r9] *
   0x40812:     nop (0r)        
   0x40814:     bitrev (2r)     r8, r8
   0x40816:     sub (2rus)      r7, r1, 0x1
   0x40818:     add (2rus)      r4, r5, 0x0

***** Registers *****
r0             0x1                 1
r1             0x1d                29
r2             0x43db8             277944
r3             0xe                 14
r4             0x1f                31
r5             0xe                 14
r6             0x10c00             68608
r7             0x1                 1
r8             0x1                 1
r9             0x10b00             68352
r10            0x10500             66816
r11            0x0                 0
cp             0x439c4             0x439c4
dp             0x43c08             0x43c08
sp             0x7fe10             0x7fe10
lr             0x4071d             0x4071d
pc             0x40810             0x40810
sr             0x140               320
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x1                 1
sed            0x0                 0
kep            0x40080             0x40080
ksp            0x0                 0x0
User avatar
Ross
Verified
XCore Legend
Posts: 1154
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

One of the threads is in the exception handler.

If you build with -g and repeat the “dump state” passing the binary we’ll be able to more easily assist.
Technical Director @ XMOS. Opinions expressed are my own
dtns
Member++
Posts: 17
Joined: Sun Sep 01, 2024 6:05 pm

Post by dtns »

Ross wrote: Tue Dec 03, 2024 2:56 pm One of the threads is in the exception handler.

If you build with -g and repeat the “dump state” passing the binary we’ll be able to more easily assist.

Code: Select all


***** Active Cores *****
  Id   Target Id            Frame 
* 1.1  tile[0] core[0] (hw) AudioHub_MainLoop (divide=0, c_out=<optimized out>, c_adat_out=<optimized out>, adatSmuxMode=<optimized out>, curSamFreq=<optimized out>, p_lrclk=<optimized out>, p_bclk=<optimized out>, p_i2s_dac=..., p_i2s_adc=...) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:309
  1.2  tile[0] core[1] (hw) adat_transmit_port_until_ct_2x (c_data=2147615234, p_data=66304, smux=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_adat/lib_adat/src/adat_tx_port.xc:250
  2.1  tile[1] core[0] (hw) usb_midi (p_midi_in=68608, p_midi_out=68864, clk_midi=<optimized out>, c_midi=2147681026) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/midi/usb_midi.xc:338
  2.2  tile[1] core[1] (hw) XUA_Buffer_Decouple (c_mix_out=2147680258) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/decouple/decouple.xc:956
  2.3  tile[1] core[2] (hw) XUD_GetSetupBuffer (e=314240, buffer=<optimized out>, datalength=0x7eaec) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xud/lib_xud/src/user/client/XUD_EpFunctions.c:238
  2.4  tile[1] core[3] (hw) NextTokenAfterPing () at XUD_TokenJmp.S:7
  2.5  tile[1] core[4] (hw) XUA_Buffer_Ep (c_aud_out=2147682562, c_aud_in=2147684610, c_aud_fb=2147684098, c_midi_from_host=2147683074, p_off_mclk=1048832, c_aud_ctl=2147685378, c_sof=2147681538, c_midi=2147680770, c_midi_to_host=1) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/ep/ep_buffer.xc:408

Thread 2.5 (tile[1] core[4] (hw)):

***** Call Stack *****
#0  XUA_Buffer_Ep (c_aud_out=2147682562, c_aud_in=2147684610, c_aud_fb=2147684098, c_midi_from_host=2147683074, p_off_mclk=1048832, c_aud_ctl=2147685378, c_sof=2147681538, c_midi=2147680770, c_midi_to_host=1) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/ep/ep_buffer.xc:408
#1  0x00042c8c in XUA_Buffer.task.XUA_Buffer_Ep.0 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/ep/ep_buffer.xc:124
#2  0x0004712c in __start_core ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x426d4 <XUA_Buffer_Ep+424>: eeu (1r)        res[r3]
   0x426d6 <XUA_Buffer_Ep+426>: nop (0r)        
   0x426d8 <XUA_Buffer_Ep+428>: setsr (u6)      0x1
   0x426da <XUA_Buffer_Ep+430>: nop (0r)        
   0x426dc <XUA_Buffer_Ep+432>: nop (0r)        

***** Registers *****
r0             0x4d4bc             316604
r1             0x4d3bc             316348
r2             0x0                 0
r3             0x80030202          -2147286526
r4             0x0                 0
r5             0x80030b02          -2147284222
r6             0x0                 0
r7             0x7ec90             519312
r8             0x80031402          -2147281918
r9             0x4d3bc             316348
r10            0x4d4bc             316604
r11            0x42978             272760
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7ec10             0x7ec10
lr             0x42881             0x42881 <XUA_Buffer_Ep+853>
pc             0x426d4             0x426d4 <XUA_Buffer_Ep+424>
sr             0x100               256
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x80030502          -2147285758
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 2.4 (tile[1] core[3] (hw)):

***** Call Stack *****
#0  NextTokenAfterPing () at XUD_TokenJmp.S:7
#1  0x00045b80 in OutReady () at ./included/XUD_Token_Out_DI.S:20
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x45fc8 <NextTokenAfterPing+8>:      inpw (l2rus)    r11, res[r0], 0x8 *
   0x45fcc <NextTokenAfterPing+12>:     shr (2rus)      r11, r11, 0x18
   0x45fce <NextTokenAfterPing+14>:     nop (0r)        
   0x45fd0 <NextTokenAfterPing+16>:     nop (0r)        
   0x45fd2 <NextTokenAfterPing+18>:     ldw (3r)        r10, r10[r11]

***** Registers *****
r0             0x80100             524544
r1             0x10500             66816
r2             0x80000             524288
r3             0x13                19
r4             0x0                 0
r5             0x4ca40             313920
r6             0x3334              13108
r7             0xf335              62261
r8             0x493e0             300000
r9             0xa001              40961
r10            0x489f8             297464
r11            0x3a0257b6          973232054
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7e490             0x7e490
lr             0x45b81             0x45b81 <OutReady+5>
pc             0x45fc8             0x45fc8 <NextTokenAfterPing+8>
sr             0x183               387
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x10400             66560
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 2.3 (tile[1] core[2] (hw)):

***** Call Stack *****
#0  XUD_GetSetupBuffer (e=314240, buffer=<optimized out>, datalength=0x7eaec) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xud/lib_xud/src/user/client/XUD_EpFunctions.c:238
#1  0x000456d0 in USB_GetSetupPacket (ep_out=314240, ep_in=<optimized out>, sp=...) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xud/lib_xud/src/user/control/xud_device.xc:38
#2  0x0004078c in XUA_Endpoint0 (c_ep0_out=<optimized out>, c_ep0_in=<optimized out>, c_audioControl=2147685634, c_mix_ctl=0, c_clk_ctl=0, c_EANativeTransport_ctrl=<optimized out>, dfuInterface=524072) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/endpoint0/xua_endpoint0.c:1124
#3  0x0004117c in __main__main_tile_1_task_XUA_Endpoint0_3 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/main.xc:645
#4  0x0004712c in __start_core ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x40be4 <XUD_GetSetupBuffer+32>:     testct (2r)     r1, res[r1] *
   0x40be6 <XUD_GetSetupBuffer+34>:     nop (0r)        
   0x40be8 <XUD_GetSetupBuffer+36>:     bt (lru6)       r1, 0xb
   0x40bec <XUD_GetSetupBuffer+40>:     nop (0r)        
   0x40bee <XUD_GetSetupBuffer+42>:     ldw (2rus)      r1, r0[0x2]

***** Registers *****
r0             0x4cb80             314240
r1             0x80030702          -2147285246
r2             0x7eaec             518892
r3             0xffffffff          -1
r4             0x7eb8c             519052
r5             0x80031502          -2147281662
r6             0x7eb8c             519052
r7             0x7ff28             524072
r8             0x0                 0
r9             0x0                 0
r10            0x0                 0
r11            0x0                 0
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7eae8             0x7eae8
lr             0x456d1             0x456d1 <USB_GetSetupPacket+25>
pc             0x40be4             0x40be4 <XUD_GetSetupBuffer+32>
sr             0x140               320
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x0                 0
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 2.2 (tile[1] core[1] (hw)):

***** Call Stack *****
#0  XUA_Buffer_Decouple (c_mix_out=2147680258) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/decouple/decouple.xc:956
#1  0x00042c98 in XUA_Buffer.task.XUA_Buffer_Decouple.1 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/ep/ep_buffer.xc:159
#2  0x00046828 in __start_other_cores ()
#3  0x0004252c in XUA_Buffer ()
#4  0x00041138 in __main__main_tile_1_task_XUA_Buffer_2 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/main.xc:607
#5  0x0004712c in __start_core ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x41494 <XUA_Buffer_Decouple+752>:   ldw (lru6)      r0, dp[0x158c]
   0x41498 <XUA_Buffer_Decouple+756>:   bf (lru6)       r0, 0x2d
   0x4149c <XUA_Buffer_Decouple+760>:   ldw (lru6)      r0, dp[0x1595]
   0x414a0 <XUA_Buffer_Decouple+764>:   ldw (lru6)      r1, dp[0x1596]
   0x414a4 <XUA_Buffer_Decouple+768>:   stw (lru6)      r7, dp[0x158c]

***** Registers *****
r0             0x0                 0
r1             0x0                 0
r2             0x0                 0
r3             0x0                 0
r4             0x80030002          -2147287038
r5             0x0                 0
r6             0x4c668             312936
r7             0x0                 0
r8             0xac44              44100
r9             0x1                 1
r10            0x30c               780
r11            0x0                 0
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7ecf0             0x7ecf0
lr             0x415d1             0x415d1 <XUA_Buffer_Decouple+1069>
pc             0x41494             0x41494 <XUA_Buffer_Decouple+752>
sr             0x102               258
spc            0x41300             0x41300 <XUA_Buffer_Decouple+348>
ssr            0x102               258
et             0x0                 ET_NONE
ed             0x0                 0
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x47df0             0x47df0

Thread 2.1 (tile[1] core[0] (hw)):

***** Call Stack *****
#0  usb_midi (p_midi_in=68608, p_midi_out=68864, clk_midi=<optimized out>, c_midi=2147681026) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/midi/usb_midi.xc:338
#1  0x000411a4 in __main__main_tile_1_task_usb_midi_5 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/main.xc:707
#2  0x00046828 in __start_other_cores ()
#3  0x00041054 in __main__main_tile_1 ()
#4  0x000464b8 in main ()

***** Disassembly *****
=> 0x43b20 <usb_midi+400>:      waiteu (0r)      *
   0x43b22 <usb_midi+402>:      nop (0r)        
   0x43b24 <usb_midi+404>:      in (2r)         r0, res[r10] *
   0x43b26 <usb_midi+406>:      nop (0r)        
   0x43b28 <usb_midi+408>:      setc (ru6)      res[r6], 0x1 *

***** Registers *****
r0             0x80030302          -2147286270
r1             0x7673c8c           124206220
r2             0x7fffffff          2147483647
r3             0x0                 0
r4             0x0                 0
r5             0x2                 2
r6             0x10c00             68608
r7             0x0                 0
r8             0x0                 0
r9             0x2                 2
r10            0x1                 1
r11            0x43bc0             277440
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7edf0             0x7edf0
lr             0x43d2d             0x43d2d <usb_midi+925>
pc             0x43b20             0x43b20 <usb_midi+400>
sr             0x141               321
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x1                 1
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 1.2 (tile[0] core[1] (hw)):

***** Call Stack *****
#0  adat_transmit_port_until_ct_2x (c_data=2147615234, p_data=66304, smux=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_adat/lib_adat/src/adat_tx_port.xc:250
#1  0x00041a9c in adat_tx_port (c_data=2147615234, p_data=1048575) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_adat/lib_adat/src/adat_tx_port.xc:282
#2  0x00040af4 in _SXUA_AudioHub_0.task.adat_tx_port.0 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:850
#3  0x00043e40 in __start_core ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x41a20 <adat_transmit_port_until_ct_2x+452>:        out (r2r)       res[r4], r0 *
   0x41a22 <adat_transmit_port_until_ct_2x+454>:        shr (3r)        r0, r11, r5
   0x41a24 <adat_transmit_port_until_ct_2x+456>:        outpw (l2rus)   res[r4], r0, 0x8 *
   0x41a28 <adat_transmit_port_until_ct_2x+460>:        add (2rus)      r3, r3, 0x2
   0x41a2a <adat_transmit_port_until_ct_2x+462>:        ldc (ru6)       r0, 0x8

***** Registers *****
r0             0xf003ff00          -268173568
r1             0xfffff             1048575
r2             0x14                20
r3             0x4                 4
r4             0x10300             66304
r5             0xc                 12
r6             0x3ff00             261888
r7             0xf0000000          -268435456
r8             0x3fc               1020
r9             0x44c30             281648
r10            0x16                22
r11            0x3ff00             261888
cp             0x443dc             0x443dc
dp             0x44650             0x44650
sp             0x7f628             0x7f628
lr             0x41a9d             0x41a9d <adat_tx_port+65>
pc             0x41a20             0x41a20 <adat_transmit_port_until_ct_2x+452>
sr             0x180               384
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x0                 0
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 1.1 (tile[0] core[0] (hw)):

***** Call Stack *****
#0  AudioHub_MainLoop (divide=0, c_out=<optimized out>, c_adat_out=<optimized out>, adatSmuxMode=<optimized out>, curSamFreq=<optimized out>, p_lrclk=<optimized out>, p_bclk=<optimized out>, p_i2s_dac=..., p_i2s_adc=...) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:309
#1  0x00040b74 in _SXUA_AudioHub_0.task.__builtin_outct.1 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:880
#2  0x00044382 in ConfigAudioPorts.thunk.2 ()
#3  0x00010700 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x408ec <AudioHub_MainLoop+168>:     in (2r)         r3, res[r7] *
   0x408ee <AudioHub_MainLoop+170>:     nop (0r)        
   0x408f0 <AudioHub_MainLoop+172>:     bitrev (2r)     r3, r3
   0x408f2 <AudioHub_MainLoop+174>:     ldc (ru6)       r11, 0xe
   0x408f4 <AudioHub_MainLoop+176>:     add (2rus)      r4, r11, 0x0

***** Registers *****
r0             0x10500             66816
r1             0xc                 12
r2             0x0                 0
r3             0x1                 1
r4             0x9                 9
r5             0x4                 4
r6             0xf                 15
r7             0x10b00             68352
r8             0x0                 0
r9             0x10c00             68608
r10            0x1                 1
r11            0x1f                31
cp             0x443dc             0x443dc
dp             0x44650             0x44650
sp             0x7fdd0             0x7fdd0
lr             0x407d5             0x407d5 <DoSampleTransfer+257>
pc             0x408ec             0x408ec <AudioHub_MainLoop+168>
sr             0x140               320
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x1                 1
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0
syso@MacBook-Pro-M3 app_usb_aud_custom % xrun --dumpstate bin/UMATDM/uma_UMATDM.xe
reset post-attach
Done.

***** Active Cores *****
  Id   Target Id            Frame 
* 1.1  tile[0] core[0] (hw) AudioHub_MainLoop (divide=0, c_out=<optimized out>, c_adat_out=<optimized out>, adatSmuxMode=<optimized out>, curSamFreq=<optimized out>, p_lrclk=<optimized out>, p_bclk=<optimized out>, p_i2s_dac=..., p_i2s_adc=...) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:309
  1.2  tile[0] core[1] (hw) adat_transmit_port_until_ct_2x (c_data=2147615234, p_data=66304, smux=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_adat/lib_adat/src/adat_tx_port.xc:222
  2.1  tile[1] core[0] (hw) usb_midi (p_midi_in=68608, p_midi_out=68864, clk_midi=<optimized out>, c_midi=2147681026) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/midi/usb_midi.xc:338
  2.2  tile[1] core[1] (hw) XUA_Buffer_Decouple (c_mix_out=2147680258) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/decouple/decouple.xc:956
  2.3  tile[1] core[2] (hw) XUD_GetSetupBuffer (e=314240, buffer=<optimized out>, datalength=0x7eaec) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xud/lib_xud/src/user/client/XUD_EpFunctions.c:238
  2.4  tile[1] core[3] (hw) NextRxWord () at ./included/XUD_RxData.S:66
  2.5  tile[1] core[4] (hw) 0x0004269c in XUA_Buffer_Ep (c_aud_out=2147682562, c_aud_in=2147684610, c_aud_fb=2147684098, c_midi_from_host=2147683074, p_off_mclk=1048832, c_aud_ctl=2147685378, c_sof=2147681538, c_midi=2147680770, c_midi_to_host=1) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/ep/ep_buffer.xc:408

Thread 2.5 (tile[1] core[4] (hw)):

***** Call Stack *****
#0  0x0004269c in XUA_Buffer_Ep (c_aud_out=2147682562, c_aud_in=2147684610, c_aud_fb=2147684098, c_midi_from_host=2147683074, p_off_mclk=1048832, c_aud_ctl=2147685378, c_sof=2147681538, c_midi=2147680770, c_midi_to_host=1) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/ep/ep_buffer.xc:408
#1  0x00042c8c in XUA_Buffer.task.XUA_Buffer_Ep.0 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/ep/ep_buffer.xc:124
#2  0x0004712c in __start_core ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x4269c <XUA_Buffer_Ep+368>: nop (0r)        
   0x4269e <XUA_Buffer_Ep+370>: ldw (ru6)       r3, sp[0x17]
   0x426a0 <XUA_Buffer_Ep+372>: setv (1r)       res[r3], r11
   0x426a2 <XUA_Buffer_Ep+374>: nop (0r)        
   0x426a4 <XUA_Buffer_Ep+376>: eeu (1r)        res[r3]

***** Registers *****
r0             0x4d4bc             316604
r1             0x4d3bc             316348
r2             0x0                 0
r3             0x80031102          -2147282686
r4             0x0                 0
r5             0x80030b02          -2147284222
r6             0x0                 0
r7             0x7ec90             519312
r8             0x80031402          -2147281918
r9             0x4d3bc             316348
r10            0x4d4bc             316604
r11            0x4288c             272524
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7ec10             0x7ec10
lr             0x42881             0x42881 <XUA_Buffer_Ep+853>
pc             0x4269c             0x4269c <XUA_Buffer_Ep+368>
sr             0x100               256
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x80030502          -2147285758
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 2.4 (tile[1] core[3] (hw)):

***** Call Stack *****
#0  NextRxWord () at ./included/XUD_RxData.S:66
#1  0x00045b80 in OutReady () at ./included/XUD_Token_Out_DI.S:20
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x45c78 <NextRxWord+24>:     in (2r)         r11, res[r0] *
   0x45c7a <NextRxWord+26>:     nop (0r)        
   0x45c7c <NextRxWord+28>:     crc32_inc (l4rus) r6, r11, r9, r4, 0x1
   0x45c80 <NextRxWord+32>:     stw (l3r)       r11, r1[r4]
   0x45c84 <NextRxWord+36>:     in (2r)         r11, res[r0] *

***** Registers *****
r0             0x80100             524544
r1             0x4a558             304472
r2             0x80000             524288
r3             0x4cbb4             314292
r4             0x25                37
r5             0x4ca40             313920
r6             0x3ae9              15081
r7             0xf335              62261
r8             0x10400             66560
r9             0xa001              40961
r10            0x1                 1
r11            0x0                 0
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7e490             0x7e490
lr             0x45b81             0x45b81 <OutReady+5>
pc             0x45c78             0x45c78 <NextRxWord+24>
sr             0x183               387
spc            0x45fc8             0x45fc8 <NextTokenAfterPing+8>
ssr            0x183               387
et             0x0                 ET_NONE
ed             0x10400             66560
sed            0x10400             66560
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 2.3 (tile[1] core[2] (hw)):

***** Call Stack *****
#0  XUD_GetSetupBuffer (e=314240, buffer=<optimized out>, datalength=0x7eaec) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xud/lib_xud/src/user/client/XUD_EpFunctions.c:238
#1  0x000456d0 in USB_GetSetupPacket (ep_out=314240, ep_in=<optimized out>, sp=...) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xud/lib_xud/src/user/control/xud_device.xc:38
#2  0x0004078c in XUA_Endpoint0 (c_ep0_out=<optimized out>, c_ep0_in=<optimized out>, c_audioControl=2147685634, c_mix_ctl=0, c_clk_ctl=0, c_EANativeTransport_ctrl=<optimized out>, dfuInterface=524072) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/endpoint0/xua_endpoint0.c:1124
#3  0x0004117c in __main__main_tile_1_task_XUA_Endpoint0_3 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/main.xc:645
#4  0x0004712c in __start_core ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x40be4 <XUD_GetSetupBuffer+32>:     testct (2r)     r1, res[r1] *
   0x40be6 <XUD_GetSetupBuffer+34>:     nop (0r)        
   0x40be8 <XUD_GetSetupBuffer+36>:     bt (lru6)       r1, 0xb
   0x40bec <XUD_GetSetupBuffer+40>:     nop (0r)        
   0x40bee <XUD_GetSetupBuffer+42>:     ldw (2rus)      r1, r0[0x2]

***** Registers *****
r0             0x4cb80             314240
r1             0x80030702          -2147285246
r2             0x7eaec             518892
r3             0xffffffff          -1
r4             0x7eb8c             519052
r5             0x80031502          -2147281662
r6             0x7eb8c             519052
r7             0x7ff28             524072
r8             0x0                 0
r9             0x0                 0
r10            0x0                 0
r11            0x0                 0
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7eae8             0x7eae8
lr             0x456d1             0x456d1 <USB_GetSetupPacket+25>
pc             0x40be4             0x40be4 <XUD_GetSetupBuffer+32>
sr             0x140               320
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x0                 0
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 2.2 (tile[1] core[1] (hw)):

***** Call Stack *****
#0  XUA_Buffer_Decouple (c_mix_out=2147680258) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/decouple/decouple.xc:956
#1  0x00042c98 in XUA_Buffer.task.XUA_Buffer_Decouple.1 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/buffer/ep/ep_buffer.xc:159
#2  0x00046828 in __start_other_cores ()
#3  0x0004252c in XUA_Buffer ()
#4  0x00041138 in __main__main_tile_1_task_XUA_Buffer_2 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/main.xc:607
#5  0x0004712c in __start_core ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x41494 <XUA_Buffer_Decouple+752>:   ldw (lru6)      r0, dp[0x158c]
   0x41498 <XUA_Buffer_Decouple+756>:   bf (lru6)       r0, 0x2d
   0x4149c <XUA_Buffer_Decouple+760>:   ldw (lru6)      r0, dp[0x1595]
   0x414a0 <XUA_Buffer_Decouple+764>:   ldw (lru6)      r1, dp[0x1596]
   0x414a4 <XUA_Buffer_Decouple+768>:   stw (lru6)      r7, dp[0x158c]

***** Registers *****
r0             0x0                 0
r1             0x0                 0
r2             0x0                 0
r3             0x0                 0
r4             0x80030002          -2147287038
r5             0x0                 0
r6             0x4c668             312936
r7             0x0                 0
r8             0xbb80              48000
r9             0x1                 1
r10            0x38c               908
r11            0x0                 0
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7ecf0             0x7ecf0
lr             0x415d1             0x415d1 <XUA_Buffer_Decouple+1069>
pc             0x41494             0x41494 <XUA_Buffer_Decouple+752>
sr             0x102               258
spc            0x41498             0x41498 <XUA_Buffer_Decouple+756>
ssr            0x102               258
et             0x0                 ET_NONE
ed             0x0                 0
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x47df0             0x47df0

Thread 2.1 (tile[1] core[0] (hw)):

***** Call Stack *****
#0  usb_midi (p_midi_in=68608, p_midi_out=68864, clk_midi=<optimized out>, c_midi=2147681026) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/midi/usb_midi.xc:338
#1  0x000411a4 in __main__main_tile_1_task_usb_midi_5 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/main.xc:707
#2  0x00046828 in __start_other_cores ()
#3  0x00041054 in __main__main_tile_1 ()
#4  0x000464b8 in main ()

***** Disassembly *****
=> 0x43b20 <usb_midi+400>:      waiteu (0r)      *
   0x43b22 <usb_midi+402>:      nop (0r)        
   0x43b24 <usb_midi+404>:      in (2r)         r0, res[r10] *
   0x43b26 <usb_midi+406>:      nop (0r)        
   0x43b28 <usb_midi+408>:      setc (ru6)      res[r6], 0x1 *

***** Registers *****
r0             0x80030302          -2147286270
r1             0x4c0036d0          1275082448
r2             0x7fffffff          2147483647
r3             0x0                 0
r4             0x0                 0
r5             0x2                 2
r6             0x10c00             68608
r7             0x0                 0
r8             0x0                 0
r9             0x4                 4
r10            0x1                 1
r11            0x43bc0             277440
cp             0x47748             0x47748 <g_subSlot_Out_HS>
dp             0x47d28             0x47d28
sp             0x7edf0             0x7edf0
lr             0x43d2d             0x43d2d <usb_midi+925>
pc             0x43b20             0x43b20 <usb_midi+400>
sr             0x141               321
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x1                 1
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 1.2 (tile[0] core[1] (hw)):

***** Call Stack *****
#0  adat_transmit_port_until_ct_2x (c_data=2147615234, p_data=66304, smux=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_adat/lib_adat/src/adat_tx_port.xc:222
#1  0x00041a9c in adat_tx_port (c_data=2147615234, p_data=1048575) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_adat/lib_adat/src/adat_tx_port.xc:282
#2  0x00040af4 in _SXUA_AudioHub_0.task.adat_tx_port.0 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:850
#3  0x00043e40 in __start_core ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x41994 <adat_transmit_port_until_ct_2x+312>:        out (r2r)       res[r4], r11 *
   0x41996 <adat_transmit_port_until_ct_2x+314>:        shr (3r)        r11, r7, r5
   0x41998 <adat_transmit_port_until_ct_2x+316>:        outpw (l2rus)   res[r4], r11, 0x8 *
   0x4199c <adat_transmit_port_until_ct_2x+320>:        shr (2rus)      r11, r6, 0x6
   0x4199e <adat_transmit_port_until_ct_2x+322>:        nop (0r)        

***** Registers *****
r0             0x16                22
r1             0xfffff             1048575
r2             0x14                20
r3             0x6                 6
r4             0x10300             66304
r5             0xc                 12
r6             0x0                 0
r7             0x3ff00             261888
r8             0x3fc               1020
r9             0x44c30             281648
r10            0x16                22
r11            0xf003ff00          -268173568
cp             0x443dc             0x443dc
dp             0x44650             0x44650
sp             0x7f628             0x7f628
lr             0x41a9d             0x41a9d <adat_tx_port+65>
pc             0x41994             0x41994 <adat_transmit_port_until_ct_2x+312>
sr             0x180               384
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x0                 0
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0

Thread 1.1 (tile[0] core[0] (hw)):

***** Call Stack *****
#0  AudioHub_MainLoop (divide=0, c_out=<optimized out>, c_adat_out=<optimized out>, adatSmuxMode=<optimized out>, curSamFreq=<optimized out>, p_lrclk=<optimized out>, p_bclk=<optimized out>, p_i2s_dac=..., p_i2s_adc=...) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:309
#1  0x00040b74 in _SXUA_AudioHub_0.task.__builtin_outct.1 (frame=<optimized out>) at /Users/syso/Downloads/sw_usb_audio-_sw_v8_1_0/lib_xua/lib_xua/src/core/audiohub/xua_audiohub.xc:880
#2  0x00044382 in ConfigAudioPorts.thunk.2 ()
#3  0x00010700 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

***** Disassembly *****
=> 0x408ec <AudioHub_MainLoop+168>:     in (2r)         r3, res[r7] *
   0x408ee <AudioHub_MainLoop+170>:     nop (0r)        
   0x408f0 <AudioHub_MainLoop+172>:     bitrev (2r)     r3, r3
   0x408f2 <AudioHub_MainLoop+174>:     ldc (ru6)       r11, 0xe
   0x408f4 <AudioHub_MainLoop+176>:     add (2rus)      r4, r11, 0x0

***** Registers *****
r0             0x10500             66816
r1             0xe                 14
r2             0x1                 1
r3             0x1                 1
r4             0xb                 11
r5             0x4                 4
r6             0xf                 15
r7             0x10b00             68352
r8             0x0                 0
r9             0x10c00             68608
r10            0x1                 1
r11            0x1f                31
cp             0x443dc             0x443dc
dp             0x44650             0x44650
sp             0x7fdd0             0x7fdd0
lr             0x407d5             0x407d5 <DoSampleTransfer+257>
pc             0x408ec             0x408ec <AudioHub_MainLoop+168>
sr             0x140               320
spc            0x0                 0x0
ssr            0x0                 0
et             0x0                 ET_NONE
ed             0x1                 1
sed            0x0                 0
kep            0x40080             0x40080 <_TrapHandler>
ksp            0x0                 0x0
dtns
Member++
Posts: 17
Joined: Sun Sep 01, 2024 6:05 pm

Post by dtns »

I just observed that BCLK equals MCLK when in TDM16 mode. MCLK has none to low jitter, BCLK has relatively high jitter compared to MCLK.
LRCLK is correct.
User avatar
Ross
Verified
XCore Legend
Posts: 1154
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

These two dumps seems to be in two different states. The original post mentioned no clocks and the dump shows a trap.

The later post shows no trap and you say the clocks are present.

Perhaps you now have it working, it's unclear.
Technical Director @ XMOS. Opinions expressed are my own