hal: compilation fix for extended feature flags

- Fix compilation error for offload, Dolby,
  HDMI pass through, FLAC decoder, and hardware
  accelerated effects when extended feature
  flags are disabled.

Change-Id: If64d5fa5d124b42d40d7e123b887db8e0a5d7426
This commit is contained in:
Sharad Sangle 2015-06-18 15:58:55 +05:30 committed by Gerrit - the friendly Code Review server
parent f22706d0ab
commit b27354b10e
13 changed files with 44 additions and 8 deletions

View File

@ -46,6 +46,9 @@
#define AUDIO_FORMAT_PCM_24_BIT_OFFLOAD (AUDIO_FORMAT_PCM_OFFLOAD | AUDIO_FORMAT_PCM_SUB_8_24_BIT)
#define AUDIO_OFFLOAD_CODEC_FORMAT "music_offload_codec_format"
#define audio_is_offload_pcm(format) (0)
#define OFFLOAD_USE_SMALL_BUFFER false
#else
#define OFFLOAD_USE_SMALL_BUFFER (info->use_small_bufs)
#endif
#ifndef AFE_PROXY_ENABLED
@ -314,6 +317,9 @@ void audio_extn_check_and_set_dts_hpx_state(const struct audio_device *adev);
void audio_extn_dolby_set_dmid(struct audio_device *adev);
#else
#define audio_extn_dolby_set_dmid(adev) (0)
#define AUDIO_CHANNEL_OUT_PENTA (AUDIO_CHANNEL_OUT_QUAD | AUDIO_CHANNEL_OUT_FRONT_CENTER)
#define AUDIO_CHANNEL_OUT_SURROUND (AUDIO_CHANNEL_OUT_FRONT_LEFT | AUDIO_CHANNEL_OUT_FRONT_RIGHT | \
AUDIO_CHANNEL_OUT_FRONT_CENTER | AUDIO_CHANNEL_OUT_BACK_CENTER)
#endif
@ -360,6 +366,7 @@ void audio_extn_dolby_send_ddp_endp_params(struct audio_device *adev);
#define audio_extn_dolby_get_passt_buffer_size(info) (0)
#define audio_extn_dolby_set_passt_volume(out, mute) (0)
#define audio_extn_dolby_set_passt_latency(out, latency) (0)
#define AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH 0x4000
#else
int audio_extn_dolby_update_passt_formats(struct audio_device *adev,
struct stream_out *out);

View File

