summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungbae Shin <seungbae.shin@samsung.com>2017-01-06 21:22:17 +0900
committerSeungbae Shin <seungbae.shin@samsung.com>2017-01-06 21:22:17 +0900
commitf43ca3e85c32c5790392c21b01f094421bc4b744 (patch)
tree9374f9efadf1cec80622f66958335511d1e06e52
parent861168bc86820c7d9cda511428e025620a57def8 (diff)
parent5ca6991ba9e922909342d117c868067b5926b793 (diff)
downloadaudio-hal-sc7727-f43ca3e85c32c5790392c21b01f094421bc4b744.tar.gz
audio-hal-sc7727-f43ca3e85c32c5790392c21b01f094421bc4b744.tar.bz2
audio-hal-sc7727-f43ca3e85c32c5790392c21b01f094421bc4b744.zip
Merge branch 'tizen_3.0' into tizen
Change-Id: I868e7202a62ba5c56513a8d5774723b470efc966
-rw-r--r--packaging/audio-hal-sc7727.spec2
-rw-r--r--tizen-audio-routing.c10
-rw-r--r--tizen-audio-volume.c11
3 files changed, 20 insertions, 3 deletions
diff --git a/packaging/audio-hal-sc7727.spec b/packaging/audio-hal-sc7727.spec
index 4d49877..74ff5d2 100644
--- a/packaging/audio-hal-sc7727.spec
+++ b/packaging/audio-hal-sc7727.spec
@@ -1,6 +1,6 @@
Name: audio-hal-sc7727
Summary: TIZEN Audio HAL for SC7727
-Version: 0.1.19
+Version: 0.1.22
Release: 0
Group: System/Libraries
License: Apache-2.0
diff --git a/tizen-audio-routing.c b/tizen-audio-routing.c
index 960e55c..a9e8e47 100644
--- a/tizen-audio-routing.c
+++ b/tizen-audio-routing.c
@@ -286,7 +286,6 @@ static audio_return_t __update_route_fmradio(audio_hal_t *ah, device_info_t *dev
AUDIO_LOG_ERROR("Failed to _fmradio_pcm_open(): error = 0x%x", audio_ret);
return audio_ret;
}
- _audio_volume_set_level_radio(ah, 0);
}
audio_ret = __set_devices(ah, verb, devices, num_of_devices);
@@ -297,7 +296,6 @@ static audio_return_t __update_route_fmradio(audio_hal_t *ah, device_info_t *dev
/* FIXME. If necessary, set VERB_VOIP */
ah->device.mode = VERB_RADIO;
- _audio_volume_set_level_radio(ah, ah->volume.volume_level[AUDIO_VOLUME_TYPE_MEDIA]);
if ((audio_ret = __connect_fm_radio(ah)))
AUDIO_LOG_ERROR("failed to __connect_fm_radio(), ret(0x%x)", audio_ret);
@@ -499,5 +497,13 @@ audio_return_t audio_update_route_option(void *audio_handle, audio_route_option_
AUDIO_LOG_INFO("role:%s, name:%s, value:%d", option->role, option->name, option->value);
+ /* Handle RADIO MUTE due to earjack disconnection */
+ if ((option->role && strcmp(option->role, "radio") == 0) &&
+ (option->name && strcmp(option->name, "mute") == 0) &&
+ option->value == 1) {
+ AUDIO_LOG_INFO("MUTE RADIO!!!!");
+ audio_ret = _mixer_control_set_value(ah, MIXER_FMRADIO_MUTE, 0);
+ }
+
return audio_ret;
}
diff --git a/tizen-audio-volume.c b/tizen-audio-volume.c
index 18582de..a9c427a 100644
--- a/tizen-audio-volume.c
+++ b/tizen-audio-volume.c
@@ -42,6 +42,8 @@
#define RADIO_TUNING_VOLUME_TABLE "fmradio:volume_table"
#define RADIO_VOLUME_NUM_MAX 100
+uint32_t g_master_volume_level = 100;
+
static const char *g_volume_vconf[AUDIO_VOLUME_TYPE_MAX] = {
"file/private/sound/volume/system", /* AUDIO_VOLUME_TYPE_SYSTEM */
"file/private/sound/volume/notification", /* AUDIO_VOLUME_TYPE_NOTIFICATION */
@@ -474,6 +476,11 @@ audio_return_t audio_get_volume_level(void *audio_handle, audio_volume_info_t *i
AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(level, AUDIO_ERR_PARAMETER);
+ if (!strncmp(info->type, "master", strlen("master"))) {
+ *level = g_master_volume_level;
+ return AUDIO_RET_OK;
+ }
+
*level = ah->volume.volume_level[__get_volume_idx_by_string_type(info->type)];
AUDIO_LOG_INFO("get [%s] volume_level: %d, direction(%d)", info->type, *level, info->direction);
@@ -512,6 +519,10 @@ audio_return_t audio_set_volume_level(void *audio_handle, audio_volume_info_t *i
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER);
+ if (!strncmp(info->type, "master", strlen("master"))) {
+ g_master_volume_level = level;
+ return AUDIO_RET_OK;
+ }
AUDIO_RETURN_VAL_IF_FAIL((ah->volume.volume_level_max[__get_volume_idx_by_string_type(info->type)] >= level), AUDIO_ERR_PARAMETER);
/* Update volume level */