nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Problems with nrf5340 audio example

When I use two nrf5340 audio DK to test the LE audio demo, the handset side always crashes. Especially when I move the DK that is used as the handset.I think that incomplete data reception due to compromised communication can cause a crash problem.

Configuration:

CONFIG_SW_CODEC_SBC=y

Logs:

HL [00:01:39.629,425] <wrn> sw_codec_select: PCM samples dropped
HL [00:01:39.629,425] <err> audio_datapath: Decoded audio has wrong size
HL [00:01:39.629,455] <err> audio_datapath: ERR_CHK Err_code: [-140] @ line: 833
HL [00:01:39.6os: r0/a1:  0x00000003  r1/a2:  0x00000006  r2/a3:  0x00000005
 [00:01:39.629,455] <err> os:  xpsr:  0x41000000d0 r12/ip:  0x00000002 r14/lr:  0x000177ed
HL [00:01:39.629,455] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
HL [00:01:39.629,486] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
HL [029,486] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
HL [00:01:39.629,486] <err> os: s[12]:  0x00000000  s[13]:  0xffffffff  s[14]:  0x00000000  s[15]:  0x00000000
HL [00:01:39.629,516] <err> os: fpscr:  0xffffffff
HL [00:01:39.629,516] <err> os: Faulting instruction address (r15/pc): 0x00006104
HL [00:01:39.629,516] R FATAL ERROR 3: Kernel oops on CPU 0
HL [00:01:39.629,547] <err> os: Current thread: 0x20001648 (AUDIO DATAPATH)
HL [00:01:39.629,547] <err> error_handler: Caught system error -- reason 3. Entering infinite loop

And when use ''CONFIG_TRANSPORT_BIS=y'' same as above.

Parents
  • Hello,

    In addition to setting CONFIG_TRANSPORT_BIS=y in the prj.conf you will need to go into overlay-headset.conf and overlay-gateway.conf and delete these two:
    CONFIG_LC3_ENC_CHAN_MAX=2
    CONFIG_LC3_DEC_CHAN_MAX=1.

    Please do this, and let me know if it resolves your issue.

    Best regards,
    Karl

  • As a side-note: I highly recommend that you make use of the LC3 codec for your evaluation and development wherever possible - it is really a major improvement over the SBC! :)

    Best regards,
    Karl

  • Hi Karl,
    I have deleted these two, otherwise I cannot compile code.Obviously,the problems I mentioned occurred during the DK is running.
    Best regards,
    Chen
  • Could you provide the full log from the headset side?
    Could you also confirm whether you have any many other modifications to the application other than the BIS configuration + 3 changes for the SBC mentioned earlier?

    Best regards,
    Karl

  • All my changes:

    chen@ubuntu:~/ncs/nrf$ git diff
    diff --git a/applications/nrf5340_audio/overlay-gateway.conf b/applications/nrf5340_audio/overlay-gateway.conf
    index 251eea3d7..734572e58 100644
    --- a/applications/nrf5340_audio/overlay-gateway.conf
    +++ b/applications/nrf5340_audio/overlay-gateway.conf
    @@ -41,5 +41,5 @@ CONFIG_BT_MAX_CONN=2
     CONFIG_BT_ISO_MAX_CHAN=2
     CONFIG_BT_MAX_PAIRED=2
     
    -CONFIG_LC3_ENC_CHAN_MAX=2
    -CONFIG_LC3_DEC_CHAN_MAX=1
    +# CONFIG_LC3_ENC_CHAN_MAX=2
    +# CONFIG_LC3_DEC_CHAN_MAX=1
    diff --git a/applications/nrf5340_audio/overlay-headset.conf b/applications/nrf5340_audio/overlay-headset.conf
    index abff0b37c..1bc0df0ea 100644
    --- a/applications/nrf5340_audio/overlay-headset.conf
    +++ b/applications/nrf5340_audio/overlay-headset.conf
    @@ -19,5 +19,5 @@ CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
     CONFIG_BT_MAX_CONN=1
     CONFIG_BT_ISO_MAX_CHAN=1
     
    -CONFIG_LC3_ENC_CHAN_MAX=1
    -CONFIG_LC3_DEC_CHAN_MAX=1
    +# CONFIG_LC3_ENC_CHAN_MAX=1
    +# CONFIG_LC3_DEC_CHAN_MAX=1
    diff --git a/applications/nrf5340_audio/prj.conf b/applications/nrf5340_audio/prj.conf
    index d11231555..9c40681a9 100644
    --- a/applications/nrf5340_audio/prj.conf
    +++ b/applications/nrf5340_audio/prj.conf
    @@ -40,7 +40,7 @@ CONFIG_BT_PER_ADV=y
     CONFIG_BT_ISO_UNICAST=y
     CONFIG_BT_ISO_BROADCASTER=y
     CONFIG_BT_ISO_SYNC_RECEIVER=y
    -
    +CONFIG_SW_CODEC_SBC=y
     # Temporary, enable the following to meet BT_ISO dependencies
     CONFIG_BT_OBSERVER=y
     CONFIG_BT_PERIPHERAL=y
    (END)
    

    Full log:

    *** Booting Zephyr OS build v3.0.99-ncs1  ***
    HL [00:00:00.250,885] <inf> audio_sync_timer: Audio sync timer initialized
    HL [00:00:00.251,068] <dbg> nrf5340_
                                        HL [00:00:00.251,129] <dbg> nrf5340_audio_dk_nrf5340_cpuapp: remoteproc_mgr_boot: Network MCU released.
    HL [00:00:00.255,889] <inf> fw_info: 
             nRF5340 Audio nRF5340 Audio DK cpuapp                      
             FW Version: 0.5.99                         
             Cmake run : Mon Jun 06 17:36:32 2022
    HL [00:00:00.255,889] <inf> fw_info: ------- DEBUG BUILD -------
    HL [00:00:00.255,889] <inf> fw_info: 
             HEADSET left device
    HL [00:00:00.266,479] <inf> board_version: Compatible board/HW version found: 1.0.0
    HL [00:00:00.330,902] <wrn> bt_hci_core: Controller to host flow control not supported
    HL [00:00:00.458,831] <inf> ble: MAC: D9:D0:F0:B6:A9:84 (random)
    HL [00:00:00.459,045] <inf> ble: Controller version: 3269
    HL [00:00:00.537,902] <wrHL [00:00:06.640,838] <inf> streamctrl: BLE evt connected
    HL [00:00:06.640,869] <inf> streamctrl: BLE evt link ready
    HL [00:00:15.631,134] <inf> audio_datapath: Drft comp state: CALIB
    HL [00:00:15.632,110] <wrn> audio_datapath: Data received, total underruns: 9
    HL [00:00:15.731,140comp state: LOCKED
    HL [00:00:16.200,531] <inf> audio_datapath: Pres comp state: MEAS
    HL [00:00:16.310,516] <inf> audio_datapath: Pres comp state: WAIT
    HL [0atapath: Pres comp state: INIT
    HL [00:00:16.380,523] <inf> audio_datapath: Pres comp state: MEAS
    HL [00:00:16.490,539] <inf> audio_datapath: Pres comp state: LOCKED
    HL [00:00:21.500,762] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:30.311,187] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:31.641,235] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:31.741,241] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:33.061,309] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:36.111,450] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:40.931,671] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:40.981,689] <wrn> audio_datapath: Invalid sd_us
    HL [00:00:41.061,676] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:41.471,710] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:41.981,719] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:42.291,748] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:46.491,943] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:47.091,979] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL [00:00:47.124,481] <wrn> audio_datapath: Invalid sdu_ref_us delta (9983) - Estimating sdu_ref_us
    HL PCM samples dropped
    HL [00:00:47.124,542] <err> audio_datapath: Decoded audio has wrong size
    HL [00:00:47.124,542] <err> audio_datapath: ERR_CHK Err_code: [-140] @ line: 833
    HL [00:00:47.124,572] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000006  r2/a3:  0x00000005
    HL [00:00:47.124,572] <err> os: r3/a4:  0x20001dd0 r12/ip:  0x00000002 r14/lr:  0x000177ed
    HL [00:00:47.124,572] <err> os:  xpsr:  0x41000000
    HL [00:00:47.124,572] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
    HL [00:00:47.124,603] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
    HL [00:00:47.124,603] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
    HL [00:00:47.124,603] <err> os: s[12]:  0x00000000  s[13]:  0xffffffff  s[14]:  0x00000000  s[15]:  0x47.124,603] <err> os: fpscr:  0xffffffff
    HL [00:00:47.124,633] <err> os: Faulting instruction address (r15/pc): 0x00006104
    HL [00:00:47.124,6: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    HL [00:00:47.124,633] <err> os: Current thread: 0x20001648 (AUDIO DATAPATH)
    HL [00:00:47.124,664] <err> error_handler: Caught system error -- reason 3. Entering infinite loop

  • Thank you for providing the diff output and the full log, I will discuss this with some colleagues internally and get back to you as soon as I have an update.

    Best regards,
    Karl

  • Hello again,

    I've discussed this with some colleagues now and the behavior shown in your log is something we have seen before when using the SBC codec. In essence, it is caused by sw_codec_select not handling the SBC's output properly when a bad frame occurs.
    As a quick fix for this I suggest that you just remove the ERR_CHK_MSG on line 815 in this case - at worst this could sometimes produces audiable artifacts when a bad frame occurs with the SBC codec, since ctrl_blk.decoded_data contains the data from the last frame/package, which means that the same frame will be played twice. It is not ideal fix, but it is better than the device resetting at least, for the time being.

    Please try this, and let me know if it resolves the issue.

    Best regards,
    Karl

Reply
  • Hello again,

    I've discussed this with some colleagues now and the behavior shown in your log is something we have seen before when using the SBC codec. In essence, it is caused by sw_codec_select not handling the SBC's output properly when a bad frame occurs.
    As a quick fix for this I suggest that you just remove the ERR_CHK_MSG on line 815 in this case - at worst this could sometimes produces audiable artifacts when a bad frame occurs with the SBC codec, since ctrl_blk.decoded_data contains the data from the last frame/package, which means that the same frame will be played twice. It is not ideal fix, but it is better than the device resetting at least, for the time being.

    Please try this, and let me know if it resolves the issue.

    Best regards,
    Karl

Children
No Data
Related