remove unnecessary "audio delay" feature.

This commit is contained in:
F. Duncanh
2023-02-07 23:54:23 -05:00
parent dfd98efbab
commit ad451b4c33
8 changed files with 25 additions and 41 deletions

View File

@@ -400,11 +400,6 @@ from sources like Apple Music in Audio-Only (ALAC) mode: run
a image viewer with an autoreload feature: an example is “feh”: run
<code>feh -R 1 &lt;name&gt;</code>” in the foreground; terminate feh
and then Uxplay with “<code>ctrl-C fg ctrl-C</code>”.</p></li>
<li><p>In Audio-Only mode the server needs to specify a latency to the
client so the client can show video in sync with audio played on the
server. The default is 0.25 seconds: this can be changed with the
<code>-ao x.y</code> option, where x.y is a decimal like 0.25 in the
range [0.0, 10.0], with microsecond resolution.</p></li>
</ul>
<p><strong>One common problem involves GStreamer attempting to use
incorrectly-configured or absent accelerated hardware h264 video
@@ -780,11 +775,13 @@ parameters to be included with the audiosink name. (Some choices of
audiosink might not work on your system.)</p>
<p><strong>-as 0</strong> (or just <strong>-a</strong>) suppresses
playing of streamed audio, but displays streamed video.</p>
<p><strong>-ao x.y</strong> specifies an audio latency) in (decimal)
seconds in Audio-only (ALAC), that is reported to the client so it can
synchronise its video with audio played on the server. Values in the
range [0.0, 10.0] seconds are allowed, and will be converted to a whole
number of microseconds. Default is 0.25 sec (250000 usec).</p>
<p><strong>-al <em>x</em></strong> specifies an audio latency <em>x</em>
in (decimal) seconds in Audio-only (ALAC), that is reported to the
client. Values in the range [0.0, 10.0] seconds are allowed, and will be
converted to a whole number of microseconds. Default is 0.25 sec (250000
usec). (This replaces the <code>-ao</code> option introduced in v1.62,
as a workaround for a problem that is now fixed: it is not clear if
changing the value of <em>x</em> produces any effects, however.)</p>
<p><strong>-ca <em>filename</em></strong> provides a file (where
<em>filename</em> can include a full path) used for output of “cover
art” (from Apple Music, <em>etc.</em>,) in audio-only ALAC mode. This

View File

@@ -338,10 +338,6 @@ run "`uxplay -ca <name> &`" in the background, then run a image viewer with an a
is "feh": run "``feh -R 1 <name>``"
in the foreground; terminate feh and then Uxplay with "`ctrl-C fg ctrl-C`".
* In Audio-Only mode the server needs to specify a latency to the client so the client can show video in sync with audio played
on the server. The default is 0.25 seconds: this can be changed with the `-ao x.y` option, where x.y is a decimal
like 0.25 in the range [0.0, 10.0], with microsecond resolution.
**One common problem involves GStreamer
attempting to use incorrectly-configured or absent accelerated hardware h264
video decoding (e.g., VAAPI).
@@ -661,9 +657,10 @@ which will not work if a firewall is running.
**-as 0** (or just **-a**) suppresses playing of streamed audio, but displays streamed video.
**-ao x.y** specifies an audio latency) in (decimal) seconds in Audio-only (ALAC), that is reported to the client so it
can synchronise its video with audio played on the server. Values in the range [0.0, 10.0] seconds are allowed, and
will be converted to a whole number of microseconds. Default is 0.25 sec (250000 usec).
**-al _x_** specifies an audio latency _x_ in (decimal) seconds in Audio-only (ALAC), that is reported to the client. Values
in the range [0.0, 10.0] seconds are allowed, and will be converted to a whole number of microseconds. Default
is 0.25 sec (250000 usec). (This replaces the `-ao` option introduced in v1.62, as a workaround for a problem that
is now fixed: it is not clear if changing the value of _x_ produces any effects, however.)
**-ca _filename_** provides a file (where _filename_ can include a full path) used for output of "cover art"
(from Apple Music, _etc._,) in audio-only ALAC mode. This file is overwritten with the latest cover art as

