summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJie Yang <yang.jie@intel.com>2013-07-04 08:17:37 (GMT)
committerZhang,Vivian <vivian.zhang@intel.com>2013-09-17 08:30:53 (GMT)
commitfa2c136c9a952613960767defe36d9b45105edec (patch)
tree7208406f8696b95cb7f6801e98b2c447798b1d78
parent1766b71ebba67443ca88f489b78abaa016eee3b3 (diff)
downloadavsystem-devel/audiohwdec.zip
avsystem-devel/audiohwdec.tar.gz
avsystem-devel/audiohwdec.tar.bz2
Add AVSYS_AUDIO_MODE_OUTPUT_DSP mode for PA control on "Audio DSP hardware decoding" stream.devel/audiohwdec
Change-Id: Iddf8835fe4d4680dffb045943beff26131c2029a
-rwxr-xr-x[-rw-r--r--]avsys-audio-handle.c5
-rwxr-xr-x[-rw-r--r--]avsys-audio-pasimple.c8
-rwxr-xr-x[-rw-r--r--]avsys-audio.c5
-rwxr-xr-x[-rw-r--r--]include/avsys-audio.h1
4 files changed, 15 insertions, 4 deletions
diff --git a/avsys-audio-handle.c b/avsys-audio-handle.c
index 1232c92..df070d2 100644..100755
--- a/avsys-audio-handle.c
+++ b/avsys-audio-handle.c
@@ -853,7 +853,8 @@ int avsys_audio_handle_current_playing_volume_type(int *type)
if(control->handles[i].mode == AVSYS_AUDIO_MODE_OUTPUT ||
control->handles[i].mode == AVSYS_AUDIO_MODE_OUTPUT_CLOCK ||
control->handles[i].mode == AVSYS_AUDIO_MODE_OUTPUT_VIDEO ||
- control->handles[i].mode == AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY ) {
+ control->handles[i].mode == AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY ||
+ control->handles[i].mode == AVSYS_AUDIO_MODE_OUTPUT_DSP ) {
used_table[vol_conf_type] = 1;
}
else if(control->handles[i].mode == AVSYS_AUDIO_MODE_INPUT ||
@@ -971,7 +972,7 @@ int avsys_audio_handle_update_volume_by_type(const int volume_type, const int vo
mode = control->handles[i].mode;
if (mode != AVSYS_AUDIO_MODE_OUTPUT && mode != AVSYS_AUDIO_MODE_OUTPUT_CLOCK
&& mode != AVSYS_AUDIO_MODE_OUTPUT_VIDEO && mode != AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY
- && mode != AVSYS_AUDIO_MODE_OUTPUT_AP_CALL) {
+ && mode != AVSYS_AUDIO_MODE_OUTPUT_AP_CALL && mode != AVSYS_AUDIO_MODE_OUTPUT_DSP) {
continue;
}
diff --git a/avsys-audio-pasimple.c b/avsys-audio-pasimple.c
index aeeb999..39c10cc 100644..100755
--- a/avsys-audio-pasimple.c
+++ b/avsys-audio-pasimple.c
@@ -70,6 +70,7 @@ do { \
#define MEDIA_POLICY_AUTO "auto"
#define MEDIA_POLICY_PHONE "phone"
#define MEDIA_POLICY_ALL "all"
+#define MEDIA_ROLE_FILTER "filter"
int avsys_audio_pasimple_open_device(const int mode, const unsigned int format, const unsigned int channel, const unsigned int samplerate, avsys_audio_handle_t *handle, int policy)
{
@@ -199,6 +200,13 @@ int avsys_audio_pasimple_open_device(const int mode, const unsigned int format,
s = pa_simple_new_proplist(NULL, "AVSYSTEM", PA_STREAM_PLAYBACK, NULL, "PLAYBACK", &ss, &channel_map, &attr, proplist, &err);
break;
+ case AVSYS_AUDIO_MODE_OUTPUT_DSP: /* audio dsp hw decoding case. */
+ avsys_info(AVAUDIO, ": set media role to filter\n");
+ pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, MEDIA_ROLE_FILTER);
+
+ s = pa_simple_new_proplist(NULL, "AVSYSTEM", PA_STREAM_PLAYBACK, NULL, "DSP PLAYBACK", &ss, &channel_map, &attr, proplist, &err);
+ break;
+
case AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY: /* This is special case for touch sound playback */
SET_PA_ATTR(PA_SIMPLE_PERIOD_TIME_FOR_LOW_LATENCY_MSEC,
MSEC_TO_SAMPLE(samplerate,period_time),
diff --git a/avsys-audio.c b/avsys-audio.c
index 39dd1c8..92da619 100644..100755
--- a/avsys-audio.c
+++ b/avsys-audio.c
@@ -148,7 +148,7 @@ int avsys_audio_open(avsys_audio_param_t *param, avsys_handle_t *phandle, int *s
goto error;
}
- if (p->mode == AVSYS_AUDIO_MODE_OUTPUT || p->mode == AVSYS_AUDIO_MODE_OUTPUT_CLOCK ||
+ if (p->mode == AVSYS_AUDIO_MODE_OUTPUT || p->mode == AVSYS_AUDIO_MODE_OUTPUT_CLOCK || p->mode == AVSYS_AUDIO_MODE_OUTPUT_DSP ||
p->mode == AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY || p->mode == AVSYS_AUDIO_MODE_OUTPUT_AP_CALL || p->mode == AVSYS_AUDIO_MODE_OUTPUT_VIDEO) {
/* set volume table */
err = avsys_audio_path_set_volume(handle);
@@ -178,6 +178,7 @@ int avsys_audio_open(avsys_audio_param_t *param, avsys_handle_t *phandle, int *s
case AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY:
case AVSYS_AUDIO_MODE_OUTPUT_VIDEO:
case AVSYS_AUDIO_MODE_OUTPUT_AP_CALL:
+ case AVSYS_AUDIO_MODE_OUTPUT_DSP:
if (AVSYS_FAIL(avsys_audio_pasimple_set_volume(p, p->working_vol.level[AVSYS_AUDIO_CHANNEL_LEFT]))) {
avsys_error(AVAUDIO, "can not set volume in %s\n", __func__);
}
@@ -283,7 +284,7 @@ int avsys_audio_update_volume_config(avsys_handle_t handle, int volume_config)
if (p->mode == AVSYS_AUDIO_MODE_OUTPUT || p->mode == AVSYS_AUDIO_MODE_OUTPUT_CLOCK
|| p->mode == AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY || p->mode == AVSYS_AUDIO_MODE_OUTPUT_AP_CALL
- || p->mode == AVSYS_AUDIO_MODE_OUTPUT_VIDEO) {
+ || p->mode == AVSYS_AUDIO_MODE_OUTPUT_VIDEO || p->mode == AVSYS_AUDIO_MODE_OUTPUT_DSP) {
p->gain_setting.volume_config = volume_config;
/* update volume by type */
err = avsys_audio_handle_update_volume(p, p->gain_setting.volume_config);
diff --git a/include/avsys-audio.h b/include/avsys-audio.h
index 51b151c..5a297d6 100644..100755
--- a/include/avsys-audio.h
+++ b/include/avsys-audio.h
@@ -56,6 +56,7 @@ enum avsys_audio_mode_t {
AVSYS_AUDIO_MODE_OUTPUT_CLOCK, /**< Output mode of gst audio only mode */
AVSYS_AUDIO_MODE_OUTPUT_VIDEO, /**< Output mode of gst video mode */
AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY, /**< Output mode for low latency play mode. typically for game */
+ AVSYS_AUDIO_MODE_OUTPUT_DSP, /**< Output mode for audio dsp hardware decoding */
AVSYS_AUDIO_MODE_INPUT, /**< Input mode of handle */
AVSYS_AUDIO_MODE_INPUT_HIGH_LATENCY, /**< Input mode for high latency capture mode. */
AVSYS_AUDIO_MODE_INPUT_LOW_LATENCY, /**< Input mode for low latency capture mode. typically for VoIP */