Handle route option update for Radio Mute when Earjack is disconnected 59/105059/1 accepted/tizen/3.0/mobile/20161216.015453 submit/tizen_3.0/20161215.083256
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 15 Dec 2016 08:25:07 +0000 (17:25 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 15 Dec 2016 08:25:07 +0000 (17:25 +0900)
[Version] 0.1.20
[Profile] Mobile
[Issue Type] PLM

Change-Id: I6fcf42be12e6268d73eacfbec22f2d91c030ddc8

packaging/audio-hal-sc7727.spec
tizen-audio-routing.c

index 4d49877..460b156 100644 (file)
@@ -1,6 +1,6 @@
 Name:       audio-hal-sc7727
 Summary:    TIZEN Audio HAL for SC7727
-Version:    0.1.19
+Version:    0.1.20
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 960e55c..a9e8e47 100644 (file)
@@ -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;
 }