View File

@@ -404,12 +404,6 @@ for help with this or other problems.
"`feh -R 1 <name>`" in the foreground; terminate feh and then Uxplay
with "`ctrl-C fg ctrl-C`".
- In Audio-Only mode the server needs to specify a latency to the
client so the client can show video in sync with audio played on the
server. The default is 0.25 seconds: this can be changed with the
`-ao x.y` option, where x.y is a decimal like 0.25 in the range
\[0.0, 10.0\], with microsecond resolution.
**One common problem involves GStreamer attempting to use
incorrectly-configured or absent accelerated hardware h264 video
decoding (e.g., VAAPI). Try "`uxplay -avdec`" to force software video
@@ -802,11 +796,13 @@ name. (Some choices of audiosink might not work on your system.)
**-as 0** (or just **-a**) suppresses playing of streamed audio, but
displays streamed video.
**-ao x.y** specifies an audio latency) in (decimal) seconds in
Audio-only (ALAC), that is reported to the client so it can synchronise
its video with audio played on the server. Values in the range \[0.0,
10.0\] seconds are allowed, and will be converted to a whole number of
microseconds. Default is 0.25 sec (250000 usec).
**-al *x*** specifies an audio latency *x* in (decimal) seconds in
Audio-only (ALAC), that is reported to the client. Values in the range
\[0.0, 10.0\] seconds are allowed, and will be converted to a whole
number of microseconds. Default is 0.25 sec (250000 usec). (This
replaces the `-ao` option introduced in v1.62, as a workaround for a
problem that is now fixed: it is not clear if changing the value of *x*
produces any effects, however.)
**-ca *filename*** provides a file (where *filename* can include a full
path) used for output of "cover art" (from Apple Music, *etc.*,) in

View File

