}
}
- MMRADIO_LOG_DEBUG("setting region - country: %d, de-emphasis: %d, band range: %d ~ %d KHz",
+ MMRADIO_LOG_INFO("setting region - country: %d, de-emphasis: %d, band range: %d ~ %d KHz",
radio->region_setting.country, radio->region_setting.deemphasis,
radio->region_setting.band_min, radio->region_setting.band_max);
ret = pthread_mutex_init(&radio->seek_cancel_mutex, NULL);
if (ret < 0) {
- MMRADIO_LOG_DEBUG("Mutex creation failed %d", ret);
+ MMRADIO_LOG_ERROR("Mutex creation failed %d", ret);
return MM_ERROR_RADIO_INTERNAL;
}
MMRADIO_LOG_ERROR("mmradio hal interface deinit failed");
return ret;
}
+
+ /* destroy command lock */
+ ret = pthread_mutex_destroy(&radio->cmd_lock);
+ if (ret) {
+ MMRADIO_LOG_ERROR("mutex destroy failed\n");
+ }
+
+ ret = pthread_mutex_destroy(&radio->volume_lock);
+ if (ret) {
+ MMRADIO_LOG_ERROR("volume mutex destroy failed\n");
+ }
+
#ifdef TIZEN_FEATURE_SOUND_FOCUS
ret = mmradio_sound_focus_deregister(&radio->sound_focus);
if (ret) {
MMRADIO_CHECK_INSTANCE(radio);
MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_SET_FREQ);
- MMRADIO_LOG_DEBUG("Setting %d frequency", freq);
+ MMRADIO_LOG_INFO("Setting %d frequency", freq);
radio->freq = freq;
}
/* update freq in handle */
+ MMRADIO_LOG_INFO("Updating %d frequency", freq);
radio->freq = freq;
*pFreq = (int)radio->freq;
}
radio->is_muted = TRUE;
+ MMRADIO_LOG_INFO("Radio mute state [%d]", radio->is_muted);
MMRADIO_LOG_FLEAVE();
return ret;
}
radio->is_muted = FALSE;
-
+ MMRADIO_LOG_INFO("Radio mute state [%d]", radio->is_muted);
MMRADIO_LOG_FLEAVE();
return ret;
MMRADIO_CHECK_INSTANCE(radio);
MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_START);
- MMRADIO_LOG_DEBUG("now tune to frequency : %d", radio->freq);
+ MMRADIO_LOG_INFO("now tune to frequency : %d", radio->freq);
#ifdef TIZEN_FEATURE_SOUND_FOCUS
if (radio->sound_focus.handle > 0) {
radio->seek_unmute = TRUE;
}
- MMRADIO_LOG_DEBUG("trying to seek. direction[0:UP/1:DOWN) %d", direction);
+ MMRADIO_LOG_INFO("trying to seek. direction[0:UP/1:DOWN) %d", direction);
radio->seek_direction = direction;
ret = pthread_create(&radio->seek_thread, NULL, (void *)__mmradio_seek_thread, (void *)radio);
ret = pthread_mutex_trylock(&radio->seek_cancel_mutex);
MMRADIO_LOG_DEBUG("try lock ret: %s (%d)", strerror_r(ret, str_error, sizeof(str_error)), ret);
if (ret == EBUSY) { /* it was already locked by other */
- MMRADIO_LOG_DEBUG("send SEEK ABORT with FMRX_PROPERTY_SEARCH_ABORT");
+ MMRADIO_LOG_WARNING("send SEEK ABORT with FMRX_PROPERTY_SEARCH_ABORT");
} else if (ret == 0) {
- MMRADIO_LOG_DEBUG("trylock is successful. unlock now");
+ MMRADIO_LOG_INFO("trylock is successful. unlock now");
pthread_mutex_unlock(&radio->seek_cancel_mutex);
} else {
MMRADIO_LOG_ERROR("trylock is failed but Not EBUSY. ret: %d", ret);
scan_tr_id = pthread_create(&radio->scan_thread, NULL, (void *)__mmradio_scan_thread, (void *)radio);
if (scan_tr_id != 0) {
- MMRADIO_LOG_DEBUG("failed to create thread : scan");
+ MMRADIO_LOG_ERROR("failed to create thread : scan");
return MM_ERROR_RADIO_NOT_INITIALIZED;
}
ret = pthread_mutex_trylock(&radio->seek_cancel_mutex);
MMRADIO_LOG_DEBUG("try lock ret: %s (%d)", strerror_r(ret, str_error, sizeof(str_error)), ret);
if (ret == EBUSY) { /* it was already locked by other */
- MMRADIO_LOG_DEBUG("send SEEK ABORT with FMRX_PROPERTY_SEARCH_ABORT");
+ MMRADIO_LOG_WARNING("send SEEK ABORT with FMRX_PROPERTY_SEARCH_ABORT");
} else if (ret == 0) {
- MMRADIO_LOG_DEBUG("trylock is successful. unlock now");
+ MMRADIO_LOG_INFO("trylock is successful. unlock now");
pthread_mutex_unlock(&radio->seek_cancel_mutex);
} else {
MMRADIO_LOG_ERROR("trylock is failed but Not EBUSY. ret: %d", ret);
pthread_mutex_lock(&radio->seek_cancel_mutex);
if (radio->stop_scan) {
- MMRADIO_LOG_DEBUG("scan was canceled");
+ MMRADIO_LOG_INFO("scan was canceled");
pthread_mutex_unlock(&radio->seek_cancel_mutex);
goto FINISHED;
}
continue;
prev_freq = param.radio_scan.frequency = (int)freq;
- MMRADIO_LOG_DEBUG("scanning : new frequency : [%d]", param.radio_scan.frequency);
+ MMRADIO_LOG_INFO("scanning : new frequency : [%d]", param.radio_scan.frequency);
/* drop if max freq is scanned */
if (param.radio_scan.frequency == radio->region_setting.band_max) {
- MMRADIO_LOG_DEBUG("%d freq is dropping...and stopping scan", param.radio_scan.frequency);
+ MMRADIO_LOG_WARNING("%d freq is dropping...and stopping scan", param.radio_scan.frequency);
break;
}
MMRADIO_LOG_DEBUG("seek start");
if (radio->seek_cancel) {
- MMRADIO_LOG_DEBUG("seek was canceled so we return failure to application");
+ MMRADIO_LOG_INFO("seek was canceled so we return failure to application");
pthread_mutex_unlock(&radio->seek_cancel_mutex);
goto SEEK_FAILED;
}
/* if same freq is found, ignore it and search next one. */
if (freq == radio->prev_seek_freq) {
- MMRADIO_LOG_DEBUG("It's same with previous found one. So, trying next one.");
+ MMRADIO_LOG_WARNING("It's same with previous found one. So, trying next one.");
goto SEEK_FAILED;
}
}
param.radio_scan.frequency = radio->prev_seek_freq = (int)freq;
- MMRADIO_LOG_DEBUG("seeking : new frequency : [%d]", param.radio_scan.frequency);
+ MMRADIO_LOG_INFO("seeking : new frequency : [%d]", param.radio_scan.frequency);
MMRADIO_POST_MSG(radio, MM_MESSAGE_RADIO_SEEK_FINISH, ¶m);
}
radio_state = __mmradio_get_state(radio);
- MMRADIO_LOG_DEBUG("incomming command : %d current state : %d", command, radio_state);
+ MMRADIO_LOG_INFO("incomming command : %d current state : %d", command, radio_state);
switch (command) {
case MMRADIO_COMMAND_CREATE:
{
MMRADIO_CHECK_INSTANCE(radio);
- MMRADIO_LOG_DEBUG("radio state : current : [%d] old : [%d] pending : [%d]",
+ MMRADIO_LOG_INFO("radio state : current : [%d] old : [%d] pending : [%d]",
radio->current_state, radio->old_state, radio->pending_state);
return radio->current_state;
MMRADIO_LOG_FENTER();
MMRADIO_CHECK_INSTANCE_RETURN_VOID(radio);
+ MMRADIO_LOG_INFO("focus_state [%d]", focus_state);
mmradio_get_sound_focus_reason(focus_state, reason_for_change, FALSE, &event_source, &postMsg);
radio->sound_focus.event_src = event_source;
MMRADIO_LOG_FENTER();
MMRADIO_CHECK_INSTANCE_RETURN_VOID(radio);
+ MMRADIO_LOG_INFO("focus_state [%d]", focus_state);
mmradio_get_sound_focus_reason(focus_state, reason_for_change, TRUE, &event_source, &postMsg);
radio->sound_focus.event_src = event_source;
int ret = MM_ERROR_NONE;
MMRADIO_CHECK_INSTANCE_RETURN_VOID(radio);
if (type == VOLUME_TYPE_MEDIA) {
- MMRADIO_LOG_DEBUG("Change FM Radio volume to %d", volume);
+ MMRADIO_LOG_INFO("Change FM Radio volume to %d", volume);
ret = __mmradio_set_media_volume(radio, volume);
if (ret != MM_ERROR_NONE)
MMRADIO_LOG_ERROR("__mmradio_set_media_volume error");
MMRADIO_CHECK_INSTANCE(radio);
MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_SET_VOLUME);
- MMRADIO_LOG_DEBUG("Setting %f volume", volume);
+ MMRADIO_LOG_INFO("Setting %f volume", volume);
MMRADIO_VOLUME_LOCK(radio);
radio->local_volume = volume;
MMRADIO_CHECK_INSTANCE(radio);
MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_SET_VOLUME);
- MMRADIO_LOG_DEBUG("Setting %d volume", level);
+ MMRADIO_LOG_INFO("Setting %d volume", level);
MMRADIO_VOLUME_LOCK(radio);
radio->media_volume = level;
MMRADIO_LOG_FENTER();
MMRADIO_CHECK_INSTANCE_RETURN_VOID(radio);
+ MMRADIO_LOG_INFO("device [%d] is_connected [%d]", device, is_connected);
if (mm_sound_get_device_type(device, &type) != MM_ERROR_NONE) {
MMRADIO_LOG_ERROR("getting device type failed");
mm_radio_sound_focus *sound_focus = (mm_radio_sound_focus *)user_data;
int ret = MM_ERROR_NONE;
- MMRADIO_LOG_DEBUG("sound signal callback %d / %d", signal, value);
+ MMRADIO_LOG_INFO("sound signal callback %d / %d", signal, value);
if (signal == MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS) {
if (value == 1) {
/* read session information */
ret = _mm_session_util_read_information(pid, &session_type, &session_flags);
- MMRADIO_LOG_DEBUG("Read Session type ret:0x%X", ret);
+ MMRADIO_LOG_INFO("Read Session type ret:0x%X", ret);
if (ret == MM_ERROR_INVALID_HANDLE) {
MMRADIO_LOG_WARNING("subscribe_id=%d", sound_focus->subscribe_id);
if (sound_focus->subscribe_id == 0) {
MMRADIO_LOG_ERROR("mm_sound_set_focus_watch_callback is failed");
return MM_ERROR_POLICY_BLOCKED;
}
- MMRADIO_LOG_DEBUG("(%p) set focus watch callback = %d", param, sound_focus->watch_id);
+ MMRADIO_LOG_INFO("(%p) set focus watch callback = %d", param, sound_focus->watch_id);
/* register device connected callback */
ret = mm_sound_add_device_connected_callback(MM_SOUND_DEVICE_TYPE_EXTERNAL_FLAG,
MMRADIO_LOG_ERROR("mm_sound_add_device_connected_callback is failed");
return MM_ERROR_POLICY_BLOCKED;
}
- MMRADIO_LOG_ERROR("register device connected callback for the value is 0, sub_cb id %d", sound_focus->device_subs_id);
+ MMRADIO_LOG_INFO("register device connected callback for the value is 0, sub_cb id %d", sound_focus->device_subs_id);
}
ret = MM_ERROR_NONE;
} else if (ret == MM_ERROR_NONE) {
ret = mm_sound_register_focus_for_session(handle, pid, "radio", focus_cb, param);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_DEBUG("mm_sound_register_focus_for_session is failed");
+ MMRADIO_LOG_ERROR("mm_sound_register_focus_for_session is failed");
return MM_ERROR_POLICY_BLOCKED;
}
MMRADIO_LOG_DEBUG("(%p) register focus for session %d", param, pid);
MMRADIO_LOG_ERROR("mm_sound_add_device_connected_callback is failed");
return MM_ERROR_POLICY_BLOCKED;
}
- MMRADIO_LOG_DEBUG("(%p) add device connected callback = %d", param, sound_focus->device_subs_id);
+ MMRADIO_LOG_INFO("(%p) add device connected callback = %d", param, sound_focus->device_subs_id);
}
} else if (sound_focus->session_type == MM_SESSION_TYPE_REPLACED_BY_STREAM) {
/* didn't register device connected cb */
}
if (sound_focus->watch_id > 0) {
- MMRADIO_LOG_DEBUG("unset the focus watch cb %d", sound_focus->watch_id);
+ MMRADIO_LOG_INFO("unset the focus watch cb %d", sound_focus->watch_id);
ret = mm_sound_unset_focus_watch_callback(sound_focus->watch_id);
sound_focus->watch_id = 0;
}
/* unregister device connected callback */
if (sound_focus->device_subs_id > 0) {
- MMRADIO_LOG_DEBUG("unset the device connected cb %d", sound_focus->device_subs_id);
+ MMRADIO_LOG_INFO("unset the device connected cb %d", sound_focus->device_subs_id);
ret = mm_sound_remove_device_connected_callback(sound_focus->device_subs_id);
sound_focus->device_subs_id = 0;
if (ret != MM_ERROR_NONE)
}
if (sound_focus->subscribe_id > 0) {
- MMRADIO_LOG_DEBUG("unset mm_sound_subscribe_signal_for_daemon %d", sound_focus->subscribe_id);
+ MMRADIO_LOG_INFO("unset mm_sound_subscribe_signal_for_daemon %d", sound_focus->subscribe_id);
mm_sound_unsubscribe_signal(sound_focus->subscribe_id);
}