I do not think len is a fixed value, otherwise alsa_frames_to_send should be a fixed value if num_channel fixed. So maybe need your help to print the len info out when avk function is running.
if (app_avk_cb.alsa_handle != NULL && p_buffer)
/* Compute number of PCM samples (contained in p_msg->len bytes) */
alsa_frames_to_send = p_msg->len / connection->num_channel;
if (connection->bit_per_sample == 16)
alsa_frames_to_send /= 2;
Yes, we have printed the “p_msg->len” value for AVK mode.
For PCM format, it's always 1024 or 512.
For AAC format with LATM header, it's around 600~700 normally, 1024 maximum.
As we observed, the maximum value is 1024. But we don't make sure this thing.
We require your confirmation, does BSA_server set the maximum buffer size to 1024 for AVK UIPC transmission?
Thanks very much!
only find this one for AV, assume they are using the same buffer.
# Configure the BSA AV buffer size. This will be set the maximum latency
# that can be added before the SBC encoder. When setting this value, you
# should take into account:
# - the ring buffer mechanism requires 1 byte to be always free, the
# actual size used is smaller by 1
# - the size must be a multiple of the sample size (2x16 for 16 bit stereo)
# because if the buffer write is non blocking, samples could get truncated
# - 48kHz 16 bit stereo:
# 8193 -> 8192 byte buffer -> 2048 sample buffer -> 42.666 ms
BSA_AV_UIPC_BUFFER_SIZE = 20001
I think the size 512 or 1024 is not the biggest size, but it is limited by PCM types.
for example : if we transfer the PCM data with a big frame, the big frame is composed of 16 frame, every frame has 32 slots, every slots has 8 bit sample data. so the big frame size is 16*32*8= 4096 bit , 512 bytes.
OK. Thanks for your reply!