@ -2903,7 +2903,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
if (flags & AUDIO_OUTPUT_FLAG_NON_BLOCKING)
out->non_blocking = 1;
if (config->offload_info.use_small_bufs) {
if (platform_use_small_buffer(&config->offload_info)) {
//this flag is set from framework only if its for PCM formats
//no need to check for PCM format again
out->non_blocking = 0;

View File

@ -3345,7 +3345,7 @@ uint32_t platform_get_pcm_offload_buffer_size(audio_offload_info_t* info)
bits_per_sample = 32;
}
if (info->use_small_bufs) {
if (platform_use_small_buffer(info)) {
pcm_offload_time = PCM_OFFLOAD_BUFFER_DURATION_FOR_SMALL_BUFFERS;
} else {
if (!info->has_video) {
@ -3609,6 +3609,10 @@ int platform_set_usecase_pcm_id(audio_usecase_t usecase, int32_t type, int32_t p
done:
return ret;
}
bool platform_use_small_buffer(audio_offload_info_t* info)
{
return OFFLOAD_USE_SMALL_BUFFER;
}
void platform_get_device_to_be_id_map(int **device_to_be_id, int *length)
{

View File

@ -1107,6 +1107,11 @@ uint32_t platform_get_pcm_offload_buffer_size(audio_offload_info_t* info __unuse
return 0;
}
bool platform_use_small_buffer(audio_offload_info_t* info)
{
return false;
}
int platform_get_edid_info(void *platform __unused)
{
return -ENOSYS;

View File

@ -3064,6 +3064,11 @@ uint32_t platform_get_pcm_offload_buffer_size(audio_offload_info_t* info)
return fragment_size;
}
bool platform_use_small_buffer(audio_offload_info_t* info)
{
return OFFLOAD_USE_SMALL_BUFFER;
}
int platform_set_codec_backend_cfg(struct audio_device* adev,
unsigned int bit_width, unsigned int sample_rate)
{

View File

@ -89,6 +89,7 @@ int platform_info_init(const char *filename);
struct audio_offload_info_t;
uint32_t platform_get_compress_offload_buffer_size(audio_offload_info_t* info);
uint32_t platform_get_pcm_offload_buffer_size(audio_offload_info_t* info);
bool platform_use_small_buffer(audio_offload_info_t* info);
uint32_t platform_get_compress_passthrough_buffer_size(audio_offload_info_t* info);
bool platform_check_and_set_codec_backend_cfg(struct audio_device* adev, struct audio_usecase *usecase);

View File

@ -22,6 +22,7 @@
#define LOG_NDDEBUG 0
#include <errno.h>
#include <stdlib.h>
#include <math.h>
#include <cutils/log.h>
#include <cutils/str_parms.h>

View File

@ -14,8 +14,12 @@ LOCAL_SRC_FILES:= \
virtualizer.c \
reverb.c \
effect_api.c \
effect_util.c \
hw_accelerator.c
effect_util.c
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS)),true)
LOCAL_CFLAGS += -DHW_ACCELERATED_EFFECTS
LOCAL_SRC_FILES += hw_accelerator.c
endif
LOCAL_CFLAGS+= -O2 -fvisibility=hidden

View File

@ -43,7 +43,7 @@
#include <system/thread_defs.h>
#include <tinyalsa/asoundlib.h>
#include <hardware/audio_effect.h>
#include <stdlib.h>
#include "bundle.h"
#include "hw_accelerator.h"
#include "equalizer.h"
@ -69,7 +69,9 @@ const effect_descriptor_t *descriptors[] = {
&ins_env_reverb_descriptor,
&aux_preset_reverb_descriptor,
&ins_preset_reverb_descriptor,
#ifdef HW_ACCELERATED_EFFECTS
&hw_accelerator_descriptor,
#endif
NULL,
};
@ -604,6 +606,7 @@ int effect_lib_create(const effect_uuid_t *uuid,
reverb_preset_init(reverb_ctxt);
}
reverb_ctxt->ctl = NULL;
#ifdef HW_ACCELERATED_EFFECTS
} else if (memcmp(uuid, &hw_accelerator_descriptor.uuid,
sizeof(effect_uuid_t)) == 0) {
hw_accelerator_context_t *hw_acc_ctxt = (hw_accelerator_context_t *)
@ -625,6 +628,7 @@ int effect_lib_create(const effect_uuid_t *uuid,
context->ops.process = hw_accelerator_process;
context->desc = &hw_accelerator_descriptor;
#endif
} else {
return -EINVAL;
}
@ -910,7 +914,7 @@ int effect_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize,
add_effect_to_output(out_ctxt, context);
} break;
#ifdef HW_ACCELERATED_EFFECTS
case EFFECT_CMD_HW_ACC: {
ALOGV("EFFECT_CMD_HW_ACC cmdSize %d pCmdData %p, *replySize %d, pReplyData %p",
cmdSize, pCmdData, *replySize, pReplyData);
@ -925,6 +929,7 @@ int effect_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize,
context->hw_acc_enabled = (value > 0) ? true : false;
break;
}
#endif
default:
if (cmdCode >= EFFECT_CMD_FIRST_PROPRIETARY && context->ops.command)
status = context->ops.command(context, cmdCode, cmdSize,

View File

@ -27,7 +27,9 @@
/* Retry for delay for mixer open */
#define RETRY_NUMBER 10
#define RETRY_US 500000
#ifdef HW_ACCELERATED_EFFECTS
#define EFFECT_CMD_HW_ACC 20
#endif
#define MIXER_CARD 0
#define SOUND_CARD 0

View File

@ -60,7 +60,7 @@
#include <sound/audio_effects.h>
#include <sound/devdep_params.h>
#include <linux/msm_audio.h>
#include <errno.h>
#include "effect_api.h"
#ifdef DTS_EAGLE

View File

@ -17,6 +17,7 @@
#include <utils/Log.h>
#include <stdlib.h>
#include "effect_util.h"
#include <string.h>
#ifdef LOG_TAG
#undef LOG_TAG

View File

@ -17,6 +17,7 @@
#define LOG_TAG "voice_processing"
/*#define LOG_NDEBUG 0*/
#include <dlfcn.h>
#include <stdlib.h>
#include <cutils/log.h>
#include <cutils/list.h>
#include <hardware/audio_effect.h>