MODULE_LIBADD = $(AM_LIBADD) $(LIBLTDL)
pulsemodlibexec_LTLIBRARIES = \
- libhal-manager.la \
+ libhal-interface.la \
module-tizenaudio-sink.la \
module-tizenaudio-source.la \
module-sound-player.la \
# These are generated by an M4 script
SYMDEF_FILES = \
- libhal-manager-symdef.h \
+ libhal-interface-symdef.h \
module-tizenaudio-sink-symdef.h \
module-tizenaudio-source-symdef.h \
module-sound-player-symdef.h \
$(AM_V_at)$(MKDIR_P) .
$(AM_V_GEN)$(M4) -Dfname="$@" $< > $@
-libhal_manager_la_SOURCES = \
- src/hal-manager.c src/hal-manager.h
-libhal_manager_la_LDFLAGS = $(AM_LDFLAGS) $(PA_LDFLAGS) -avoid-version
-libhal_manager_la_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS)
-libhal_manager_la_CFLAGS = $(AM_CFLAGS) $(PACORE_CFLAGS) $(PA_CFLAGS)
+libhal_interface_la_SOURCES = \
+ src/hal-interface.c src/hal-interface.h
+libhal_interface_la_LDFLAGS = $(AM_LDFLAGS) $(PA_LDFLAGS) -avoid-version
+libhal_interface_la_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS)
+libhal_interface_la_CFLAGS = $(AM_CFLAGS) $(PACORE_CFLAGS) $(PA_CFLAGS)
module_tizenaudio_sink_la_SOURCES = src/module-tizenaudio-sink.c
module_tizenaudio_sink_la_LDFLAGS = $(PACORE_LDFLAGS) $(PA_LDFLAGS) $(MODULE_LDFLAGS)
-module_tizenaudio_sink_la_LIBADD = $(PACORE_LIBS) $(PA_LIBS) $(MODULE_LIBADD) libhal-manager.la
+module_tizenaudio_sink_la_LIBADD = $(PACORE_LIBS) $(PA_LIBS) $(MODULE_LIBADD) libhal-interface.la
module_tizenaudio_sink_la_CFLAGS = $(PACORE_CFLAGS) $(PA_CFLAGS) $(AM_CFLAGS)
module_tizenaudio_source_la_SOURCES = src/module-tizenaudio-source.c
module_tizenaudio_source_la_LDFLAGS = $(PACORE_LDFLAGS) $(PA_LDFLAGS) $(MODULE_LDFLAGS)
-module_tizenaudio_source_la_LIBADD = $(PACORE_LIBS) $(PA_LIBS) $(MODULE_LIBADD) libhal-manager.la
+module_tizenaudio_source_la_LIBADD = $(PACORE_LIBS) $(PA_LIBS) $(MODULE_LIBADD) libhal-interface.la
module_tizenaudio_source_la_CFLAGS = $(PACORE_CFLAGS) $(PA_CFLAGS) $(AM_CFLAGS)
module_sound_player_la_SOURCES = src/module-sound-player.c
src/device-manager.c src/device-manager.h \
src/subscribe-observer.c src/subscribe-observer.h
module_policy_la_LDFLAGS = $(MODULE_LDFLAGS) $(PACORE_LDFLAGS) $(PA_LDFLAGS) -L$(pulsemodlibexecdir)
-module_policy_la_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS) $(DBUS_LIBS) $(VCONF_LIBS) $(INIPARSER_LIBS) $(LIBJSON_LIBS) libhal-manager.la
+module_policy_la_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS) $(DBUS_LIBS) $(VCONF_LIBS) $(INIPARSER_LIBS) $(LIBJSON_LIBS) libhal-interface.la
module_policy_la_CFLAGS = $(AM_CFLAGS) $(PACORE_CFLAGS) $(PA_CFLAGS) $(DBUS_CFLAGS) $(VCONF_CFLAGS) $(INIPARSER_CFLAGS) $(LIBJSON_CFLAGS)
Name: pulseaudio-modules-tizen
Summary: Pulseaudio modules for Tizen
-Version: 5.0.49
+Version: 5.0.50
Release: 0
Group: Multimedia/Audio
License: LGPL-2.1+
%defattr(-,root,root,-)
%license LICENSE.LGPL-2.1+
%{_libdir}/pulse-5.0/modules/module-*.so
-%{_libdir}/pulse-5.0/modules/libhal-manager.so
+%{_libdir}/pulse-5.0/modules/libhal-interface.so
/***
This file is part of PulseAudio.
- Copyright 2015 Sangchul Lee <sc11.lee@samsung.com>
+ Copyright 2015-2016 Sangchul Lee <sc11.lee@samsung.com>
PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
#include <config.h>
#endif
-#include "hal-manager.h"
+#include "hal-interface.h"
#include "tizen-audio.h"
#include <pulsecore/shared.h>
-#define SHARED_HAL_MANAGER "tizen-hal-manager"
+#define SHARED_HAL_INTF "tizen-hal-interface"
/* Audio HAL library */
#define LIB_TIZEN_AUDIO "libtizen-audio.so"
-struct _pa_hal_manager {
+struct _pa_hal_interface {
PA_REFCNT_DECLARE;
pa_core *core;
audio_interface_t intf;
};
-pa_hal_manager* pa_hal_manager_get(pa_core *core) {
- pa_hal_manager *h;
+pa_hal_interface* pa_hal_interface_get(pa_core *core) {
+ pa_hal_interface *h;
pa_assert(core);
- if ((h = pa_shared_get(core, SHARED_HAL_MANAGER)))
- return pa_hal_manager_ref(h);
+ if ((h = pa_shared_get(core, SHARED_HAL_INTF)))
+ return pa_hal_interface_ref(h);
- h = pa_xnew0(pa_hal_manager, 1);
+ h = pa_xnew0(pa_hal_interface, 1);
PA_REFCNT_INIT(h);
h->core = core;
- /* Load library & init HAL manager */
+ /* Load library & init HAL interface */
h->dl_handle = dlopen(LIB_TIZEN_AUDIO, RTLD_NOW);
if (h->dl_handle) {
h->intf.init = dlsym(h->dl_handle, "audio_init");
h->intf.remove_message_cb = dlsym(h->dl_handle, "audio_remove_message_cb");
if (h->intf.init) {
if (h->intf.init(&h->ah_handle) != AUDIO_RET_OK)
- pa_log_error("hal_manager init failed");
+ pa_log_error("hal_interface init failed");
}
} else {
- pa_log_error("open hal_manager failed :%s", dlerror());
+ pa_log_error("open hal_interface failed :%s", dlerror());
return NULL;
}
- pa_shared_set(core, SHARED_HAL_MANAGER, h);
+ pa_shared_set(core, SHARED_HAL_INTF, h);
return h;
}
-pa_hal_manager* pa_hal_manager_ref(pa_hal_manager *h) {
+pa_hal_interface* pa_hal_interface_ref(pa_hal_interface *h) {
pa_assert(h);
pa_assert(PA_REFCNT_VALUE(h) > 0);
return h;
}
-void pa_hal_manager_unref(pa_hal_manager *h) {
+void pa_hal_interface_unref(pa_hal_interface *h) {
pa_assert(h);
pa_assert(PA_REFCNT_VALUE(h) > 0);
/* Deinit HAL manager & unload library */
if (h->intf.deinit) {
if (h->intf.deinit(h->ah_handle) != AUDIO_RET_OK) {
- pa_log_error("hal_manager deinit failed");
+ pa_log_error("hal_interface deinit failed");
}
}
if (h->dl_handle) {
}
if (h->core)
- pa_shared_remove(h->core, SHARED_HAL_MANAGER);
+ pa_shared_remove(h->core, SHARED_HAL_INTF);
pa_xfree(h);
}
-int32_t pa_hal_manager_get_volume_level_max(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
+int32_t pa_hal_interface_get_volume_level_max(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
audio_volume_info_t info = {NULL, NULL, 0};
return ret;
}
-int32_t pa_hal_manager_get_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
+int32_t pa_hal_interface_get_volume_level(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
audio_volume_info_t info = {NULL, NULL, 0};
return ret;
}
-int32_t pa_hal_manager_set_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t level) {
+int32_t pa_hal_interface_set_volume_level(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t level) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
audio_volume_info_t info = {NULL, NULL, 0};
return ret;
}
-int32_t pa_hal_manager_get_volume_value(pa_hal_manager *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value) {
+int32_t pa_hal_interface_get_volume_value(pa_hal_interface *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
audio_volume_info_t info = {NULL, NULL, 0};
return ret;
}
-int32_t pa_hal_manager_get_volume_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *mute) {
+int32_t pa_hal_interface_get_volume_mute(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *mute) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
audio_volume_info_t info = {NULL, NULL, 0};
return ret;
}
-int32_t pa_hal_manager_set_volume_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t mute) {
+int32_t pa_hal_interface_set_volume_mute(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t mute) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
audio_volume_info_t info = {NULL, NULL, 0};
return ret;
}
-int32_t pa_hal_manager_update_route(pa_hal_manager *h, hal_route_info *info) {
+int32_t pa_hal_interface_update_route(pa_hal_interface *h, hal_route_info *info) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_update_route_option(pa_hal_manager *h, hal_route_option *option) {
+int32_t pa_hal_interface_update_route_option(pa_hal_interface *h, hal_route_option *option) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_notify_stream_connection_changed(pa_hal_manager *h, hal_stream_connection_info *info) {
+int32_t pa_hal_interface_notify_stream_connection_changed(pa_hal_interface *h, hal_stream_connection_info *info) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
audio_stream_info_t hal_info;
return ret;
}
-int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, hal_stream_info *info,
+int32_t pa_hal_interface_get_buffer_attribute(pa_hal_interface *h, hal_stream_info *info,
uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_open(pa_hal_manager *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec, uint32_t period_size, uint32_t periods) {
+int32_t pa_hal_interface_pcm_open(pa_hal_interface *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec, uint32_t period_size, uint32_t periods) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_start(pa_hal_manager *h, pcm_handle pcm_h) {
+int32_t pa_hal_interface_pcm_start(pa_hal_interface *h, pcm_handle pcm_h) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_stop(pa_hal_manager *h, pcm_handle pcm_h) {
+int32_t pa_hal_interface_pcm_stop(pa_hal_interface *h, pcm_handle pcm_h) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_close(pa_hal_manager *h, pcm_handle pcm_h) {
+int32_t pa_hal_interface_pcm_close(pa_hal_interface *h, pcm_handle pcm_h) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_available(pa_hal_manager *h, pcm_handle pcm_h, uint32_t *available) {
+int32_t pa_hal_interface_pcm_available(pa_hal_interface *h, pcm_handle pcm_h, uint32_t *available) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_write(pa_hal_manager *h, pcm_handle pcm_h, const void *buffer, uint32_t frames) {
+int32_t pa_hal_interface_pcm_write(pa_hal_interface *h, pcm_handle pcm_h, const void *buffer, uint32_t frames) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_read(pa_hal_manager *h, pcm_handle pcm_h, void *buffer, uint32_t frames) {
+int32_t pa_hal_interface_pcm_read(pa_hal_interface *h, pcm_handle pcm_h, void *buffer, uint32_t frames) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_get_fd(pa_hal_manager *h, pcm_handle pcm_h, int *fd) {
+int32_t pa_hal_interface_pcm_get_fd(pa_hal_interface *h, pcm_handle pcm_h, int *fd) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_recover(pa_hal_manager *h, pcm_handle pcm_h, int err) {
+int32_t pa_hal_interface_pcm_recover(pa_hal_interface *h, pcm_handle pcm_h, int err) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_get_params(pa_hal_manager *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods) {
+int32_t pa_hal_interface_pcm_get_params(pa_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_pcm_set_params(pa_hal_manager *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods) {
+int32_t pa_hal_interface_pcm_set_params(pa_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_add_message_callback(pa_hal_manager *h, hal_message_callback callback, void *user_data) {
+int32_t pa_hal_interface_add_message_callback(pa_hal_interface *h, hal_message_callback callback, void *user_data) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
return ret;
}
-int32_t pa_hal_manager_remove_message_callback(pa_hal_manager *h, hal_message_callback callback) {
+int32_t pa_hal_interface_remove_message_callback(pa_hal_interface *h, hal_message_callback callback) {
int32_t ret = 0;
audio_return_t hal_ret = AUDIO_RET_OK;
--- /dev/null
+#ifndef foohalinterfacefoo
+#define foohalinterfacefoo
+#include <dlfcn.h>
+#include <pulsecore/core.h>
+
+typedef struct _pa_hal_interface pa_hal_interface;
+
+typedef enum _io_direction {
+ DIRECTION_IN,
+ DIRECTION_OUT,
+} io_direction_t;
+
+typedef struct _hal_device_info {
+ const char *type;
+ uint32_t direction;
+ uint32_t id;
+} hal_device_info;
+
+typedef struct _hal_route_info {
+ const char *role;
+ hal_device_info *device_infos;
+ uint32_t num_of_devices;
+} hal_route_info;
+
+typedef struct _hal_route_option {
+ const char *role;
+ const char *name;
+ int32_t value;
+} hal_route_option;
+
+typedef struct _hal_stream_connection_info {
+ const char *role;
+ uint32_t direction;
+ uint32_t idx;
+ bool is_connected;
+} hal_stream_connection_info;
+
+typedef struct _hal_stream_info {
+ io_direction_t direction;
+ const char *latency;
+ pa_sample_spec *sample_spec;
+} hal_stream_info;
+
+typedef void* pcm_handle;
+
+#define MSG_FOR_LOOPBACK_ARG_LATENCY "loopback::latency"
+#define MSG_FOR_LOOPBACK_ARG_ADJUST_TIME "loopback::adjust_time"
+typedef void (*hal_message_callback)(const char *name, int value, void *user_data);
+
+pa_hal_interface* pa_hal_interface_get(pa_core *core);
+pa_hal_interface* pa_hal_interface_ref(pa_hal_interface *h);
+void pa_hal_interface_unref(pa_hal_interface *h);
+int32_t pa_hal_interface_get_volume_level_max(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level);
+int32_t pa_hal_interface_get_volume_level(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level);
+int32_t pa_hal_interface_set_volume_level(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t level);
+int32_t pa_hal_interface_get_volume_value(pa_hal_interface *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value);
+int32_t pa_hal_interface_get_volume_mute(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *mute);
+int32_t pa_hal_interface_set_volume_mute(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t mute);
+int32_t pa_hal_interface_update_route(pa_hal_interface *h, hal_route_info *info);
+int32_t pa_hal_interface_update_route_option(pa_hal_interface *h, hal_route_option *option);
+int32_t pa_hal_interface_notify_stream_connection_changed(pa_hal_interface *h, hal_stream_connection_info *info);
+int32_t pa_hal_interface_get_buffer_attribute(pa_hal_interface *h, hal_stream_info *info, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
+int32_t pa_hal_interface_pcm_open(pa_hal_interface *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec, uint32_t period_size, uint32_t periods);
+int32_t pa_hal_interface_pcm_start(pa_hal_interface *h, pcm_handle pcm_h);
+int32_t pa_hal_interface_pcm_stop(pa_hal_interface *h, pcm_handle pcm_h);
+int32_t pa_hal_interface_pcm_close(pa_hal_interface *h, pcm_handle pcm_h);
+int32_t pa_hal_interface_pcm_available(pa_hal_interface *h, pcm_handle pcm_h, uint32_t *available);
+int32_t pa_hal_interface_pcm_write(pa_hal_interface *h, pcm_handle pcm_h, const void *buffer, uint32_t frames);
+int32_t pa_hal_interface_pcm_read(pa_hal_interface *h, pcm_handle pcm_h, void *buffer, uint32_t frames);
+int32_t pa_hal_interface_pcm_get_fd(pa_hal_interface *h, pcm_handle pcm_h, int *fd);
+int32_t pa_hal_interface_pcm_recover(pa_hal_interface *h, pcm_handle pcm_h, int err);
+int32_t pa_hal_interface_pcm_get_params(pa_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
+int32_t pa_hal_interface_pcm_set_params(pa_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
+int32_t pa_hal_interface_add_message_callback(pa_hal_interface *h, hal_message_callback callback, void *user_data);
+int32_t pa_hal_interface_remove_message_callback(pa_hal_interface *h, hal_message_callback callback);
+
+#endif
+++ /dev/null
-#ifndef foohalmanagerfoo
-#define foohalmanagerfoo
-#include <dlfcn.h>
-#include <pulsecore/core.h>
-
-typedef struct _pa_hal_manager pa_hal_manager;
-
-typedef enum _io_direction {
- DIRECTION_IN,
- DIRECTION_OUT,
-} io_direction_t;
-
-typedef struct _hal_device_info {
- const char *type;
- uint32_t direction;
- uint32_t id;
-} hal_device_info;
-
-typedef struct _hal_route_info {
- const char *role;
- hal_device_info *device_infos;
- uint32_t num_of_devices;
-} hal_route_info;
-
-typedef struct _hal_route_option {
- const char *role;
- const char *name;
- int32_t value;
-} hal_route_option;
-
-typedef struct _hal_stream_connection_info {
- const char *role;
- uint32_t direction;
- uint32_t idx;
- bool is_connected;
-} hal_stream_connection_info;
-
-typedef struct _hal_stream_info {
- io_direction_t direction;
- const char *latency;
- pa_sample_spec *sample_spec;
-} hal_stream_info;
-
-typedef void* pcm_handle;
-
-#define MSG_FOR_LOOPBACK_ARG_LATENCY "loopback::latency"
-#define MSG_FOR_LOOPBACK_ARG_ADJUST_TIME "loopback::adjust_time"
-typedef void (*hal_message_callback)(const char *name, int value, void *user_data);
-
-pa_hal_manager* pa_hal_manager_get(pa_core *core);
-pa_hal_manager* pa_hal_manager_ref(pa_hal_manager *h);
-void pa_hal_manager_unref(pa_hal_manager *h);
-int32_t pa_hal_manager_get_volume_level_max(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level);
-int32_t pa_hal_manager_get_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level);
-int32_t pa_hal_manager_set_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t level);
-int32_t pa_hal_manager_get_volume_value(pa_hal_manager *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value);
-int32_t pa_hal_manager_get_volume_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *mute);
-int32_t pa_hal_manager_set_volume_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t mute);
-int32_t pa_hal_manager_update_route(pa_hal_manager *h, hal_route_info *info);
-int32_t pa_hal_manager_update_route_option(pa_hal_manager *h, hal_route_option *option);
-int32_t pa_hal_manager_notify_stream_connection_changed(pa_hal_manager *h, hal_stream_connection_info *info);
-int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, hal_stream_info *info, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
-int32_t pa_hal_manager_pcm_open(pa_hal_manager *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec, uint32_t period_size, uint32_t periods);
-int32_t pa_hal_manager_pcm_start(pa_hal_manager *h, pcm_handle pcm_h);
-int32_t pa_hal_manager_pcm_stop(pa_hal_manager *h, pcm_handle pcm_h);
-int32_t pa_hal_manager_pcm_close(pa_hal_manager *h, pcm_handle pcm_h);
-int32_t pa_hal_manager_pcm_available(pa_hal_manager *h, pcm_handle pcm_h, uint32_t *available);
-int32_t pa_hal_manager_pcm_write(pa_hal_manager *h, pcm_handle pcm_h, const void *buffer, uint32_t frames);
-int32_t pa_hal_manager_pcm_read(pa_hal_manager *h, pcm_handle pcm_h, void *buffer, uint32_t frames);
-int32_t pa_hal_manager_pcm_get_fd(pa_hal_manager *h, pcm_handle pcm_h, int *fd);
-int32_t pa_hal_manager_pcm_recover(pa_hal_manager *h, pcm_handle pcm_h, int err);
-int32_t pa_hal_manager_pcm_get_params(pa_hal_manager *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
-int32_t pa_hal_manager_pcm_set_params(pa_hal_manager *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
-int32_t pa_hal_manager_add_message_callback(pa_hal_manager *h, hal_message_callback callback, void *user_data);
-int32_t pa_hal_manager_remove_message_callback(pa_hal_manager *h, hal_message_callback callback);
-
-#endif
#include "module-policy-symdef.h"
#include "communicator.h"
-#include "hal-manager.h"
+#include "hal-interface.h"
#include "stream-manager.h"
#include "device-manager.h"
pa_hook_slot *comm_hook_update_info_slot;
} communicator;
- pa_hal_manager *hal_manager;
+ pa_hal_interface *hal_interface;
pa_stream_manager *stream_manager;
pa_device_manager *device_manager;
if (route_info.device_infos) {
/* send information to HAL to update route */
- if (pa_hal_manager_update_route(u->hal_manager, &route_info))
- pa_log_error("[ROUTE] Failed to pa_hal_manager_update_route()");
+ if (pa_hal_interface_update_route(u->hal_interface, &route_info))
+ pa_log_error("[ROUTE] Failed to pa_hal_interface_update_route()");
pa_xfree(route_info.device_infos);
}
u->core = m->core;
u->module = m;
- u->hal_manager = pa_hal_manager_get(u->core);
+ u->hal_interface = pa_hal_interface_get(u->core);
if ((u->communicator.comm = pa_communicator_get(u->core))) {
u->communicator.comm_hook_select_proper_sink_or_source_slot = pa_hook_connect(
pa_communicator_unref(u->communicator.comm);
}
- if (u->hal_manager)
- pa_hal_manager_unref(u->hal_manager);
+ if (u->hal_interface)
+ pa_hal_interface_unref(u->hal_interface);
pa_xfree(u);
#include <pulsecore/rtpoll.h>
#include <pulsecore/poll.h>
-#include "hal-manager.h"
+#include "hal-interface.h"
#include "module-tizenaudio-sink-symdef.h"
pa_rtpoll_item *rtpoll_item;
uint64_t write_count;
- pa_hal_manager *hal_manager;
+ pa_hal_interface *hal_interface;
};
static const char* const valid_modargs[] = {
u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
- ret = pa_hal_manager_pcm_get_fd(u->hal_manager, u->pcm_handle, &fd);
+ ret = pa_hal_interface_pcm_get_fd(u->hal_interface, u->pcm_handle, &fd);
if (ret < 0 || fd < 0) {
pa_log_error("Failed to get fd(%d) of PCM device %d", fd, ret);
return -1;
pa_assert(u);
pa_assert(u->pcm_handle);
- ret = pa_hal_manager_pcm_close(u->hal_manager, u->pcm_handle);
+ ret = pa_hal_interface_pcm_close(u->hal_interface, u->pcm_handle);
if (ret) {
pa_log_error("Error closing PCM device %x", ret);
}
pa_log_info("Trying resume...");
sample_spec = u->sink->sample_spec;
- ret = pa_hal_manager_pcm_open(u->hal_manager,
+ ret = pa_hal_interface_pcm_open(u->hal_interface,
(void **)&u->pcm_handle,
DIRECTION_OUT,
&sample_spec,
fail:
if (u->pcm_handle) {
- pa_hal_manager_pcm_close(u->hal_manager, u->pcm_handle);
+ pa_hal_interface_pcm_close(u->hal_interface, u->pcm_handle);
u->pcm_handle = NULL;
}
return -PA_ERR_IO;
pa_memchunk chunk;
frame_size = pa_frame_size(&u->sink->sample_spec);
- pa_hal_manager_pcm_available(u->hal_manager, u->pcm_handle, &avail);
+ pa_hal_interface_pcm_available(u->hal_interface, u->pcm_handle, &avail);
if ((avail == 0) && !(u->first)) {
break;
}
pa_sink_render_full(u->sink, frames_to_write * frame_size, &chunk);
p = pa_memblock_acquire(chunk.memblock);
- pa_hal_manager_pcm_write(u->hal_manager, u->pcm_handle, (const char*)p + chunk.index, (uint32_t)frames_to_write);
+ pa_hal_interface_pcm_write(u->hal_interface, u->pcm_handle, (const char*)p + chunk.index, (uint32_t)frames_to_write);
pa_memblock_release(chunk.memblock);
pa_memblock_unref(chunk.memblock);
} else {
if (u->first) {
pa_log_info("Starting playback.");
- pa_hal_manager_pcm_start(u->hal_manager, u->pcm_handle);
+ pa_hal_interface_pcm_start(u->hal_interface, u->pcm_handle);
u->first = false;
}
pa_rtpoll_set_timer_relative(u->rtpoll, (10 * PA_USEC_PER_MSEC));
revents = pollfd->revents;
if (revents & ~POLLOUT) {
pa_log_debug("Poll error 0x%x occured, try recover.", revents);
- pa_hal_manager_pcm_recover(u->hal_manager, u->pcm_handle, revents);
+ pa_hal_interface_pcm_recover(u->hal_interface, u->pcm_handle, revents);
u->first = true;
revents = 0;
} else {
u->core = m->core;
u->module = m;
u->first = true;
- u->hal_manager = pa_hal_manager_get(u->core);
+ u->hal_interface = pa_hal_interface_get(u->core);
u->rtpoll = pa_rtpoll_new();
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
#include <pulsecore/rtpoll.h>
#include <pulsecore/poll.h>
-#include "hal-manager.h"
+#include "hal-interface.h"
#include "module-tizenaudio-source-symdef.h"
uint64_t read_count;
pa_usec_t latency_time;
- pa_hal_manager *hal_manager;
+ pa_hal_interface *hal_interface;
};
static const char* const valid_modargs[] = {
u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
- ret = pa_hal_manager_pcm_get_fd(u->hal_manager, u->pcm_handle, &fd);
+ ret = pa_hal_interface_pcm_get_fd(u->hal_interface, u->pcm_handle, &fd);
if (ret < 0 || fd < 0) {
pa_log_error("Failed to get fd(%d) of PCM device %d", fd, ret);
return -1;
pa_assert(u);
pa_assert(u->pcm_handle);
- ret = pa_hal_manager_pcm_close(u->hal_manager, u->pcm_handle);
+ ret = pa_hal_interface_pcm_close(u->hal_interface, u->pcm_handle);
if (ret) {
pa_log_error("Error closing PCM device %x", ret);
}
pa_log_info("Trying resume...");
sample_spec = u->source->sample_spec;
- ret = pa_hal_manager_pcm_open(u->hal_manager,
+ ret = pa_hal_interface_pcm_open(u->hal_interface,
(void **)&u->pcm_handle,
DIRECTION_IN,
&sample_spec,
fail:
if (u->pcm_handle) {
- pa_hal_manager_pcm_close(u->hal_manager, u->pcm_handle);
+ pa_hal_interface_pcm_close(u->hal_interface, u->pcm_handle);
u->pcm_handle = NULL;
}
return -PA_ERR_IO;
pa_memchunk chunk;
frame_size = pa_frame_size(&u->source->sample_spec);
- pa_hal_manager_pcm_available(u->hal_manager, u->pcm_handle, &avail);
+ pa_hal_interface_pcm_available(u->hal_interface, u->pcm_handle, &avail);
if (avail == 0) {
break;
}
frames_to_read = (size_t)avail;
p = pa_memblock_acquire(chunk.memblock);
- pa_hal_manager_pcm_read(u->hal_manager, u->pcm_handle, p, (uint32_t)frames_to_read);
+ pa_hal_interface_pcm_read(u->hal_interface, u->pcm_handle, p, (uint32_t)frames_to_read);
pa_memblock_release(chunk.memblock);
chunk.index = 0;
if (u->first) {
pa_log_info("Starting capture.");
- pa_hal_manager_pcm_start(u->hal_manager, u->pcm_handle);
+ pa_hal_interface_pcm_start(u->hal_interface, u->pcm_handle);
u->first = false;
u->timestamp = now;
}
revents = pollfd->revents;
if (revents & ~POLLIN) {
pa_log_debug("Poll error 0x%x occured, try recover.", revents);
- pa_hal_manager_pcm_recover(u->hal_manager, u->pcm_handle, revents);
+ pa_hal_interface_pcm_recover(u->hal_interface, u->pcm_handle, revents);
u->first = true;
revents = 0;
} else {
u->core = m->core;
u->module = m;
u->first = true;
- u->hal_manager = pa_hal_manager_get(u->core);
+ u->hal_interface = pa_hal_interface_get(u->core);
u->rtpoll = pa_rtpoll_new();
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
#define foostreammanagerprivfoo
#include "stream-manager.h"
-#include "hal-manager.h"
+#include "hal-interface.h"
#include "communicator.h"
#include "device-manager.h"
#include "subscribe-observer.h"
struct _stream_manager {
pa_core *core;
- pa_hal_manager *hal;
+ pa_hal_interface *hal;
pa_device_manager *dm;
pa_subscribe_observer *subs_ob;
/* Get volume value by type & level */
if (is_hal_volume) {
/* Get value from HAL */
- if (pa_hal_manager_get_volume_value(m->hal, volume_type, NULL,
+ if (pa_hal_interface_get_volume_value(m->hal, volume_type, NULL,
CONVERT_TO_HAL_DIRECTION(stream_type), volume_level, &volume_linear)) {
return -1;
}
}
if (is_hal_volume)
- if (pa_hal_manager_set_volume_level(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+ if (pa_hal_interface_set_volume_level(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
return -1;
volumes = m->volume_infos;
/* Get level */
if (is_hal_volume) {
/* from HAL */
- if (pa_hal_manager_get_volume_level(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+ if (pa_hal_interface_get_volume_level(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
return -1;
} else {
/* from stream-manager */
/* Get max level */
if (is_hal_volume) {
/* from HAL */
- if (pa_hal_manager_get_volume_level_max(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+ if (pa_hal_interface_get_volume_level_max(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
return -1;
} else {
/* from stream-manager */
}
if (is_hal_volume)
- if (pa_hal_manager_set_volume_level(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+ if (pa_hal_interface_set_volume_level(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
return -1;
/* Get modifier for gain */
}
if (is_hal_volume)
- if (pa_hal_manager_set_volume_level(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+ if (pa_hal_interface_set_volume_level(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
return -1;
/* Get modifier for gain */
}
if (is_hal_volume)
- if (pa_hal_manager_set_volume_mute(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), (uint32_t)volume_mute))
+ if (pa_hal_interface_set_volume_mute(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), (uint32_t)volume_mute))
return -1;
/* Set mute */
}
if (is_hal_volume)
- if (pa_hal_manager_set_volume_mute(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_mute))
+ if (pa_hal_interface_set_volume_mute(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_mute))
return -1;
if (stream_type == STREAM_SINK_INPUT)
(m->cur_highest_priority.role_so);
route_option.name = ((stream_route_option*)user_data)->name;
route_option.value = ((stream_route_option*)user_data)->value;
- pa_hal_manager_update_route_option(m->hal, &route_option);
+ pa_hal_interface_update_route_option(m->hal, &route_option);
}
break;
}
stream_conn_info.direction = (type == STREAM_SINK_INPUT) ? DIRECTION_OUT : DIRECTION_IN;
stream_conn_info.idx = (type == STREAM_SINK_INPUT) ? ((pa_sink_input*)s)->index : ((pa_source_output*)s)->index;
stream_conn_info.is_connected = (command == NOTIFY_COMMAND_INFORM_STREAM_CONNECTED) ? true : false;
- pa_hal_manager_notify_stream_connection_changed(m->hal, &stream_conn_info);
+ pa_hal_interface_notify_stream_connection_changed(m->hal, &stream_conn_info);
}
break;
}
info.direction = (io_direction_t)!stream_type;
info.sample_spec = GET_STREAM_NEW_SAMPLE_SPEC_PTR(new_data, stream_type);
- if (!pa_hal_manager_get_buffer_attribute(m->hal, &info, (uint32_t*)&maxlength, (uint32_t*)&tlength,
+ if (!pa_hal_interface_get_buffer_attribute(m->hal, &info, (uint32_t*)&maxlength, (uint32_t*)&tlength,
(uint32_t*)&prebuf, (uint32_t*)&minreq, (uint32_t*)&fragsize)) {
pa_log_info(" - maxlength:%d, tlength:%d, prebuf:%d, minreq:%d, fragsize:%d", maxlength, tlength, prebuf, minreq, fragsize);
pa_proplist_setf(GET_STREAM_NEW_PROPLIST(new_data, stream_type), "maxlength", "%d", maxlength);
m = pa_xnew0(pa_stream_manager, 1);
m->core = c;
- m->hal = pa_hal_manager_get(c);
- if (pa_hal_manager_add_message_callback(m->hal, message_cb, m))
+ m->hal = pa_hal_interface_get(c);
+ if (pa_hal_interface_add_message_callback(m->hal, message_cb, m))
pa_log_warn("skip adding message callback");
m->dm = pa_device_manager_get(c);
m->subs_ob = pa_subscribe_observer_get(c);
deinit_stream_map(m);
deinit_ipc(m);
if (m->hal) {
- pa_hal_manager_remove_message_callback(m->hal, message_cb);
- pa_hal_manager_unref(m->hal);
+ pa_hal_interface_remove_message_callback(m->hal, message_cb);
+ pa_hal_interface_unref(m->hal);
}
if (m->dm)
pa_device_manager_unref(m->dm);
pa_device_manager_unref(m->dm);
if (m->hal) {
- pa_hal_manager_remove_message_callback(m->hal, message_cb);
- pa_hal_manager_unref(m->hal);
+ pa_hal_interface_remove_message_callback(m->hal, message_cb);
+ pa_hal_interface_unref(m->hal);
}
pa_xfree(m);