Maximum iso data length of NRF5340 audio increased

Hello,

I am using bis gateway on nrf5340 audio dk to transmit data.

In addition to audio encoded data, I also wanted to send some additional data, so I put these data after the audio encoded data and sent them together, and then I encountered the -EMSGSIZE error.

It seems that the maximum iso data length is 120, if the data length exceeds this size, it will not be transmitted.

Can this maximum length be increased?

Parents
  • Hi,

    Do you use nrf5340_audio application? Can you show your changes?

    Do you use I2S or USB?

    Can you provide a full error log?

    Best regards,
    Dejan

  • Yes, I use nrf5340_audio application, and I use USB in.

    Here are my changes, I increased the data length when sending it.

    [audio_system.c]

    static void encoder_thread(void *arg1, void *arg2, void *arg3)
    {
        ...
        if (sw_codec_cfg.encoder.enabled) {
    			/* Send encoded data over IPM */
    			//streamctrl_encoded_data_send(encoded_data, encoded_data_size);
    			streamctrl_encoded_data_send(my_data, 520);
    		}
    	STACK_USAGE_PRINT("encoder_thread", &encoder_thread_data);
    	}
    }

    And I added the max data related log to iso_chan_max_data_len function in iso.c.

    [iso.c]

    static uint16_t iso_chan_max_data_len(const struct bt_iso_chan *chan,
    				      uint32_t ts)
    {
    	...
    	/* Update the max_data_len to take the max_controller_data_len into account */
    	max_data_len = MIN(max_data_len, max_controller_data_len);
    	BT_INFO("Max data len:%d",max_data_len);
    	BT_INFO("Max Controller data len:%d",max_controller_data_len);
    
    	return max_data_len;
    }

    This is the config I added in prj.conf.

    CONFIG_BT_ISO_TX_MTU=2048
    CONFIG_BT_ISO_RX_MTU=2048

    Then this is my error log.

    GW [00:00:00.130,798] <inf> bis_gateway: Broadcast source 0x2000bc78 started
    GW [00:00:00.131,134] <inf> bis_gateway: Broadcast source 0x2000bc9c started
    GW [00:00:11.588,470] <inf> bt_iso: Max data len:120
    GW [00:00:11.588,470] <inf> bt_iso: Max Controller data len:1536
    GW [00:00:11.588,470] <inf> bt_iso: Cannot send 520 octets, maximum 120
    GW [00:00:11.588,470] <wrn> bis_gateway: Failed to send audio data: -122
    GW [00:00:11.588,500] <wrn> streamctrl: Problem with sending LE audio data, ret: -122

  • Hi,

    On the gateway, you could try to replace

    BT_CODEC_LC3_QOS_10_UNFRAMED(251u, 4u,20u, LE_AUDIO_PRES_DELAY_US))


    with 
    BT_CODEC_LC3_QOS_10_UNFRAMED(251u, 2u,20u, LE_AUDIO_PRES_DELAY_US))


    Generally, we highly recommend that you upgrade to the NCS v2.6.1 (or NCS v2.7.0 when it becomes available).

    Best regards,
    Dejan



  • Thanks for your assistance, it works.

    Now I can successfully transfer 250 bytes of data through bis.

    Then, I tried to increase the sdu size to 512 bytes. The following are my modifications on the gateway.

    BT_CODEC_LC3_QOS_10_UNFRAMED(512u, 0u,20u, LE_AUDIO_PRES_DELAY_US))

    I tried to send 480 bytes of data, written as follows:

    streamctrl_encoded_data_send(my_data, 480);

    Although the bis headset connect to the gateway successfully, it did not receive any data.

    What is the limit on the data size that is bis gateway can transmit?

  • Hi,

    I would need to check this internally. I will get back to you during next week.

    Best regards,
    Dejan

  • Hi,

    The audio application currently supports max PDU (containing one SDU) of 251. 

    Best regards,
    Dejan

Reply Children
Related