Name: pulseaudio-modules-tizen
Summary: Pulseaudio modules for Tizen
-Version: 15.0.52
+Version: 15.0.53
Release: 0
Group: Multimedia/Audio
License: LGPL-2.1+
#define DEVICE_MAP_FILE PA_DEFAULT_CONFIG_DIR"/device-map.json"
#define DEVICE_MAP_FILE_CONTAINER PA_DEFAULT_CONFIG_DIR"/device-map-container.json"
-#define DEVICE_STR_MAX 40
+#define DEVICE_STR_MAX 256
#define DEVICE_DIRECTION_MAX 3
#define DEVICE_MODULE_STRING_MAX 256
-#define DEVICE_PARAM_STRING_MAX 150
+#define DEVICE_PARAM_STRING_MAX 512
#define DEVICE_AVAIL_COND_NUM_MAX 2
#define DEVICE_AVAIL_COND_STR_MAX 6
#define DEVICE_FILE_PER_TYPE_MAX 4
#define DEVICE_TYPE_PROP_ROLE "role"
#define DEVICE_TYPE_STR_MAX 20
-#define DEVICE_NAME_MAX 30
+#define DEVICE_NAME_MAX 128
/* Properties of sink/sources */
"channels=<number of channels> "
"channel_map=<channel map>"
"fragments=<number of fragments> "
- "fragment_size=<fragment size> ");
+ "fragment_size=<fragment size> "
+ "rtpoll_timeout=<rtpoll loop timeout>");
static const char* const valid_modargs[] = {
"sink_name",
"channel_map",
"fragments",
"fragment_size",
+ "rtpoll_timeout",
NULL
};
"channels=<number of channels> "
"channel_map=<channel map>"
"fragments=<number of fragments> "
- "fragment_size=<fragment size> ");
+ "fragment_size=<fragment size> "
+ "rtpoll_timeout=<rtpoll loop timeout>");
static const char* const valid_modargs[] = {
"source_name",
"channel_map",
"fragments",
"fragment_size",
+ "rtpoll_timeout",
NULL
};
#define DEFAULT_SINK_NAME "tizenaudio-sink2"
-#define DEVICE_NAME_MAX 30
#define DEFAULT_FRAGMENT_MSEC 10
#define DEFAULT_FRAGMENTS 4
bool preprocess_state;
pa_rtpoll_item *rtpoll_item;
+ uint32_t rtpoll_timeout;
uint64_t write_count;
pa_hal_interface *hal_interface;
if (u->rtpoll_item)
pa_rtpoll_item_free(u->rtpoll_item);
- 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_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;
+ if (u->rtpoll_timeout == 0) {
+ pa_log_error("Failed to get fd of PCM device %d", ret);
+ return -1;
+ }
+
+ pa_log_info("Failed to get fd but It will render every rtpoll_timeout(%d)", u->rtpoll_timeout);
+
+ return 0;
}
+
+ u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
+ pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
+
pollfd->fd = fd;
pollfd->events = POLLOUT | POLLERR | POLLNVAL;
pa_hal_interface_pcm_start(u->hal_interface, u->pcm_handle);
u->first = false;
}
- }
+
+ if (u->rtpoll_timeout)
+ pa_rtpoll_set_timer_relative(u->rtpoll, (u->rtpoll_timeout * PA_USEC_PER_MSEC));
+ } else
+ pa_rtpoll_set_timer_disabled(u->rtpoll);
/* Hmm, nothing to do. Let's sleep */
if ((ret = pa_rtpoll_run(u->rtpoll)) < 0)
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%zu", buffer_frames * frame_size);
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%zu", period_frames * frame_size);
+ pa_modargs_get_value_u32(ma, "rtpoll_timeout", &u->rtpoll_timeout);
+
if (pa_modargs_get_value(ma, "device_id", NULL))
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_BUS, "usb");
#define DEFAULT_SOURCE_NAME "tizenaudio-source2"
-#define DEVICE_NAME_MAX 30
#define DEFAULT_FRAGMENT_MSEC 10
#define DEFAULT_FRAGMENTS 4
bool preprocess_state;
pa_rtpoll_item *rtpoll_item;
+ uint32_t rtpoll_timeout;
uint64_t read_count;
pa_usec_t latency_time;
if (u->rtpoll_item)
pa_rtpoll_item_free(u->rtpoll_item);
- 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_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;
+ if (u->rtpoll_timeout == 0) {
+ pa_log_error("Failed to get fd of PCM device %d", ret);
+ return -1;
+ }
+
+ pa_log_info("Failed to get fd but It will render every rtpoll_timeout(%d)", u->rtpoll_timeout);
+
+ return 0;
}
+
+ u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
+ pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
+
pollfd->fd = fd;
pollfd->events = POLLIN | POLLERR | POLLNVAL;
pa_assert(u);
- /* Fill the buffer up the latency size */
-
pa_hal_interface_pcm_available(u->hal_interface, u->pcm_handle, &avail);
if (frames_to_read > avail) {
pa_log_debug("not enough avail size. frames_to_read(%zu), avail(%u)", frames_to_read, avail);
pa_hal_interface_pcm_start(u->hal_interface, u->pcm_handle);
u->first = false;
}
- }
+
+ if (u->rtpoll_timeout)
+ pa_rtpoll_set_timer_relative(u->rtpoll, (u->rtpoll_timeout * PA_USEC_PER_MSEC));
+ } else
+ pa_rtpoll_set_timer_disabled(u->rtpoll);
/* Hmm, nothing to do. Let's sleep */
if ((ret = pa_rtpoll_run(u->rtpoll)) < 0)
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%zu", buffer_frames * frame_size);
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%zu", period_frames * frame_size);
+ pa_modargs_get_value_u32(ma, "rtpoll_timeout", &u->rtpoll_timeout);
+
if (pa_modargs_get_value(ma, "device_id", NULL))
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_BUS, "usb");
#include "hal-interface.h"
#include "tizenaudio-util.h"
-#define CARD_NAME_MAX 32
-#define DEVICE_NAME_MAX 32
+#define CARD_NAME_MAX 256
+#define DEVICE_NAME_MAX 256
/*
* Extract card string from the device_string that contains device name like 'hw:1,2'