Loading hal/msm8916/platform.c +7 −3 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ #define MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE (2 * 1024) #define MAX_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE (8 * 1024) #define ALIGN( num, to ) (((num) + (to-1)) & (~(to-1))) #define DIV_ROUND_UP(x, y) (((x) + (y) - 1)/(y)) #define ALIGN(x, y) ((y) * DIV_ROUND_UP((x), (y))) /* * This file will have a maximum of 38 bytes: * Loading Loading @@ -3273,12 +3274,15 @@ 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; // 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) fragment_size = MAX_PCM_OFFLOAD_FRAGMENT_SIZE; // To have same PCM samples for all channels, the buffer size requires to // be multiple of (number of channels * bytes per sample) // For writes to succeed, the buffer must be written at address which is multiple of 32 // Alignment of 96 satsfies both of the above requirements fragment_size = ALIGN(fragment_size, 96); ALOGI("PCM offload Fragment size to %d bytes", fragment_size); return fragment_size; Loading Loading
hal/msm8916/platform.c +7 −3 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ #define MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE (2 * 1024) #define MAX_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE (8 * 1024) #define ALIGN( num, to ) (((num) + (to-1)) & (~(to-1))) #define DIV_ROUND_UP(x, y) (((x) + (y) - 1)/(y)) #define ALIGN(x, y) ((y) * DIV_ROUND_UP((x), (y))) /* * This file will have a maximum of 38 bytes: * Loading Loading @@ -3273,12 +3274,15 @@ 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; // 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) fragment_size = MAX_PCM_OFFLOAD_FRAGMENT_SIZE; // To have same PCM samples for all channels, the buffer size requires to // be multiple of (number of channels * bytes per sample) // For writes to succeed, the buffer must be written at address which is multiple of 32 // Alignment of 96 satsfies both of the above requirements fragment_size = ALIGN(fragment_size, 96); ALOGI("PCM offload Fragment size to %d bytes", fragment_size); return fragment_size; Loading