This introduces a new command to allow setting the latency offset.
Also the card list command now shows the latency offset on the ports.
<optdesc><p>Set the specified source (identified by its symbolic name or numerical index) to the specified port (identified by its symbolic name).</p></optdesc>
</option>
<optdesc><p>Set the specified source (identified by its symbolic name or numerical index) to the specified port (identified by its symbolic name).</p></optdesc>
</option>
+ <option>
+ <p><opt>set-port-latency-offset</opt> <arg>CARD</arg> <arg>PORT</arg> <arg>OFFSET</arg></p>
+ <optdesc><p>Set a latency offset to a specified port (identified by its symbolic name) that belongs to a card (identified by its symbolic name or numerical index).
+ <arg>OFFSET</arg> is a number which represents the latency offset in microseconds</p></optdesc>
+ </option>
+
<option>
<p><opt>set-sink-volume</opt> <arg>SINK</arg> <arg>VOLUME</arg></p>
<optdesc><p>Set the volume of the specified sink (identified by its symbolic name or numerical index).
<option>
<p><opt>set-sink-volume</opt> <arg>SINK</arg> <arg>VOLUME</arg></p>
<optdesc><p>Set the volume of the specified sink (identified by its symbolic name or numerical index).
static pa_bool_t short_list_format = FALSE;
static uint32_t module_index;
static pa_bool_t short_list_format = FALSE;
static uint32_t module_index;
+static int32_t latency_offset;
static pa_bool_t suspend;
static pa_bool_t mute;
static pa_volume_t volume;
static pa_bool_t suspend;
static pa_bool_t mute;
static pa_volume_t volume;
SET_SINK_INPUT_MUTE,
SET_SOURCE_OUTPUT_MUTE,
SET_SINK_FORMATS,
SET_SINK_INPUT_MUTE,
SET_SOURCE_OUTPUT_MUTE,
SET_SINK_FORMATS,
+ SET_PORT_LATENCY_OFFSET,
SUBSCRIBE
} action = NONE;
SUBSCRIBE
} action = NONE;
printf(_("\tPorts:\n"));
for (p = i->ports; *p; p++)
printf(_("\tPorts:\n"));
for (p = i->ports; *p; p++)
- printf("\t\t%s: %s (priority: %u%s)\n", (*p)->name, (*p)->description, (*p)->priority,
- get_available_str_ynonly((*p)->available));
+ printf("\t\t%s: %s (priority: %u%s)\n", (*p)->name, (*p)->description,
+ (*p)->priority, get_available_str_ynonly((*p)->available));
printf(_("\tPorts:\n"));
for (p = i->ports; *p; p++)
printf(_("\tPorts:\n"));
for (p = i->ports; *p; p++)
- printf("\t\t%s: %s (priority: %u%s)\n", (*p)->name, (*p)->description, (*p)->priority,
- get_available_str_ynonly((*p)->available));
+ printf("\t\t%s: %s (priority: %u%s)\n", (*p)->name, (*p)->description,
+ (*p)->priority, get_available_str_ynonly((*p)->available));
printf(_("\tPorts:\n"));
for (p = i->ports; *p; p++) {
pa_card_profile_info **pr = (*p)->profiles;
printf(_("\tPorts:\n"));
for (p = i->ports; *p; p++) {
pa_card_profile_info **pr = (*p)->profiles;
- printf(_("\t\t%s: %s (priority: %u%s)\n"), (*p)->name, (*p)->description, (*p)->priority,
+ printf("\t\t%s: %s (priority: %u, latency offset: %" PRId64 " usec%s)\n", (*p)->name,
+ (*p)->description, (*p)->priority, (*p)->latency_offset,
get_available_str_ynonly((*p)->available));
if (!pa_proplist_isempty((*p)->proplist)) {
get_available_str_ynonly((*p)->available));
if (!pa_proplist_isempty((*p)->proplist)) {
set_sink_formats(c, sink_idx, formats);
break;
set_sink_formats(c, sink_idx, formats);
break;
+ case SET_PORT_LATENCY_OFFSET:
+ pa_operation_unref(pa_context_set_port_latency_offset(c, card_name, port_name, latency_offset, simple_callback, NULL));
+ break;
+
case SUBSCRIBE:
pa_context_set_subscribe_callback(c, context_subscribe_callback, NULL);
case SUBSCRIBE:
pa_context_set_subscribe_callback(c, context_subscribe_callback, NULL);
printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink|source)-mute", _("NAME|#N 1|0"));
printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink-input|source-output)-mute", _("#N 1|0"));
printf("%s %s %s %s\n", argv0, _("[options]"), "set-sink-formats", _("#N FORMATS"));
printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink|source)-mute", _("NAME|#N 1|0"));
printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink-input|source-output)-mute", _("#N 1|0"));
printf("%s %s %s %s\n", argv0, _("[options]"), "set-sink-formats", _("#N FORMATS"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "set-port-latency-offset", _("CARD-NAME|CARD-#N PORT OFFSET"));
printf("%s %s %s\n", argv0, _("[options]"), "subscribe");
printf(_("\n"
printf("%s %s %s\n", argv0, _("[options]"), "subscribe");
printf(_("\n"
action = SET_SINK_FORMATS;
formats = pa_xstrdup(argv[optind+2]);
action = SET_SINK_FORMATS;
formats = pa_xstrdup(argv[optind+2]);
+ } else if (pa_streq(argv[optind], "set-port-latency-offset")) {
+ action = SET_PORT_LATENCY_OFFSET;
+
+ if (argc != optind+4) {
+ pa_log(_("You have to specify a card name/index, a port name and a latency offset"));
+ goto quit;
+ }
+
+ card_name = pa_xstrdup(argv[optind+1]);
+ port_name = pa_xstrdup(argv[optind+2]);
+ if (pa_atoi(argv[optind + 3], &latency_offset) < 0) {
+ pa_log(_("Could not parse latency offset"));
+ goto quit;
+ }
+
} else if (pa_streq(argv[optind], "help")) {
help(bn);
ret = 0;
} else if (pa_streq(argv[optind], "help")) {
help(bn);
ret = 0;