(double) pa_bytes_to_usec(u->hwbuf_size, &ss) / PA_USEC_PER_MSEC);
pa_sink_set_max_request(u->sink, u->hwbuf_size);
+ pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
if (u->use_tsched) {
- fix_min_sleep_wakeup(u);
- fix_tsched_watermark(u);
-
u->watermark_step = pa_usec_to_bytes(TSCHED_WATERMARK_STEP_USEC, &u->sink->sample_spec);
- pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
+ fix_min_sleep_wakeup(u);
+ fix_tsched_watermark(u);
pa_sink_set_latency_range(u->sink,
0,
pa_log_info("Time scheduling watermark is %0.2fms",
(double) pa_bytes_to_usec(u->tsched_watermark, &ss) / PA_USEC_PER_MSEC);
- }
+ } else
+ u->sink->fixed_latency = pa_bytes_to_usec(u->hwbuf_size, &ss);
reserve_update(u);
(double) pa_bytes_to_usec(u->hwbuf_size, &ss) / PA_USEC_PER_MSEC);
if (u->use_tsched) {
+ u->watermark_step = pa_usec_to_bytes(TSCHED_WATERMARK_STEP_USEC, &u->source->sample_spec);
+
fix_min_sleep_wakeup(u);
fix_tsched_watermark(u);
- u->watermark_step = pa_usec_to_bytes(TSCHED_WATERMARK_STEP_USEC, &u->source->sample_spec);
-
pa_source_set_latency_range(u->source,
0,
pa_bytes_to_usec(u->hwbuf_size, &ss));
pa_log_info("Time scheduling watermark is %0.2fms",
(double) pa_bytes_to_usec(u->tsched_watermark, &ss) / PA_USEC_PER_MSEC);
- }
+ } else
+ u->source->fixed_latency = pa_bytes_to_usec(u->hwbuf_size, &ss);
reserve_update(u);
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
pa_sink_set_max_request(u->sink, PIPE_BUF);
+ u->sink->fixed_latency = pa_bytes_to_usec(PIPE_BUF, &u->sink->sample_spec);
u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
pa_source_set_rtpoll(u->source, u->rtpoll);
+ u->source->fixed_latency = pa_bytes_to_usec(PIPE_BUF, &u->source->sample_spec);
u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
u->source->update_requested_latency = source_update_requested_latency_cb;
u->source->userdata = u;
+ u->block_usec = BLOCK_USEC;
+
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
pa_source_set_rtpoll(u->source, u->rtpoll);
+ u->source->fixed_latency = u->block_usec;
- u->block_usec = BLOCK_USEC;
if (!(u->thread = pa_thread_new(thread_func, u))) {
pa_log("Failed to create thread.");
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
pa_source_set_rtpoll(u->source, u->rtpoll);
u->source->refresh_volume = TRUE;
+ u->source->fixed_latency = pa_bytes_to_usec(u->in_hwbuf_size, &u->source->sample_spec);
if (use_mmap)
u->in_mmap_memblocks = pa_xnew0(pa_memblock*, u->in_nfrags);
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
u->sink->refresh_volume = TRUE;
+ u->sink->fixed_latency = pa_bytes_to_usec(u->out_hwbuf_size, &u->sink->sample_spec);
pa_sink_set_max_request(u->sink, u->out_hwbuf_size);