Merge "audio: miscellaneous fixes against iot changes" into audio-userspace.lnx.2.2-dev
This commit is contained in:
commit
fa60f451f3
|
@ -106,10 +106,11 @@
|
||||||
/* Set or Query stream profile type */
|
/* Set or Query stream profile type */
|
||||||
#define AUDIO_PARAMETER_STREAM_PROFILE "audio_stream_profile"
|
#define AUDIO_PARAMETER_STREAM_PROFILE "audio_stream_profile"
|
||||||
|
|
||||||
/* audio inout flag for timestamp mode.
|
/* audio input flags for compress and timestamp mode.
|
||||||
* check other input flags defined in audio.h for conflicts
|
* check other input flags defined in audio.h for conflicts
|
||||||
*/
|
*/
|
||||||
#define AUDIO_INPUT_FLAG_TIMESTAMP 0x80000000
|
#define AUDIO_INPUT_FLAG_TIMESTAMP 0x80000000
|
||||||
|
#define AUDIO_INPUT_FLAG_COMPRESS 0x40000000
|
||||||
|
|
||||||
/* MAX SECTORS for sourcetracking feature */
|
/* MAX SECTORS for sourcetracking feature */
|
||||||
#define MAX_SECTORS 8
|
#define MAX_SECTORS 8
|
||||||
|
|
|
@ -84,8 +84,7 @@ static pthread_mutex_t cin_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
bool audio_extn_cin_applicable_stream(struct stream_in *in)
|
bool audio_extn_cin_applicable_stream(struct stream_in *in)
|
||||||
{
|
{
|
||||||
if ((in->flags & AUDIO_INPUT_FLAG_TIMESTAMP) ||
|
if (in->flags & (AUDIO_INPUT_FLAG_COMPRESS | AUDIO_INPUT_FLAG_TIMESTAMP))
|
||||||
in->usecase == USECASE_AUDIO_RECORD_COMPRESS2)
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -380,9 +380,9 @@ static void send_app_type_cfg(void *platform, struct mixer *mixer,
|
||||||
if (app_type_cfg[i+1] == 0)
|
if (app_type_cfg[i+1] == 0)
|
||||||
break;
|
break;
|
||||||
else if (app_type_cfg[i+1] == (size_t)s_info->app_type_cfg.app_type) {
|
else if (app_type_cfg[i+1] == (size_t)s_info->app_type_cfg.app_type) {
|
||||||
if (app_type_cfg[i+2] < s_info->app_type_cfg.sample_rate)
|
if (app_type_cfg[i+2] < (size_t)s_info->app_type_cfg.sample_rate)
|
||||||
app_type_cfg[i+2] = s_info->app_type_cfg.sample_rate;
|
app_type_cfg[i+2] = s_info->app_type_cfg.sample_rate;
|
||||||
if (app_type_cfg[i+3] < s_info->app_type_cfg.bit_width)
|
if (app_type_cfg[i+3] < (size_t)s_info->app_type_cfg.bit_width)
|
||||||
app_type_cfg[i+3] = s_info->app_type_cfg.bit_width;
|
app_type_cfg[i+3] = s_info->app_type_cfg.bit_width;
|
||||||
update = false;
|
update = false;
|
||||||
break;
|
break;
|
||||||
|
@ -402,9 +402,9 @@ static void send_app_type_cfg(void *platform, struct mixer *mixer,
|
||||||
if (app_type_cfg[i+1] == 0)
|
if (app_type_cfg[i+1] == 0)
|
||||||
break;
|
break;
|
||||||
else if (app_type_cfg[i+1] == (size_t)s_info->app_type_cfg.app_type) {
|
else if (app_type_cfg[i+1] == (size_t)s_info->app_type_cfg.app_type) {
|
||||||
if (app_type_cfg[i+2] < s_info->app_type_cfg.sample_rate)
|
if (app_type_cfg[i+2] < (size_t)s_info->app_type_cfg.sample_rate)
|
||||||
app_type_cfg[i+2] = s_info->app_type_cfg.sample_rate;
|
app_type_cfg[i+2] = s_info->app_type_cfg.sample_rate;
|
||||||
if (app_type_cfg[i+3] < s_info->app_type_cfg.bit_width)
|
if (app_type_cfg[i+3] < (size_t)s_info->app_type_cfg.bit_width)
|
||||||
app_type_cfg[i+3] = s_info->app_type_cfg.bit_width;
|
app_type_cfg[i+3] = s_info->app_type_cfg.bit_width;
|
||||||
update = false;
|
update = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4742,23 +4742,6 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
|
||||||
in->realtime = may_use_noirq_mode(adev, in->usecase, in->flags);
|
in->realtime = may_use_noirq_mode(adev, in->usecase, in->flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_lock(&adev->lock);
|
|
||||||
if (in->usecase == USECASE_AUDIO_RECORD) {
|
|
||||||
if (!(adev->pcm_record_uc_state) &&
|
|
||||||
((flags & AUDIO_INPUT_FLAG_TIMESTAMP) == 0)) {
|
|
||||||
ALOGV("%s: pcm record usecase", __func__);
|
|
||||||
adev->pcm_record_uc_state = 1;
|
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* Assign default compress record use case, actual use case
|
|
||||||
* assignment will happen later.
|
|
||||||
*/
|
|
||||||
in->usecase = USECASE_AUDIO_RECORD_COMPRESS2;
|
|
||||||
ALOGV("%s: compress record usecase", __func__);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pthread_mutex_unlock(&adev->lock);
|
|
||||||
|
|
||||||
/* Update config params with the requested sample rate and channels */
|
/* Update config params with the requested sample rate and channels */
|
||||||
if ((in->device == AUDIO_DEVICE_IN_TELEPHONY_RX) &&
|
if ((in->device == AUDIO_DEVICE_IN_TELEPHONY_RX) &&
|
||||||
(adev->mode != AUDIO_MODE_IN_CALL)) {
|
(adev->mode != AUDIO_MODE_IN_CALL)) {
|
||||||
|
@ -4877,12 +4860,6 @@ static void adev_close_input_stream(struct audio_hw_device *dev,
|
||||||
audio_extn_compr_cap_format_supported(in->config.format))
|
audio_extn_compr_cap_format_supported(in->config.format))
|
||||||
audio_extn_compr_cap_deinit();
|
audio_extn_compr_cap_deinit();
|
||||||
|
|
||||||
if (in->usecase == USECASE_AUDIO_RECORD) {
|
|
||||||
pthread_mutex_lock(&adev->lock);
|
|
||||||
adev->pcm_record_uc_state = 0;
|
|
||||||
pthread_mutex_unlock(&adev->lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (audio_extn_cin_attached_usecase(in->usecase))
|
if (audio_extn_cin_attached_usecase(in->usecase))
|
||||||
audio_extn_cin_close_input_stream(in);
|
audio_extn_cin_close_input_stream(in);
|
||||||
|
|
||||||
|
@ -5014,7 +4991,6 @@ static int adev_open(const hw_module_t *module, const char *name,
|
||||||
list_init(&adev->usecase_list);
|
list_init(&adev->usecase_list);
|
||||||
adev->cur_wfd_channels = 2;
|
adev->cur_wfd_channels = 2;
|
||||||
adev->offload_usecases_state = 0;
|
adev->offload_usecases_state = 0;
|
||||||
adev->pcm_record_uc_state = 0;
|
|
||||||
adev->is_channel_status_set = false;
|
adev->is_channel_status_set = false;
|
||||||
adev->perf_lock_opts[0] = 0x101;
|
adev->perf_lock_opts[0] = 0x101;
|
||||||
adev->perf_lock_opts[1] = 0x20E;
|
adev->perf_lock_opts[1] = 0x20E;
|
||||||
|
|
|
@ -385,7 +385,6 @@ struct audio_device {
|
||||||
bool is_channel_status_set;
|
bool is_channel_status_set;
|
||||||
void *platform;
|
void *platform;
|
||||||
unsigned int offload_usecases_state;
|
unsigned int offload_usecases_state;
|
||||||
unsigned int pcm_record_uc_state;
|
|
||||||
void *visualizer_lib;
|
void *visualizer_lib;
|
||||||
int (*visualizer_start_output)(audio_io_handle_t, int);
|
int (*visualizer_start_output)(audio_io_handle_t, int);
|
||||||
int (*visualizer_stop_output)(audio_io_handle_t, int);
|
int (*visualizer_stop_output)(audio_io_handle_t, int);
|
||||||
|
|
|
@ -165,10 +165,11 @@ __BEGIN_DECLS
|
||||||
/* Set or Query stream profile type */
|
/* Set or Query stream profile type */
|
||||||
#define QAHW_PARAMETER_STREAM_PROFILE "audio_stream_profile"
|
#define QAHW_PARAMETER_STREAM_PROFILE "audio_stream_profile"
|
||||||
|
|
||||||
/* audio inout flag for timestamp mode.
|
/* audio input flags for compress and timestamp mode.
|
||||||
* check other input flags defined in audio.h for conflicts
|
* check other input flags defined in audio.h for conflicts
|
||||||
*/
|
*/
|
||||||
#define QAHW_INPUT_FLAG_TIMESTAMP 0x80000000
|
#define QAHW_INPUT_FLAG_TIMESTAMP 0x80000000
|
||||||
|
#define QAHW_INPUT_FLAG_COMPRESS 0x40000000
|
||||||
|
|
||||||
/* Query fm volume */
|
/* Query fm volume */
|
||||||
#define QAHW_PARAMETER_KEY_FM_VOLUME "fm_volume"
|
#define QAHW_PARAMETER_KEY_FM_VOLUME "fm_volume"
|
||||||
|
|
Loading…
Reference in New Issue