mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
introduce new flag that marks sinks/sources which can adjust the latency dynamically
This commit is contained in:
parent
9bca59efc1
commit
44ca897769
8 changed files with 64 additions and 21 deletions
|
|
@ -220,19 +220,17 @@ char *pa_sink_list_to_string(pa_core *c) {
|
|||
v[PA_VOLUME_SNPRINT_MAX],
|
||||
vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
|
||||
cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t;
|
||||
pa_usec_t min_latency, max_latency;
|
||||
const char *cmn;
|
||||
|
||||
cmn = pa_channel_map_to_pretty_name(&sink->channel_map);
|
||||
|
||||
pa_sink_get_latency_range(sink, &min_latency, &max_latency);
|
||||
|
||||
pa_strbuf_printf(
|
||||
s,
|
||||
" %c index: %u\n"
|
||||
"\tname: <%s>\n"
|
||||
"\tdriver: <%s>\n"
|
||||
"\tflags: %s%s%s%s%s%s%s\n"
|
||||
"\tflags: %s%s%s%s%s%s%s%s\n"
|
||||
"\tstate: %s\n"
|
||||
"\tvolume: %s%s%s\n"
|
||||
"\t balance %0.2f\n"
|
||||
|
|
@ -240,7 +238,6 @@ char *pa_sink_list_to_string(pa_core *c) {
|
|||
"\tvolume steps: %u\n"
|
||||
"\tmuted: %s\n"
|
||||
"\tcurrent latency: %0.2f ms\n"
|
||||
"\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n"
|
||||
"\tmax request: %lu KiB\n"
|
||||
"\tmax rewind: %lu KiB\n"
|
||||
"\tmonitor source: %u\n"
|
||||
|
|
@ -259,6 +256,7 @@ char *pa_sink_list_to_string(pa_core *c) {
|
|||
sink->flags & PA_SINK_DECIBEL_VOLUME ? "DECIBEL_VOLUME " : "",
|
||||
sink->flags & PA_SINK_LATENCY ? "LATENCY " : "",
|
||||
sink->flags & PA_SINK_FLAT_VOLUME ? "FLAT_VOLUME" : "",
|
||||
sink->flags & PA_SINK_DYNAMIC_LATENCY ? "DYNAMIC_LATENCY" : "",
|
||||
sink_state_to_string(pa_sink_get_state(sink)),
|
||||
pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink, FALSE)),
|
||||
sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t " : "",
|
||||
|
|
@ -270,9 +268,6 @@ char *pa_sink_list_to_string(pa_core *c) {
|
|||
sink->n_volume_steps,
|
||||
pa_yes_no(pa_sink_get_mute(sink, FALSE)),
|
||||
(double) pa_sink_get_latency(sink) / (double) PA_USEC_PER_MSEC,
|
||||
(double) pa_sink_get_requested_latency(sink) / (double) PA_USEC_PER_MSEC,
|
||||
(double) min_latency / PA_USEC_PER_MSEC,
|
||||
(double) max_latency / PA_USEC_PER_MSEC,
|
||||
(unsigned long) pa_sink_get_max_request(sink) / 1024,
|
||||
(unsigned long) pa_sink_get_max_rewind(sink) / 1024,
|
||||
sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
|
||||
|
|
@ -283,6 +278,18 @@ char *pa_sink_list_to_string(pa_core *c) {
|
|||
pa_sink_used_by(sink),
|
||||
pa_sink_linked_by(sink));
|
||||
|
||||
if (sink->flags & PA_SINK_DYNAMIC_LATENCY) {
|
||||
pa_usec_t min_latency, max_latency;
|
||||
pa_sink_get_latency_range(sink, &min_latency, &max_latency);
|
||||
|
||||
pa_strbuf_printf(
|
||||
s,
|
||||
"\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n",
|
||||
(double) pa_sink_get_requested_latency(sink) / (double) PA_USEC_PER_MSEC,
|
||||
(double) min_latency / PA_USEC_PER_MSEC,
|
||||
(double) max_latency / PA_USEC_PER_MSEC);
|
||||
}
|
||||
|
||||
if (sink->card)
|
||||
pa_strbuf_printf(s, "\tcard: %u <%s>\n", sink->card->index, sink->card->name);
|
||||
if (sink->module)
|
||||
|
|
@ -313,19 +320,16 @@ char *pa_source_list_to_string(pa_core *c) {
|
|||
v[PA_VOLUME_SNPRINT_MAX],
|
||||
vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
|
||||
cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t;
|
||||
pa_usec_t min_latency, max_latency;
|
||||
const char *cmn;
|
||||
|
||||
cmn = pa_channel_map_to_pretty_name(&source->channel_map);
|
||||
|
||||
pa_source_get_latency_range(source, &min_latency, &max_latency);
|
||||
|
||||
pa_strbuf_printf(
|
||||
s,
|
||||
" %c index: %u\n"
|
||||
"\tname: <%s>\n"
|
||||
"\tdriver: <%s>\n"
|
||||
"\tflags: %s%s%s%s%s%s\n"
|
||||
"\tflags: %s%s%s%s%s%s%s\n"
|
||||
"\tstate: %s\n"
|
||||
"\tvolume: %s%s%s\n"
|
||||
"\t balance %0.2f\n"
|
||||
|
|
@ -333,7 +337,6 @@ char *pa_source_list_to_string(pa_core *c) {
|
|||
"\tvolume steps: %u\n"
|
||||
"\tmuted: %s\n"
|
||||
"\tcurrent latency: %0.2f ms\n"
|
||||
"\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n"
|
||||
"\tmax rewind: %lu KiB\n"
|
||||
"\tsample spec: %s\n"
|
||||
"\tchannel map: %s%s%s\n"
|
||||
|
|
@ -349,6 +352,7 @@ char *pa_source_list_to_string(pa_core *c) {
|
|||
source->flags & PA_SOURCE_HW_VOLUME_CTRL ? "HW_VOLUME_CTRL " : "",
|
||||
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "DECIBEL_VOLUME " : "",
|
||||
source->flags & PA_SOURCE_LATENCY ? "LATENCY " : "",
|
||||
source->flags & PA_SOURCE_DYNAMIC_LATENCY ? "DYNAMIC_LATENCY" : "",
|
||||
source_state_to_string(pa_source_get_state(source)),
|
||||
pa_cvolume_snprint(cv, sizeof(cv), pa_source_get_volume(source, FALSE)),
|
||||
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t " : "",
|
||||
|
|
@ -360,9 +364,6 @@ char *pa_source_list_to_string(pa_core *c) {
|
|||
source->n_volume_steps,
|
||||
pa_yes_no(pa_source_get_mute(source, FALSE)),
|
||||
(double) pa_source_get_latency(source) / PA_USEC_PER_MSEC,
|
||||
(double) pa_source_get_requested_latency(source) / PA_USEC_PER_MSEC,
|
||||
(double) min_latency / PA_USEC_PER_MSEC,
|
||||
(double) max_latency / PA_USEC_PER_MSEC,
|
||||
(unsigned long) pa_source_get_max_rewind(source) / 1024,
|
||||
pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec),
|
||||
pa_channel_map_snprint(cm, sizeof(cm), &source->channel_map),
|
||||
|
|
@ -371,6 +372,18 @@ char *pa_source_list_to_string(pa_core *c) {
|
|||
pa_source_used_by(source),
|
||||
pa_source_linked_by(source));
|
||||
|
||||
if (source->flags & PA_SOURCE_DYNAMIC_LATENCY) {
|
||||
pa_usec_t min_latency, max_latency;
|
||||
pa_source_get_latency_range(source, &min_latency, &max_latency);
|
||||
|
||||
pa_strbuf_printf(
|
||||
s,
|
||||
"\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n",
|
||||
(double) pa_source_get_requested_latency(source) / PA_USEC_PER_MSEC,
|
||||
(double) min_latency / PA_USEC_PER_MSEC,
|
||||
(double) max_latency / PA_USEC_PER_MSEC);
|
||||
}
|
||||
|
||||
if (source->monitor_of)
|
||||
pa_strbuf_printf(s, "\tmonitor_of: %u\n", source->monitor_of->index);
|
||||
if (source->card)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue