hal: align fragment size to 24 instead of 1024 for PCM offload
Aligning PCM buffer size to 1024 bytes is not required in case of PCM offloading. It actually creates problem when playing 6 ch, 96KHz, 16-bit stream PCM in offload mode, due to aligning PCM data becomes unequal for the six channels. Align the buffer to LCM of 2, 4, 6, 8 i.e. 24. Change-Id: I0823ca2ccdd5fceaf23a182b763a1d69f91f602f
This commit is contained in:
parent
bd5ad8fcc4
commit
3b79cccffa
|
@ -2927,9 +2927,8 @@ uint32_t platform_get_pcm_offload_buffer_size(audio_offload_info_t* info)
|
|||
* info->sample_rate
|
||||
* (bits_per_sample >> 3)
|
||||
* popcount(info->channel_mask))/1000;
|
||||
|
||||
fragment_size = ALIGN (fragment_size, 1024);
|
||||
|
||||
// align with LCM of 2, 4, 6, 8
|
||||
fragment_size = ALIGN( fragment_size, 24 );
|
||||
if(fragment_size < MIN_PCM_OFFLOAD_FRAGMENT_SIZE)
|
||||
fragment_size = MIN_PCM_OFFLOAD_FRAGMENT_SIZE;
|
||||
else if(fragment_size > MAX_PCM_OFFLOAD_FRAGMENT_SIZE)
|
||||
|
|
Loading…
Reference in New Issue