bap_unicast_server sample throws stack overflow exception on playing media

Hello Team,

I have flashed the bap_unicast_server bluetooth sample on my nRF5340 Audio DK. No build or flash errors. When I connect to my phone it connects properly. I'm using Samsung Galaxy S23 Ultra (has BLE Audio enabled). However, playing any audio or media via some music player or something (like Spotify or Youtube Music) gives the follow stackoverflow error

*** Booting nRF Connect SDK v3.0.1-9eb5615da66b ***
*** Using Zephyr OS v4.0.99-77f865b8f8d0 ***
[00:00:00.319,458] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.319,488] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.319,519] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 45.41337 Build 3074452168
[00:00:00.321,289] <inf> bt_hci_core: Identity: F2:84:18:6B:A7:A3 (random)
[00:00:00.321,319] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x206b, manufacturer 0x0059
[00:00:00.321,319] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x206b
Bluetooth initialized
Location successfully set
Supported contexts successfully set
Available contexts successfully set
Advertising successfully started
Connected: 66:BF:4D:4A:FA:D0 (random)
Disconnected: 66:BF:4D:4A:FA:D0 (random), reason 0x13 
Advertising successfully started
Connected: 43:99:95:17:DD:FE (random)
ASE Codec Config: conn 0x20001930 ep 0x2000204c dir 1
codec_cfg 0x06 cid 0x0000 vid 0x0000 count 19
data: type 0x01 value_len 1
08
data: type 0x02 value_len 1
01
data: type 0x03 value_len 4
00000000
data: type 0x04 value_len 2
7800
data: type 0x05 value_len 1
01
  Frequency: 48000 Hz
  Frame Duration: 10000 us
  Channel allocation: 0x0
  Octets per frame: 120 (negative means value not pressent)
  Frames per SDU: 1
ASE Codec Config stream 0x20004b08
QoS: stream 0x20004b08 qos 0x200084e8
QoS: interval 10000 framing 0x00 phy 0x02 sdu 120 rtn 2 latency 10 pd 40000
Enable: stream 0x20004b08 meta_len 7
Audio Stream 0x20004b08 started
Bad packet: 0x09
[00:01:06.356,658] <err> os: ***** USAGE FAULT *****
[00:01:06.356,658] <err> os:   Stack overflow (context area not valid)
[00:01:06.356,689] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000004  r2/a3:  0x00000019
[00:01:06.356,689] <err> os: r3/a4:  0x20003724 r12/ip:  0x200008d4 r14/lr:  0x00013a03
[00:01:06.356,689] <err> os:  xpsr:  0x61100200
[00:01:06.356,719] <err> os: s[ 0]:  0x2000cae8  s[ 1]:  0x2000cae8  s[ 2]:  0x00000000  s[ 3]:  0x0000a103
[00:01:06.356,719] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x20008690  s[ 6]:  0x2000cae8  s[ 7]:  0x2000cb6c
[00:01:06.356,719] <err> os: s[ 8]:  0x200084b8  s[ 9]:  0x2000204c  s[10]:  0x00000000  s[11]:  0x20005384
[00:01:06.356,781] <err> os: s[12]:  0x2000b9e9  s[13]:  0x00022a35  s[14]:  0x00000000  s[15]:  0x2000cb6c
[00:01:06.356,781] <err> os: fpscr:  0x2000cae8
[00:01:06.356,781] <err> os: Faulting instruction address (r15/pc): 0x00015306
[00:01:06.356,811] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
[00:01:06.356,842] <err> os: Current thread: 0x200017f0 (unknown)
[00:01:06.466,827] <err> os: Halting system

I'm looking for a code sample apart from the audio application that contains a modular code and explanation for connecting the board to a mobile device and streaming audio via the mobile device. This is the closest I could get I guess. Please let me know what's the issue here.

I'm using toolchain v3.0.1 and SDK v3.0.1

Best,

Soham

Related