@@ -503,7 +503,6 @@ raop_handler_setup(raop_conn_t *conn,
unsigned short remote_cport = 0;
unsigned char ct;
unsigned int sr = AUDIO_SAMPLE_RATE; /* all AirPlay audio formats supported so far have sample rate 44.1kHz */
unsigned int ad = (unsigned int) conn->raop->audio_delay_micros;
uint64_t uint_val = 0;
plist_t req_stream_control_port_node = plist_dict_get_item(req_stream_node, "controlPort");
@@ -549,7 +548,7 @@ raop_handler_setup(raop_conn_t *conn,
}
if (conn->raop_rtp) {
raop_rtp_start_audio(conn->raop_rtp, use_udp, &remote_cport, &cport, &dport, &ct, &sr, &ad);
raop_rtp_start_audio(conn->raop_rtp, use_udp, &remote_cport, &cport, &dport, &ct, &sr);
logger_log(conn->raop->logger, LOGGER_DEBUG, "RAOP initialized success");
} else {
logger_log(conn->raop->logger, LOGGER_ERR, "RAOP not initialized at SETUP, playing will fail!");

View File

@@ -54,7 +54,6 @@ struct raop_rtp_s {
// Time and sync
raop_ntp_t *ntp;
double rtp_clock_rate;
unsigned int audio_delay_micros;
int64_t rtp_sync_offset;
raop_rtp_sync_data_t sync_data[RAOP_RTP_SYNC_DATA_COUNT];
int sync_data_index;
@@ -712,7 +711,7 @@ raop_rtp_thread_udp(void *arg)
// Start rtp service, three udp ports
void
raop_rtp_start_audio(raop_rtp_t *raop_rtp, int use_udp, unsigned short *control_rport, unsigned short *control_lport,
unsigned short *data_lport, unsigned char *ct, unsigned int *sr, unsigned int *ad)
unsigned short *data_lport, unsigned char *ct, unsigned int *sr)
{
logger_log(raop_rtp->logger, LOGGER_INFO, "raop_rtp starting audio");
int use_ipv6 = 0;
@@ -727,7 +726,6 @@ raop_rtp_start_audio(raop_rtp_t *raop_rtp, int use_udp, unsigned short *control_
raop_rtp->ct = *ct;
raop_rtp->rtp_clock_rate = SECOND_IN_NSECS / *sr;
raop_rtp->audio_delay_micros = *ad;
/* Initialize ports and sockets */
raop_rtp->control_lport = *control_lport;

View File

@@ -30,7 +30,7 @@ raop_rtp_t *raop_rtp_init(logger_t *logger, raop_callbacks_t *callbacks, raop_nt
int remotelen, const unsigned char *aeskey, const unsigned char *aesiv);
void raop_rtp_start_audio(raop_rtp_t *raop_rtp, int use_udp, unsigned short *control_rport, unsigned short *control_lport,
unsigned short *data_lport, unsigned char *ct, unsigned int *sr, unsigned int *ad);
unsigned short *data_lport, unsigned char *ct, unsigned int *sr);
void raop_rtp_set_volume(raop_rtp_t *raop_rtp, float volume);
void raop_rtp_set_metadata(raop_rtp_t *raop_rtp, const char *data, int datalen);

View File

@@ -73,7 +73,7 @@ UxPlay 1.63: An open\-source AirPlay mirroring (+ audio streaming) server.
.TP
\fB\-as\fR 0 (or \fB\-a\fR) Turn audio off, streamed video only.
.TP
\fB\-ao\fR x.y Audio-only mode latency in seconds (default 0.25) used by client.
\fB\-al\fR x Audio latency in seconds (default 0.25) reported to client.
.TP
\fB\-ca\fI fn \fR In Airplay Audio (ALAC) mode, write cover-art to file fn.
.TP

View File

@@ -388,7 +388,7 @@ static void print_info (char *name) {
printf(" some choices:pulsesink,alsasink,pipewiresink,jackaudiosink,\n");
printf(" osssink,oss4sink,osxaudiosink,wasapisink,directsoundsink.\n");
printf("-as 0 (or -a) Turn audio off, streamed video only\n");
printf("-ao x.y Audio-only mode latency in seconds (default 0.25) used by client.\n");
printf("-al x Audio latency in seconds (default 0.25) reported to client.\n");
printf("-ca <fn> In Airplay Audio (ALAC) mode, write cover-art to file <fn>\n");
printf("-reset n Reset after 3n seconds client silence (default %d, 0=never)\n", NTP_TIMEOUT_LIMIT);
printf("-nc do Not Close video window when client stops mirroring\n");
@@ -738,7 +738,7 @@ static void parse_arguments (int argc, char *argv[]) {
bt709_fix = true;
} else if (arg == "-nohold") {
max_connections = 3;
} else if (arg == "-ao") {
} else if (arg == "-al") {
int n;
char *end;
if (i < argc - 1 && *argv[i+1] != '-') {
@@ -748,7 +748,7 @@ static void parse_arguments (int argc, char *argv[]) {
continue;
}
}
fprintf(stderr, "invalid argument -ao %s: must be a decimal time offset in seconds, range [0,10]\n"
fprintf(stderr, "invalid argument -al %s: must be a decimal time offset in seconds, range [0,10]\n"
"(like 5 or 4.8, which will be converted to a whole number of microseconds)\n", argv[i]);
exit(1);
} else {
@@ -1280,9 +1280,6 @@ int main (int argc, char *argv[]) {
logger_set_level(render_logger, debug_log ? LOGGER_DEBUG : LOGGER_INFO);
if (use_audio) {
if (audiodelay >= 0) {
LOGI("Audio-only ALAC streams will be delayed by %d microseconds", audiodelay);
}
audio_renderer_init(render_logger, audiosink.c_str());
} else {
LOGI("audio_disabled");