/* chech device is opened or not. if it's not ready, skip to apply region to device now */
if (radio->radio_fd < 0) {
- MMRADIO_LOG_DEBUG("not opened device. just updating region info. \n");
+ MMRADIO_LOG_DEBUG("not opened device. just updating region info.");
return MM_ERROR_NONE;
}
int _mmradio_create_radio(mm_radio_t * radio)
{
- int ret = 0;
+ int ret = MM_ERROR_NONE;
MMRADIO_LOG_FENTER();
/* create command lock */
ret = pthread_mutex_init(&radio->cmd_lock, NULL);
if (ret) {
- MMRADIO_LOG_ERROR("mutex creation failed\n");
+ MMRADIO_LOG_ERROR("failed to create mutex");
return MM_ERROR_RADIO_INTERNAL;
}
/* initialize resource manager */
ret = mmradio_resource_manager_init(&(radio->resource_manager), radio);
if (ret) {
- MMRADIO_LOG_ERROR("failed to initialize resource manager\n");
+ MMRADIO_LOG_ERROR("failed to initialize resource manager");
return MM_ERROR_RADIO_INTERNAL;
}
if (ret) {
/* NOTE : we are dealing it as an error since we cannot expect it's behavior */
- MMRADIO_LOG_ERROR("mmradio_audio_focus_register is failed\n");
+ MMRADIO_LOG_ERROR("failed to register sound focus");
return MM_ERROR_RADIO_INTERNAL;
}
#endif
return MM_ERROR_NONE;
}
-int _mmradio_realize(mm_radio_t * radio)
+int _mmradio_realize(mm_radio_t *radio)
{
int ret = MM_ERROR_NONE;
/* open device */
radio->radio_fd = 11;
- MMRADIO_LOG_DEBUG("radio device fd : %d\n", radio->radio_fd);
+ MMRADIO_LOG_DEBUG("radio device fd : %d", radio->radio_fd);
/* check region country type if it's updated or not */
if (radio->region_setting.country == MM_RADIO_REGION_GROUP_NONE) {
#ifdef USE_GST_PIPELINE
ret = _mmradio_realize_pipeline(radio);
if (ret) {
- MMRADIO_LOG_ERROR("_mmradio_realize_pipeline is failed\n");
+ MMRADIO_LOG_ERROR("failed to realize pipeline");
return ret;
}
#endif
#ifdef TIZEN_FEATURE_SOUND_FOCUS
ret = mmradio_release_sound_focus(&radio->sound_focus);
if (ret) {
- MMRADIO_LOG_ERROR("mmradio_release_sound_focus is failed\n");
+ MMRADIO_LOG_ERROR("failed to release sound focus");
return ret;
}
#endif
#ifdef USE_GST_PIPELINE
ret = _mmradio_destroy_pipeline(radio);
if (ret) {
- MMRADIO_LOG_ERROR("_mmradio_destroy_pipeline is failed\n");
+ MMRADIO_LOG_ERROR("failed to destroy pipeline");
return ret;
}
#endif
MMRADIO_LOG_FLEAVE();
- return MM_ERROR_NONE;
+ return ret;
}
int _mmradio_destroy(mm_radio_t * radio)
int ret = 0;
ret = mmradio_sound_focus_deregister(&radio->sound_focus);
if (ret) {
- MMRADIO_LOG_ERROR("failed to deregister sound focus\n");
+ MMRADIO_LOG_ERROR("failed to deregister sound focus");
return MM_ERROR_RADIO_INTERNAL;
}
#endif
ret = mmradio_resource_manager_deinit(&radio->resource_manager);
if (ret) {
- MMRADIO_LOG_ERROR("failed to initialize resource manager\n");
+ MMRADIO_LOG_ERROR("failed to deinitialize resource manager");
return MM_ERROR_RADIO_INTERNAL;
}
MMRADIO_CHECK_INSTANCE(radio);
MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_SET_FREQ);
- MMRADIO_SLOG_DEBUG("Setting %d frequency\n", freq);
- MMRADIO_LOG_DEBUG("radio->freq: %d freq: %d\n", radio->freq, freq);
+ MMRADIO_SLOG_DEBUG("Setting %d frequency", freq);
+ MMRADIO_LOG_DEBUG("radio->freq: %d freq: %d", radio->freq, freq);
if (radio->radio_fd < 0) {
- MMRADIO_LOG_DEBUG("radio device is not opened yet\n");
+ MMRADIO_LOG_DEBUG("radio device is not opened yet");
return MM_ERROR_NONE;
}
/* check frequency range */
if (freq < radio->region_setting.band_min || freq > radio->region_setting.band_max) {
- MMRADIO_LOG_ERROR("out of frequency range\n", freq);
+ MMRADIO_LOG_ERROR("out of frequency range", freq);
return MM_ERROR_INVALID_ARGUMENT;
}
/* just return stored frequency if radio device is not ready */
if (radio->radio_fd < 0) {
- MMRADIO_SLOG_DEBUG("freq : %d\n", radio->freq);
+ MMRADIO_SLOG_DEBUG("freq : %d", radio->freq);
*pFreq = radio->freq;
return MM_ERROR_NONE;
}
#ifdef USE_GST_PIPELINE
if (radio->pGstreamer_s) {
g_object_set(radio->pGstreamer_s->volume, "mute", 1, NULL);
- MMRADIO_LOG_DEBUG("g_object set mute\n");
+ MMRADIO_LOG_DEBUG("g_object set mute");
}
#endif
MMRADIO_LOG_FLEAVE();
#ifdef USE_GST_PIPELINE
if (radio->pGstreamer_s) {
g_object_set(radio->pGstreamer_s->volume, "mute", 0, NULL);
- MMRADIO_LOG_DEBUG("g_object set un-mute\n");
+ MMRADIO_LOG_DEBUG("g_object set unmute");
}
#endif
break;
default:
- MMRADIO_LOG_ERROR("not availabe de-emphasis value\n");
+ MMRADIO_LOG_ERROR("not availabe de-emphasis value");
return MM_ERROR_COMMON_INVALID_ARGUMENT;
}
radio->msg_cb = callback;
radio->msg_cb_param = user_param;
- MMRADIO_LOG_DEBUG("msg_cb : 0x%x msg_cb_param : 0x%x\n", callback, user_param);
+ MMRADIO_LOG_DEBUG("msg_cb : 0x%x msg_cb_param : 0x%x", callback, user_param);
MMRADIO_LOG_FLEAVE();
MMRADIO_CHECK_INSTANCE(radio);
MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_START);
- MMRADIO_SLOG_DEBUG("now tune to frequency : %d\n", radio->freq);
+ MMRADIO_SLOG_DEBUG("now tune to frequency : %d", radio->freq);
ret = mmradio_resource_manager_prepare(&radio->resource_manager, MM_RADIO_RESOURCE_TYPE_RADIO);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("resource manager prepare fail");
+ MMRADIO_LOG_ERROR("failed to prepare resource manager");
return MM_ERROR_RADIO_INTERNAL;
}
if (radio->sound_focus.handle > 0) {
ret = mmradio_acquire_sound_focus(&radio->sound_focus);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("failed to set sound focus");
+ MMRADIO_LOG_ERROR("failed to acquire sound focus");
return ret;
}
}
#ifdef USE_GST_PIPELINE
ret = _mmradio_start_pipeline(radio);
if (ret) {
- MMRADIO_LOG_ERROR("_mmradio_start_pipeline is failed\n");
+ MMRADIO_LOG_ERROR("failed to start pipeline");
return ret;
}
#endif
if (resource_state == MM_RADIO_RESOURCE_STATE_PREPARED) {
ret = mmradio_resource_manager_unprepare(&radio->resource_manager);
if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_ERROR("resource manager unprepare fail");
+ MMRADIO_LOG_ERROR("failed to unprepare resource manager");
}
}
if (radio->sound_focus.handle > 0) {
ret = mmradio_release_sound_focus(&radio->sound_focus);
if (ret) {
- MMRADIO_LOG_ERROR("mmradio_release_audio_focus is failed\n");
+ MMRADIO_LOG_ERROR("failed to release sound focus");
return ret;
}
}
#ifdef USE_GST_PIPELINE
ret = _mmradio_stop_pipeline(radio);
if (ret) {
- MMRADIO_LOG_ERROR("_mmradio_stop_pipeline is failed\n");
+ MMRADIO_LOG_ERROR("failed to stop pipeline");
return ret;
}
#endif
g_object_set(radio->pGstreamer_s->audiosrc, "wave", val, "volume", 0.8, NULL);
if (!radio->pGstreamer_s->pipeline || !radio->pGstreamer_s->audiosrc || !radio->pGstreamer_s->queue2 || !radio->pGstreamer_s->volume || !radio->pGstreamer_s->audiosink) {
- MMRADIO_LOG_DEBUG("One element could not be created. Exiting.\n");
+ MMRADIO_LOG_DEBUG("One element could not be created. Exiting.");
return MM_ERROR_RADIO_NOT_INITIALIZED;
}
radio->pGstreamer_s->volume,
radio->pGstreamer_s->audiosink,
NULL)) {
- MMRADIO_LOG_DEBUG("Fail to link error (src - queue - volue - sink)\n");
+ MMRADIO_LOG_DEBUG("failed to element link (src - queue - volue - sink)");
return MM_ERROR_RADIO_NOT_INITIALIZED;
}
MMRADIO_LOG_FLEAVE();
MMRADIO_LOG_FENTER();
if (gst_element_set_state(radio->pGstreamer_s->pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
- MMRADIO_LOG_ERROR("Fail to change pipeline state");
+ MMRADIO_LOG_ERROR("failed to change pipeline state");
gst_object_unref(radio->pGstreamer_s->pipeline);
g_free(radio->pGstreamer_s);
return MM_ERROR_RADIO_INVALID_STATE;
g_free(radio->pGstreamer_s);
return MM_ERROR_RADIO_INVALID_STATE;
} else {
- MMRADIO_LOG_DEBUG("GST_STATE_NULL ret_state = %d (GST_STATE_CHANGE_SUCCESS)\n", ret_state);
+ MMRADIO_LOG_DEBUG("GST_STATE_NULL ret_state = %d (GST_STATE_CHANGE_SUCCESS)", ret_state);
}
MMRADIO_LOG_FLEAVE();
g_free(radio->pGstreamer_s);
return MM_ERROR_RADIO_INVALID_STATE;
} else {
- MMRADIO_LOG_DEBUG("GST_STATE_NULL ret_state = %d (GST_STATE_CHANGE_SUCCESS)\n", ret_state);
+ MMRADIO_LOG_DEBUG("GST_STATE_NULL ret_state = %d (GST_STATE_CHANGE_SUCCESS)", ret_state);
}
MMRADIO_LOG_FLEAVE();
return ret;
MMRADIO_LOG_FENTER();
if (gst_element_set_state(radio->pGstreamer_s->pipeline, GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE) {
- MMRADIO_LOG_DEBUG("Fail to change pipeline state");
+ MMRADIO_LOG_DEBUG("failed to change pipeline state");
gst_object_unref(radio->pGstreamer_s->pipeline);
g_free(radio->pGstreamer_s);
return MM_ERROR_RADIO_INVALID_STATE;
g_free(radio->pGstreamer_s);
return MM_ERROR_RADIO_INVALID_STATE;
} else {
- MMRADIO_LOG_DEBUG("GST_STATE_NULL ret_state = %d (GST_STATE_CHANGE_SUCCESS)\n", ret_state);
+ MMRADIO_LOG_DEBUG("GST_STATE_NULL ret_state = %d (GST_STATE_CHANGE_SUCCESS)", ret_state);
}
gst_object_unref(radio->pGstreamer_s->pipeline);
/* if( _mmradio_mute(radio) != MM_ERROR_NONE) */
/* return MM_ERROR_RADIO_NOT_INITIALIZED; */
- MMRADIO_SLOG_DEBUG("trying to seek. direction[0:UP/1:DOWN) %d\n", direction);
+ MMRADIO_SLOG_DEBUG("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);
if (ret) {
- MMRADIO_LOG_DEBUG("failed create thread\n");
+ MMRADIO_LOG_DEBUG("failed to create thread");
return MM_ERROR_RADIO_INTERNAL;
}
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\n");
+ MMRADIO_LOG_DEBUG("failed to create thread : scan");
return MM_ERROR_RADIO_NOT_INITIALIZED;
}
/* just return stored frequency if radio device is not ready */
if (radio->radio_fd < 0) {
- MMRADIO_SLOG_DEBUG("Device not ready so sending 0\n");
+ MMRADIO_SLOG_DEBUG("Device not ready so sending 0");
*value = 0;
return MM_ERROR_NONE;
}
int freq = 0;
MMMessageParamType param = { 0, };
- MMRADIO_LOG_DEBUG("scanning....\n");
+ MMRADIO_LOG_DEBUG("scanning....");
/* now we can get new frequency from radio device */
MMRADIO_LOG_DEBUG("freq: %d", freq);
if (freq < prev_freq) {
- MMRADIO_LOG_DEBUG("scanning wrapped around. stopping scan\n");
+ MMRADIO_LOG_DEBUG("scanning wrapped around. stopping scan");
break;
}
continue;
prev_freq = param.radio_scan.frequency = freq;
- MMRADIO_SLOG_DEBUG("scanning : new frequency : [%d]\n", param.radio_scan.frequency);
+ MMRADIO_SLOG_DEBUG("scanning : new frequency : [%d]", param.radio_scan.frequency);
/* drop if max freq is scanned */
if (param.radio_scan.frequency == radio->region_setting.band_max
|| param.radio_scan.frequency > radio->region_setting.band_max
|| param.radio_scan.frequency < radio->region_setting.band_min) {
- MMRADIO_LOG_DEBUG("%d freq is dropping...and stopping scan\n", param.radio_scan.frequency);
+ MMRADIO_LOG_DEBUG("%d freq is dropping...and stopping scan", param.radio_scan.frequency);
break;
}
MMRADIO_POST_MSG(radio, MM_MESSAGE_RADIO_SEEK_START, NULL);
- MMRADIO_LOG_DEBUG("seeking....\n");
+ MMRADIO_LOG_DEBUG("seeking....");
EmultatorIdx = 0;
while (!seek_stop) {
MMRADIO_LOG_DEBUG("radio->freq: %d EmultatorIdx: %d", radio->freq, EmultatorIdx);
}
- MMRADIO_LOG_DEBUG("found frequency\n");
+ MMRADIO_LOG_DEBUG("found frequency");
/* 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. \n");
+ MMRADIO_LOG_DEBUG("It's same with previous found one. So, trying next one.");
continue;
}
/* now tune to new frequency */
ret = _mmradio_set_frequency(radio, freq);
if (ret) {
- MMRADIO_LOG_ERROR("failed to tune to new frequency\n");
+ MMRADIO_LOG_ERROR("failed to tune to new frequency");
goto SEEK_FAILED;
}
}
}
#endif
param.radio_scan.frequency = radio->prev_seek_freq = freq;
- MMRADIO_SLOG_DEBUG("seeking : new frequency : [%d]\n", param.radio_scan.frequency);
+ MMRADIO_SLOG_DEBUG("seeking : new frequency : [%d]", param.radio_scan.frequency);
MMRADIO_POST_MSG(radio, MM_MESSAGE_RADIO_SEEK_FINISH, ¶m);
seek_stop = true;
}
MMRADIO_LOG_FENTER();
if (!radio->msg_cb) {
- MMRADIO_LOG_WARNING("failed to post a message\n");
+ MMRADIO_LOG_WARNING("failed to post a message because msg cb didn't register");
return false;
}
- MMRADIO_LOG_DEBUG("address of msg_cb : %d\n", radio->msg_cb);
+ MMRADIO_LOG_DEBUG("address of msg_cb : %d", radio->msg_cb);
radio->msg_cb(msgtype, param, radio->msg_cb_param);
radio_state = __mmradio_get_state(radio);
- MMRADIO_LOG_DEBUG("incomming command : %d current state : %d\n", command, radio_state);
+ MMRADIO_LOG_DEBUG("incomming command : %d current state : %d", command, radio_state);
switch (command) {
case MMRADIO_COMMAND_CREATE:
break;
default:
- MMRADIO_LOG_DEBUG("not handled in FSM. don't care it\n");
+ MMRADIO_LOG_DEBUG("not handled in FSM. don't care it");
break;
}
- MMRADIO_LOG_DEBUG("status OK\n");
+ MMRADIO_LOG_DEBUG("status OK");
radio->cmd = command;
return MM_ERROR_NONE;
INVALID_STATE:
- MMRADIO_LOG_WARNING("invalid state. current : %d command : %d\n", radio_state, command);
+ MMRADIO_LOG_WARNING("invalid state. current : %d command : %d", radio_state, command);
MMRADIO_LOG_FLEAVE();
return MM_ERROR_RADIO_INVALID_STATE;
NO_OP:
- MMRADIO_LOG_WARNING("mm-radio is in the desired state(%d). doing noting\n", radio_state);
+ MMRADIO_LOG_WARNING("mm-radio is in the desired state(%d). doing noting", radio_state);
MMRADIO_LOG_FLEAVE();
return MM_ERROR_RADIO_NO_OP;
MMRADIO_LOG_FENTER();
if (!radio) {
- MMRADIO_LOG_WARNING("calling set_state with invalid radio handle\n");
+ MMRADIO_LOG_WARNING("calling set_state with invalid radio handle");
return false;
}
if (radio->current_state == new_state && radio->pending_state == 0) {
- MMRADIO_LOG_WARNING("we are in same state\n");
+ MMRADIO_LOG_WARNING("we are in same state");
return true;
}
{
MMRADIO_CHECK_INSTANCE(radio);
- MMRADIO_LOG_DEBUG("radio state : current : [%d] old : [%d] pending : [%d]\n",
+ MMRADIO_LOG_DEBUG("radio state : current : [%d] old : [%d] pending : [%d]",
radio->current_state, radio->old_state, radio->pending_state);
return radio->current_state;
MMRADIO_CMD_LOCK(radio);
result = _mmradio_stop(radio);
if (result)
- MMRADIO_LOG_ERROR("failed to stop radio\n");
+ MMRADIO_LOG_ERROR("failed to stop radio");
MMRADIO_CMD_UNLOCK(radio);
radio->sound_focus.by_focus_cb = false;
- MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type);
+ MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d", radio->sound_focus.cur_focus_type);
}
break;
if ((postMsg) && (FOCUS_FOR_BOTH == radio->sound_focus.cur_focus_type))
MMRADIO_POST_MSG(radio, MM_MESSAGE_READY_TO_RESUME, &msg);
- MMRADIO_LOG_DEBUG("FOCUS_IS_ACQUIRED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type);
+ MMRADIO_LOG_DEBUG("FOCUS_IS_ACQUIRED cur_focus_type : %d", radio->sound_focus.cur_focus_type);
}
break;
default:
- MMRADIO_LOG_DEBUG("Unknown focus_state\n");
+ MMRADIO_LOG_DEBUG("Unknown focus_state");
break;
}
radio->sound_focus.by_focus_cb = false;
- MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type);
+ MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d", radio->sound_focus.cur_focus_type);
}
break;
if ((postMsg) && (FOCUS_FOR_BOTH == radio->sound_focus.cur_focus_type))
MMRADIO_POST_MSG(radio, MM_MESSAGE_READY_TO_RESUME, &msg);
- MMRADIO_LOG_DEBUG("FOCUS_IS_ACQUIRED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type);
+ MMRADIO_LOG_DEBUG("FOCUS_IS_ACQUIRED cur_focus_type : %d", radio->sound_focus.cur_focus_type);
}
break;
default:
- MMRADIO_LOG_DEBUG("Unknown focus_state\n");
+ MMRADIO_LOG_DEBUG("Unknown focus_state");
break;
}
}
if (radio->radio_fd < 0) {
- MMRADIO_LOG_DEBUG("radio device is not opened yet\n");
+ MMRADIO_LOG_DEBUG("radio device is not opened yet");
radio->local_volume = volume;
return MM_ERROR_NONE;
}
#ifdef USE_GST_PIPELINE
if (radio->pGstreamer_s && radio->pGstreamer_s->volume) {
g_object_set(radio->pGstreamer_s->volume, "volume", volume, NULL);
- MMRADIO_LOG_DEBUG("g_object set volume\n");
+ MMRADIO_LOG_DEBUG("g_object set volume");
}
#endif
MMRADIO_LOG_FLEAVE();
MMRADIO_RETURN_VAL_IF_FAIL(pVolume, MM_ERROR_INVALID_ARGUMENT);
- MMRADIO_SLOG_DEBUG("volume : %f\n", radio->local_volume);
+ MMRADIO_SLOG_DEBUG("volume : %f", radio->local_volume);
*pVolume = radio->local_volume;
/* create command lock */
ret = pthread_mutex_init(&radio->cmd_lock, NULL);
if (ret) {
- MMRADIO_LOG_ERROR("mutex creation failed");
+ MMRADIO_LOG_ERROR("failed to create mutex");
return MM_ERROR_RADIO_INTERNAL;
}
ret = pthread_mutex_init(&radio->volume_lock, NULL);
if (ret) {
- MMRADIO_LOG_ERROR("volume mutex creation failed");
+ MMRADIO_LOG_ERROR("failed to create volume mutex");
return MM_ERROR_RADIO_INTERNAL;
}
MMRADIO_SET_STATE(radio, MM_RADIO_STATE_NULL);
/* initialize resource manager */
- ret = mmradio_resource_manager_init(&radio->resource_manager, radio);
+ ret = mmradio_resource_manager_init(&(radio->resource_manager), radio);
if (ret) {
- MMRADIO_LOG_ERROR("failed to initialize resource manager\n");
+ MMRADIO_LOG_ERROR("failed to initialize resource manager");
return MM_ERROR_RADIO_INTERNAL;
}
if (ret) {
/* NOTE : we are dealing it as an error since we cannot expect it's behavior */
- MMRADIO_LOG_ERROR("mmradio_audio_focus_register is failed");
+ MMRADIO_LOG_ERROR("failed to register sound focus");
return MM_ERROR_RADIO_INTERNAL;
}
#endif
ret = radio_hal_interface_init(&(radio->hal_inf));
if (ret) {
- MMRADIO_LOG_ERROR("mmradio hal interface init failed");
+ MMRADIO_LOG_ERROR("failed to init mmradio hal interface");
return ret;
}
ret = pthread_mutex_init(&radio->seek_cancel_mutex, NULL);
if (ret < 0) {
- MMRADIO_LOG_ERROR("Mutex creation failed %d", ret);
+ MMRADIO_LOG_ERROR("failed to create seek cancel mutex %d", ret);
return MM_ERROR_RADIO_INTERNAL;
}
#ifdef TIZEN_FEATURE_SOUND_VSTREAM
ret = sound_manager_create_stream_information_internal(SOUND_STREAM_TYPE_RADIO, NULL, radio, &radio->stream_info);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("sound_manager_create_stream_information_internal error");
+ MMRADIO_LOG_ERROR("failed to create stream information");
MMRADIO_LOG_FLEAVE();
return ret;
}
ret = sound_manager_get_max_volume(SOUND_TYPE_MEDIA, &max);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_WARNING("sound_manager_get_max_volume error");
+ MMRADIO_LOG_WARNING("failed to get max volume");
radio->max_media_volume = DEFAULT_MAX_MEDIA_VOLUME;
} else {
radio->max_media_volume = max;
ret = mm_sound_volume_get_value(VOLUME_TYPE_MEDIA, &volume);
if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_WARNING("failed to get MEDIA_VOLUME");
+ MMRADIO_LOG_WARNING("failed to get media volume");
MMRADIO_VOLUME_LOCK(radio);
radio->media_volume = volume;
ret = mm_sound_add_volume_changed_callback(__mmradio_volume_changed_cb, (void *)radio, &radio->volume_subs_id);
if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_WARNING("mm_sound_add_volume_changed_callback error");
+ MMRADIO_LOG_WARNING("failed to register volume changed callback");
MMRADIO_SET_STATE(radio, MM_RADIO_STATE_READY);
ret = radio_hal_interface_deinit(radio->hal_inf);
if (ret) {
- MMRADIO_LOG_ERROR("mmradio hal interface deinit failed");
+ MMRADIO_LOG_ERROR("failed to deinitialize radio hal interface");
return ret;
}
/* destroy command lock */
ret = pthread_mutex_destroy(&radio->cmd_lock);
if (ret)
- MMRADIO_LOG_ERROR("mutex destroy failed\n");
+ MMRADIO_LOG_ERROR("failed to destory muxtex");
ret = pthread_mutex_destroy(&radio->volume_lock);
if (ret)
- MMRADIO_LOG_ERROR("volume mutex destroy failed\n");
+ MMRADIO_LOG_ERROR("failed to destory volume mutex");
#ifdef TIZEN_FEATURE_SOUND_FOCUS
ret = mmradio_sound_focus_deregister(&radio->sound_focus);
ret = mmradio_resource_manager_deinit(&radio->resource_manager);
if (ret) {
- MMRADIO_LOG_ERROR("failed to initialize resource manager\n");
+ MMRADIO_LOG_ERROR("failed to deinitialize resource manager");
return MM_ERROR_RADIO_INTERNAL;
}
ret = radio_hal_set_frequency(radio->hal_inf, freq);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_set_frequency error");
+ MMRADIO_LOG_ERROR("failed to set radio hal frequency");
MMRADIO_LOG_FLEAVE();
return ret;
}
ret = radio_hal_get_frequency(radio->hal_inf, &freq);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_get_frequency error");
+ MMRADIO_LOG_ERROR("failed to get radio hal frequency");
*pFreq = 0;
return ret;
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_mute is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_mute error");
+ MMRADIO_LOG_ERROR("failed to set radio hal mute");
MMRADIO_LOG_FLEAVE();
return ret;
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_unmute is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_unmute error");
+ MMRADIO_LOG_ERROR("failed to set radio hal unmute");
MMRADIO_LOG_FLEAVE();
return ret;
}
if (radio->sound_focus.handle > 0) {
ret = mmradio_acquire_sound_focus(&radio->sound_focus);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("failed to set sound focus");
+ MMRADIO_LOG_ERROR("failed to acquire sound focus");
return ret;
}
}
if (!radio->is_ready) {
ret = mmradio_resource_manager_prepare(&radio->resource_manager, MM_RADIO_RESOURCE_TYPE_RADIO);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("resource manager prepare fail");
+ MMRADIO_LOG_ERROR("failed to prepare resource manager");
return MM_ERROR_RADIO_INTERNAL;
}
ret = mmradio_resource_manager_acquire(&radio->resource_manager);
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_prepare is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_prepare_device error");
+ MMRADIO_LOG_ERROR("failed to prepare radio hal");
goto error2;
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_open is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_init error");
+ MMRADIO_LOG_ERROR("failed to open radio hal");
goto error1;
}
radio->is_ready = TRUE;
ret = mm_sound_volume_get_value(VOLUME_TYPE_MEDIA, &volume);
if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_WARNING("failed to get MEDIA_VOLUME");
+ MMRADIO_LOG_WARNING("failed to get media volume");
ret = __mmradio_set_media_volume(radio, volume);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("failed to media volume");
+ MMRADIO_LOG_ERROR("failed to set media volume");
goto error1;
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_start is not supported");
} else if (ret) {
- MMRADIO_LOG_ERROR("failed to radio_hal_start");
+ MMRADIO_LOG_ERROR("failed to start radio hal");
goto error1;
}
/* set stored frequency */
ret = radio_hal_set_frequency(radio->hal_inf, radio->freq);
if (ret) {
- MMRADIO_LOG_ERROR("failed to radio_hal_set_frequency");
+ MMRADIO_LOG_ERROR("failed to set radio hal frequency");
goto error1;
}
#ifdef TIZEN_FEATURE_SOUND_VSTREAM
ret = sound_manager_start_virtual_stream(radio->vstream);
if (ret) {
- MMRADIO_LOG_ERROR("failed to sound_manager_start_virtual_stream");
+ MMRADIO_LOG_ERROR("failed to start sound manager virtual stream");
goto error;
}
#endif
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_unmute is not supported");
} else if (ret) {
- MMRADIO_LOG_ERROR("failed to radio_hal_stop");
+ MMRADIO_LOG_ERROR("failed to stop radio hal");
return ret;
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_close is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_close_device error");
+ MMRADIO_LOG_ERROR("failed to close radio hal");
return ret;
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_unprepare is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_close_device error");
+ MMRADIO_LOG_ERROR("failed to unprepare radio hal");
return ret;
}
if (resource_state == MM_RADIO_RESOURCE_STATE_PREPARED) {
ret = mmradio_resource_manager_unprepare(&radio->resource_manager);
if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_ERROR("resource manager unprepare fail");
+ MMRADIO_LOG_ERROR("failed to unprepare resource manager");
}
}
if (radio->sound_focus.handle > 0) {
ret = mmradio_release_sound_focus(&radio->sound_focus);
if (ret) {
- MMRADIO_LOG_ERROR("mmradio_release_audio_focus is failed");
+ MMRADIO_LOG_ERROR("failed to release sound focus");
return ret;
}
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_mute is not supported");
} else if (ret) {
- MMRADIO_LOG_ERROR("failed to radio_hal_mute");
+ MMRADIO_LOG_ERROR("failed to set radio hal mute");
return ret;
}
radio->seek_unmute = TRUE;
ret = pthread_create(&radio->seek_thread, NULL, (void *)__mmradio_seek_thread, (void *)radio);
if (ret) {
- MMRADIO_LOG_DEBUG("failed create thread");
+ MMRADIO_LOG_DEBUG("failed to create thread");
radio->is_seeking = FALSE;
radio->seek_cancel = TRUE;
if (radio->seek_unmute) {
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_mute is not supported");
} else if (ret) {
- MMRADIO_LOG_ERROR("failed to radio_hal_mute");
+ MMRADIO_LOG_ERROR("failed to set radio hal mute");
radio->seek_unmute = FALSE;
return ret;
}
if (!radio->is_ready) {
ret = mmradio_resource_manager_prepare(&radio->resource_manager, MM_RADIO_RESOURCE_TYPE_RADIO);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("resource manager prepare fail");
+ MMRADIO_LOG_ERROR("failed to prepare resource manager");
return MM_ERROR_RADIO_INTERNAL;
}
ret = mmradio_resource_manager_acquire(&radio->resource_manager);
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_prepare is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_prepare_device error");
+ MMRADIO_LOG_ERROR("failed to prepare radio hal");
return ret;
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_open is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_init error");
+ MMRADIO_LOG_ERROR("failed to open radio hal");
MMRADIO_LOG_FLEAVE();
return ret;
}
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_unmute is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_get_signal_strength error");
+ MMRADIO_LOG_ERROR("failed to get radio hal signal strength");
*value = 0;
MMRADIO_LOG_FLEAVE();
return ret;
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_mute is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_mute error");
+ MMRADIO_LOG_ERROR("faied to set radio hal mute");
goto FINISHED;
}
ret = radio_hal_set_frequency(radio->hal_inf, radio->region_setting.band_min);
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_unmute is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_unmute error");
+ MMRADIO_LOG_ERROR("failed to set radio hal unmute");
goto FINISHED_ERR;
}
ret = radio_hal_set_frequency(radio->hal_inf, prev_freq);
if (ret == MM_ERROR_NOT_SUPPORT_API) {
MMRADIO_LOG_WARNING("radio_hal_set_frequency is not supported");
} else if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_set_frequency error");
+ MMRADIO_LOG_ERROR("failed to set radio hal frequency");
goto FINISHED_ERR;
}
}
if (ret == MM_ERROR_NOT_SUPPORT_API)
MMRADIO_LOG_WARNING("radio_hal_close is not supported");
else if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_ERROR("radio_hal_close_device error");
+ MMRADIO_LOG_ERROR("failed to close radio hal");
ret = radio_hal_unprepare(radio->hal_inf);
if (ret == MM_ERROR_NOT_SUPPORT_API)
MMRADIO_LOG_WARNING("radio_hal_unprepare is not supported");
else if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_ERROR("radio_hal_close_device error");
+ MMRADIO_LOG_ERROR("failed to unprepare radio hal");
radio->is_ready = FALSE;
if (resource_state == MM_RADIO_RESOURCE_STATE_PREPARED) {
ret = mmradio_resource_manager_unprepare(&radio->resource_manager);
if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_ERROR("resource manager unprepare fail");
+ MMRADIO_LOG_ERROR("failed to unprepare resource manager");
}
}
ret = radio_hal_seek(radio->hal_inf, radio->seek_direction);
pthread_mutex_unlock(&radio->seek_cancel_mutex);
if (ret) {
- MMRADIO_LOG_ERROR("radio_hal_seek failed");
+ MMRADIO_LOG_ERROR("failed to seek radio hal");
goto SEEK_FAILED;
}
*/
ret = radio_hal_unmute(radio->hal_inf);
if (ret) {
- MMRADIO_LOG_ERROR("failed to tune to new frequency");
+ MMRADIO_LOG_ERROR("failed to set unmute radio hal");
goto SEEK_FAILED;
}
radio->seek_unmute = FALSE;
*/
ret = radio_hal_unmute(radio->hal_inf);
if (ret)
- MMRADIO_LOG_ERROR("failed to tune to new frequency");
+ MMRADIO_LOG_ERROR("failed to set unmute radio hal");
radio->seek_unmute = FALSE;
}
/* freq -1 means it's failed to seek */
MMRADIO_LOG_FENTER();
if (!radio->msg_cb) {
- MMRADIO_LOG_WARNING("failed to post a message");
+ MMRADIO_LOG_WARNING("failed to post a message because msg cb didn't register");
return false;
}
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_LOG_ERROR("failed to set media volume");
return;
}
}
ret = radio_hal_set_volume(radio->hal_inf, volume);
if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_ERROR("radio_hal_set_volume error");
+ MMRADIO_LOG_ERROR("failed to set radio hal volume");
MMRADIO_LOG_FLEAVE();
ret = radio_hal_get_volume(radio->hal_inf, &volume);
if (ret != MM_ERROR_NONE) {
- MMRADIO_LOG_ERROR("radio_hal_get_volume error");
+ MMRADIO_LOG_ERROR("failed to get radio hal volume");
*pVolume = 0;
return ret;
}
ret = radio_hal_set_media_volume(radio->hal_inf, level);
if (ret != MM_ERROR_NONE)
- MMRADIO_LOG_ERROR("radio_hal_set_media_volume error");
+ MMRADIO_LOG_ERROR("failed to set radio hal media volume");
MMRADIO_LOG_FLEAVE();