tizen-audio-impl-ctrl.c \
hal-backend-audio.c
libhal_backend_audio_la_LDFLAGS = $(AM_LDFLAGS) -disable-static -avoid-version
-libhal_backend_audio_la_LIBADD = $(AM_LDADD) $(ASOUNDLIB_LIBS) $(VCONF_LIBS) $(DLOG_LIBS) $(INIPARSER_LIBS) $(SYSTEM_INFO_LIBS)
-libhal_backend_audio_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS) $(VCONF_CFLAGS) $(DLOG_CFLAGS) $(INIPARSER_CFLAGS) $(SYSTEM_INFO_CFLAGS) $(HALAPICOMMON) -DUSE_DLOG
+libhal_backend_audio_la_LIBADD = $(AM_LDADD) $(ASOUNDLIB_LIBS) $(VCONF_LIBS) $(DLOG_LIBS) $(INIPARSER_LIBS)
+libhal_backend_audio_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS) $(VCONF_CFLAGS) $(DLOG_CFLAGS) $(INIPARSER_CFLAGS) $(HALAPICOMMON) -DUSE_DLOG
if USE_TINYALSA
libhal_backend_audio_la_LIBADD += $(TINYALSA_LIBS)
#include "tizen-audio-internal.h"
#include "tizen-audio-impl.h"
-#include <system_info.h>
-#define FEATURE_DISPLAY "http://tizen.org/feature/display"
+#include <vconf.h>
/* #define DEBUG_TIMING */
static void __audio_routing_playback_rpi3(audio_hal_s *ah)
{
- bool display_avail = false;
- int ret = SYSTEM_INFO_ERROR_NONE;
-
- ret = system_info_get_platform_bool(FEATURE_DISPLAY, &display_avail);
- AUDIO_LOG_INFO("system_info_platform [%s]=[%d], ret[%d]", FEATURE_DISPLAY, display_avail, ret);
- if (ret != SYSTEM_INFO_ERROR_NONE)
- AUDIO_LOG_ERROR("Failed to get feature...");
-
- if (!display_avail) {
- /* in case of headless (display is not available), force to use earjack(1) only.
- supported value : (0)auto (1)earjack (2)hdmi */
- _mixer_control_set_value(ah, "PCM Playback Route", 1);
+ int type;
+ int ret;
+
+ ret = vconf_get_int(VCONFKEY_SOUND_RPI_PLAYBACK_ROUTE, &type);
+ if (ret != 0) {
+ AUDIO_LOG_ERROR("Failed to get vconf [%s], err [%d]", VCONFKEY_SOUND_RPI_PLAYBACK_ROUTE, ret);
+ return;
}
+
+ _mixer_control_set_value(ah, "PCM Playback Route", type);
}
audio_return_e _audio_routing_init(audio_hal_s *ah)
{
audio_return_e audio_ret = AUDIO_RET_OK;
audio_hal_s *ah = (audio_hal_s *)audio_handle;
+ int ret;
AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
AUDIO_RETURN_VAL_IF_FAIL(option, AUDIO_ERR_PARAMETER);
AUDIO_LOG_INFO("role:%s, name:%s, value:%d", option->role, option->name, option->value);
+ if (!strcmp("rpi playback route", option->name)) {
+ audio_ret = _mixer_control_set_value(ah, "PCM Playback Route", option->value);
+ if (audio_ret == AUDIO_RET_OK) {
+ ret = vconf_set_int(VCONFKEY_SOUND_RPI_PLAYBACK_ROUTE, option->value);
+ if (ret != 0) {
+ AUDIO_LOG_ERROR("Failed to set vconf [%s], err [%d]", VCONFKEY_SOUND_RPI_PLAYBACK_ROUTE, ret);
+ return AUDIO_ERR_INTERNAL;
+ }
+ }
+ }
+
return audio_ret;
}