uxplay 1.62: add audio-only mode time offset option -ao x.y

This commit is contained in:
F. Duncanh
2023-01-14 23:28:35 -05:00
parent 19e2ae46c2
commit 5ab880f0e8
5 changed files with 215 additions and 132 deletions

View File

@@ -1,6 +1,6 @@
<h1
id="uxplay-1.61-airplay-mirror-and-airplay-audio-server-for-linux-macos-and-unix-now-also-runs-on-windows.">UxPlay
1.61: AirPlay-Mirror and AirPlay-Audio server for Linux, macOS, and Unix
id="uxplay-1.62-airplay-mirror-and-airplay-audio-server-for-linux-macos-and-unix-now-also-runs-on-windows.">UxPlay
1.62: AirPlay-Mirror and AirPlay-Audio server for Linux, macOS, and Unix
(now also runs on Windows).</h1>
<h3
id="now-developed-at-the-github-site-httpsgithub.comfdh2uxplay-where-all-user-issues-should-be-posted.">Now
@@ -304,7 +304,8 @@ the dns_sd library. OpenSSL is already installed as a System
Library.</p></li>
</ul>
<h2 id="running-uxplay">Running UxPlay</h2>
<h3 id="debian-based-systems-1">Debian-based systems</h3>
<h3 id="installing-plugins-debian-based-linux-systems">Installing
plugins (Debian-based Linux systems)</h3>
<p>Next install the GStreamer plugins that are needed with
<code>sudo apt-get install gstreamer1.0-&lt;plugin&gt;</code>. Values of
<code>&lt;plugin&gt;</code> required are:</p>
@@ -326,44 +327,8 @@ examining the GStreamer installation. If sound is not working,
<strong>alsa</strong>”“,”<strong>pulseaudio</strong>”, or
<strong>pipewire</strong>” plugins may need to be installed, depending
on how your audio is set up.</p>
<p><strong>Finally, run uxplay in a terminal window</strong>. On some
systems, you can toggle into and out of fullscreen mode with F11 or
(held-down left Alt)+Enter keys. Use Ctrl-C (or close the window) to
terminate it when done. If the UxPlay server is not seen by the iOS
clients drop-down “Screen Mirroring” panel, check that your DNS-SD
server (usually avahi-daemon) is running: do this in a terminal window
with <code>systemctl status avahi-daemon</code>. If this shows the
avahi-daemon is not running, control it with
<code>sudo systemctl [start,stop,enable,disable] avahi-daemon</code> (or
avahi-daemon.service). If UxPlay is seen, but the client fails to
connect when it is selected, there may be a firewall on the server that
prevents UxPlay from receiving client connection requests unless some
network ports are opened: if a firewall is active, also open UDP port
5353 (for mDNS queries) needed by Avahi. See <a
href="#troubleshooting">Troubleshooting</a> below for help with this or
other problems.</p>
<ul>
<li>By default, UxPlay is locked to its current client until that client
drops the connection; the option <code>-nohold</code> modifies this
behavior so that when a new client requests a connection, it removes the
current client and takes over.</li>
</ul>
<p>To display the accompanying “Cover Art” from sources like Apple Music
in Audio-Only (ALAC) mode, run
<code>uxplay -ca &lt;name&gt; &amp;</code>” in the background, then 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>
<p><strong>One common problem involves GStreamer attempting to use
incorrectly-configured or absent accelerated hardware h264 video
decoding (e.g., VAAPI). Try “<code>uxplay -avdec</code>” to force
software video decoding; if this works you can then try to fix
accelerated hardware video decoding if you need it, or just uninstall
the GStreamer VAAPI plugin. If your system uses the Wayland compositor
for graphics, use “<code>uxplay -vs waylandsink</code>”.</strong> See <a
href="#usage">Usage</a> for more run-time options.</p>
<h3 id="running-uxplay-non-debian-based-linux-or-bsd">Running uxplay
Non-Debian-based Linux or *BSD</h3>
<h3 id="installing-plugins-non-debian-based-linux-or-bsd">Installing
plugins (Non-Debian-based Linux or *BSD)</h3>
<ul>
<li><p><strong>Red Hat, or clones like CentOS (now continued as Rocky
Linux or Alma Linux):</strong> (sudo dnf install, or sudo yum install)
@@ -396,6 +361,55 @@ gstreamer1-plugins, gstreamer1-plugins-* (* = core, good, bad, x, gtk,
gl, vulkan, pulse, v4l2, …), (+ gstreamer1-vaapi for Intel
graphics).</p></li>
</ul>
<h3 id="starting-uxplay">Starting UxPlay</h3>
<p><strong>Finally, run uxplay in a terminal window</strong>. On some
systems, you can toggle into and out of fullscreen mode with F11 or
(held-down left Alt)+Enter keys. Use Ctrl-C (or close the window) to
terminate it when done. If the UxPlay server is not seen by the iOS
clients drop-down “Screen Mirroring” panel, check that your DNS-SD
server (usually avahi-daemon) is running: do this in a terminal window
with <code>systemctl status avahi-daemon</code>. If this shows the
avahi-daemon is not running, control it with
<code>sudo systemctl [start,stop,enable,disable] avahi-daemon</code> (or
avahi-daemon.service). If UxPlay is seen, but the client fails to
connect when it is selected, there may be a firewall on the server that
prevents UxPlay from receiving client connection requests unless some
network ports are opened: if a firewall is active, also open UDP port
5353 (for mDNS queries) needed by Avahi. See <a
href="#troubleshooting">Troubleshooting</a> below for help with this or
other problems.</p>
<ul>
<li><p>By default, UxPlay is locked to its current client until that
client drops the connection; the option <code>-nohold</code> modifies
this behavior so that when a new client requests a connection, it
removes the current client and takes over.</p></li>
<li><p>To display the accompanying “Cover Art” from sources like Apple
Music in Audio-Only (ALAC) mode, run
<code>uxplay -ca &lt;name&gt; &amp;</code>” in the background, then 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>If you wish to listen in Audio-Only mode on the server while
watching the client screen (for video or Apple Music song lyrics, etc.),
the video on the client is delayed by about 5 seconds behind the the
audio on the server. This can be corrected with the <strong>audio
offset</strong> option <code>-ao x</code> with an <em>x</em> of about
5.0 (allowed values of <em>x</em> are decimal numbers between 0 and 10.0
seconds); this workaround just delays playing of audio on the server by
<em>x</em> seconds, so the effect of pausing or changing tracks on the
client will unfortunately also be delayed. <em>(The reason for the 5
sec. video delay on the client may be because, while streaming in Legacy
mode, the client does not get latency information from the
server.)</em></p></li>
</ul>
<p><strong>One common problem involves GStreamer attempting to use
incorrectly-configured or absent accelerated hardware h264 video
decoding (e.g., VAAPI). Try “<code>uxplay -avdec</code>” to force
software video decoding; if this works you can then try to fix
accelerated hardware video decoding if you need it, or just uninstall
the GStreamer VAAPI plugin. If your system uses the Wayland compositor
for graphics, use “<code>uxplay -vs waylandsink</code>”.</strong> See <a
href="#usage">Usage</a> for more run-time options.</p>
<h3
id="special-instructions-for-raspberry-pi-only-tested-on-model-4b"><strong>Special
instructions for Raspberry Pi (only tested on model 4B)</strong>:</h3>
@@ -491,7 +505,7 @@ it, but compiled to use X11).</li>
</ul>
<p><strong>For the “official” release</strong>: install both the macOS
runtime and development installer packages. Assuming that the latest
release is 1.20.4. install
release is 1.20.5. install
<code>gstreamer-1.0-1.20.5-universal.pkg</code> and
<code>gstreamer-1.0-devel-1.20.5-universal.pkg</code>. (If you have an
Intel-architecture Mac, and have problems with the “universal” packages,
@@ -753,6 +767,15 @@ 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> adds an audio offset time in (decimal)
seconds to Audio-only (ALAC) streams to allow synchronization of sound
playing on the UxPlay server with video on the client. In the AirPlay
Legacy mode used by UxPlay, the client cannot obtain audio latency
information from the server, and appears to assume a latency of about 5
seconds. This can be corrected with offset values such as
<code>-ao 5</code> or <code>-ao 4.9</code>. The -ao option accepts
values of the offset between 0 and 10 seconds, as a decimal number which
it converts to a whole number of milliseconds.</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
@@ -1055,6 +1078,10 @@ as “SupportsLegacyPairing”) of the “features” plist code (reported to
the client by the AirPlay server) to be set. The “features” code and
other settings are set in <code>UxPlay/lib/dnssdint.h</code>.</p>
<h1 id="changelog">Changelog</h1>
<p>1.62 2023-01-14 Added Audio-only mode time offset -ao x to allow user
synchronization of ALAC audio playing on the server with video, song
lyrics, etc. playing on the client. x = 5.0 appears to be optimal in
many cases.</p>
<p>1.61 2022-12-30 Removed -t option (workaround for an Avahi issue,
correctly solved by opening network port UDP 5353 in firewall). Remove
-g debug flag from CMAKE_CFLAGS. Postpend (instead of prepend) build

View File

@@ -1,4 +1,4 @@
# UxPlay 1.61: AirPlay-Mirror and AirPlay-Audio server for Linux, macOS, and Unix (now also runs on Windows).
# UxPlay 1.62: AirPlay-Mirror and AirPlay-Audio server for Linux, macOS, and Unix (now also runs on Windows).
### Now developed at the GitHub site [https://github.com/FDH2/UxPlay](https://github.com/FDH2/UxPlay) (where all user issues should be posted).
@@ -255,7 +255,7 @@ OpenSSL is already installed as a System Library.
## Running UxPlay
### Debian-based systems
### Installing plugins (Debian-based Linux systems)
Next install the GStreamer plugins that are needed with `sudo apt-get install gstreamer1.0-<plugin>`.
Values of `<plugin>` required are:
@@ -274,41 +274,8 @@ Also install "**tools**" to get the utility gst-inspect-1.0 for
examining the GStreamer installation. If sound is not working, "**alsa**"", "**pulseaudio**",
or "**pipewire**" plugins may need to be installed, depending on how your audio is set up.
**Finally, run uxplay in a terminal window**. On some systems, you can toggle into and out of fullscreen mode
with F11 or (held-down left Alt)+Enter keys. Use Ctrl-C (or close the window)
to terminate it when done. If the UxPlay server is not seen by the
iOS client's drop-down "Screen Mirroring" panel, check that your DNS-SD
server (usually avahi-daemon) is running: do this in a terminal window
with ```systemctl status avahi-daemon```.
If this shows the avahi-daemon is not running, control it
with ```sudo systemctl [start,stop,enable,disable] avahi-daemon``` (or
avahi-daemon.service). If UxPlay is seen, but the client fails to connect
when it is selected, there may be a firewall on the server that prevents
UxPlay from receiving client connection requests unless some network ports
are opened: if a firewall is active, also open UDP port 5353 (for mDNS queries)
needed by Avahi. See [Troubleshooting](#troubleshooting) below for
help with this or other problems.
* By default, UxPlay is locked to
its current client until that client drops the connection; the option `-nohold` modifies this
behavior so that when a new client requests a connection, it removes the current client and takes over.
To display the accompanying "Cover Art" from sources like Apple Music in Audio-Only (ALAC) mode,
run "`uxplay -ca <name> &`" in the background, then run a image viewer with an autoreload feature: an example
is "feh": run "``feh -R 1 <name>``"
in the foreground; terminate feh and then Uxplay with "`ctrl-C fg ctrl-C`".
**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 decoding; if this works you can
then try to fix accelerated hardware video decoding if you need it, or just uninstall the GStreamer VAAPI plugin. If
your system uses the Wayland compositor for graphics, use "`uxplay -vs waylandsink`".**
See [Usage](#usage) for more run-time options.
### Running uxplay Non-Debian-based Linux or \*BSD
### Installing plugins (Non-Debian-based Linux or \*BSD)
* **Red Hat, or clones like CentOS (now continued as Rocky Linux or Alma Linux):**
(sudo dnf install, or sudo yum install) The required GStreamer packages are:
@@ -338,6 +305,48 @@ for Intel graphics).
(\* = core, good, bad, x, gtk, gl, vulkan, pulse, v4l2, ...), (+ gstreamer1-vaapi for Intel graphics).
### Starting UxPlay
**Finally, run uxplay in a terminal window**. On some systems, you can toggle into and out of fullscreen mode
with F11 or (held-down left Alt)+Enter keys. Use Ctrl-C (or close the window)
to terminate it when done. If the UxPlay server is not seen by the
iOS client's drop-down "Screen Mirroring" panel, check that your DNS-SD
server (usually avahi-daemon) is running: do this in a terminal window
with ```systemctl status avahi-daemon```.
If this shows the avahi-daemon is not running, control it
with ```sudo systemctl [start,stop,enable,disable] avahi-daemon``` (or
avahi-daemon.service). If UxPlay is seen, but the client fails to connect
when it is selected, there may be a firewall on the server that prevents
UxPlay from receiving client connection requests unless some network ports
are opened: if a firewall is active, also open UDP port 5353 (for mDNS queries)
needed by Avahi. See [Troubleshooting](#troubleshooting) below for
help with this or other problems.
* By default, UxPlay is locked to
its current client until that client drops the connection; the option `-nohold` modifies this
behavior so that when a new client requests a connection, it removes the current client and takes over.
* To display the accompanying "Cover Art" from sources like Apple Music in Audio-Only (ALAC) mode,
run "`uxplay -ca <name> &`" in the background, then run a image viewer with an autoreload feature: an example
is "feh": run "``feh -R 1 <name>``"
in the foreground; terminate feh and then Uxplay with "`ctrl-C fg ctrl-C`".
* If you wish to listen in Audio-Only mode on the server while watching the client screen (for video or Apple Music song lyrics, etc.),
the video on the client is delayed by about 5 seconds behind the the audio on the server. This can be corrected with
the **audio offset** option `-ao x` with an _x_ of about 5.0
(allowed values of _x_ are decimal numbers between 0 and 10.0 seconds); this workaround just delays playing of audio on the server by _x_ seconds, so the effect
of pausing or changing tracks on the client will unfortunately also be delayed. _(The reason for the 5 sec. video delay on the client
may be because, while streaming in Legacy mode, the client does not get latency information from the
server.)_
**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 decoding; if this works you can
then try to fix accelerated hardware video decoding if you need it, or just uninstall the GStreamer VAAPI plugin. If
your system uses the Wayland compositor for graphics, use "`uxplay -vs waylandsink`".**
See [Usage](#usage) for more run-time options.
### **Special instructions for Raspberry Pi (only tested on model 4B)**:
@@ -411,7 +420,7 @@ Next get the latest macOS release of GStreamer-1.0.
from [https://gstreamer.freedesktop.org/download/](https://gstreamer.freedesktop.org/download/). The alternative is to install it from Homebrew
(MacPorts also supplies it, but compiled to use X11).
**For the "official" release**: install both the macOS runtime and development installer packages. Assuming that the latest release is 1.20.4.
**For the "official" release**: install both the macOS runtime and development installer packages. Assuming that the latest release is 1.20.5.
install `gstreamer-1.0-1.20.5-universal.pkg` and ``gstreamer-1.0-devel-1.20.5-universal.pkg``. (If
you have an Intel-architecture Mac, and have problems with the "universal" packages, you can also
use `gstreamer-1.0-1.18.6-x86_64.pkg` and ``gstreamer-1.0-devel-1.18.6-x86_64.pkg``.) Click on them to
@@ -646,6 +655,12 @@ 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** adds an audio offset time in (decimal) seconds to Audio-only (ALAC) streams to allow synchronization of sound
playing on the UxPlay server with video on the client. In the AirPlay Legacy mode used by UxPlay, the client cannot
obtain audio latency information from the server, and appears to assume a latency of about 5 seconds. This can be corrected
with offset values such as `-ao 5` or ``-ao 4.9``. The -ao option accepts values of the offset between 0 and 10 seconds, as
a decimal number which it converts to a whole number of milliseconds.
**-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
it arrives. Cover art (jpeg format) is discarded if this option is not used. Use with a image viewer that reloads the image
@@ -894,6 +909,10 @@ tvOS 12.2.1); it seems that the use of "legacy" protocol just requires bit 27 (l
The "features" code and other settings are set in `UxPlay/lib/dnssdint.h`.
# Changelog
1.62 2023-01-14 Added Audio-only mode time offset -ao x to allow user synchronization of ALAC
audio playing on the server with video, song lyrics, etc. playing on the client.
x = 5.0 appears to be optimal in many cases.
1.61 2022-12-30 Removed -t option (workaround for an Avahi issue, correctly solved by opening network
port UDP 5353 in firewall). Remove -g debug flag from CMAKE_CFLAGS. Postpend (instead
of prepend) build environment CFLAGS to CMAKE_CFLAGS. Refactor parts of uxplay.cpp

View File

@@ -1,4 +1,4 @@
# UxPlay 1.61: AirPlay-Mirror and AirPlay-Audio server for Linux, macOS, and Unix (now also runs on Windows).
# UxPlay 1.62: AirPlay-Mirror and AirPlay-Audio server for Linux, macOS, and Unix (now also runs on Windows).
### Now developed at the GitHub site <https://github.com/FDH2/UxPlay> (where all user issues should be posted).
@@ -308,7 +308,7 @@ installed)
## Running UxPlay
### Debian-based systems
### Installing plugins (Debian-based Linux systems)
Next install the GStreamer plugins that are needed with
`sudo apt-get install gstreamer1.0-<plugin>`. Values of `<plugin>`
@@ -329,44 +329,7 @@ gst-inspect-1.0 for examining the GStreamer installation. If sound is
not working, "**alsa**"","**pulseaudio**", or "**pipewire**" plugins may
need to be installed, depending on how your audio is set up.
**Finally, run uxplay in a terminal window**. On some systems, you can
toggle into and out of fullscreen mode with F11 or (held-down left
Alt)+Enter keys. Use Ctrl-C (or close the window) to terminate it when
done. If the UxPlay server is not seen by the iOS client's drop-down
"Screen Mirroring" panel, check that your DNS-SD server (usually
avahi-daemon) is running: do this in a terminal window with
`systemctl status avahi-daemon`. If this shows the avahi-daemon is not
running, control it with
`sudo systemctl [start,stop,enable,disable] avahi-daemon` (or
avahi-daemon.service). If UxPlay is seen, but the client fails to
connect when it is selected, there may be a firewall on the server that
prevents UxPlay from receiving client connection requests unless some
network ports are opened: if a firewall is active, also open UDP port
5353 (for mDNS queries) needed by Avahi. See
[Troubleshooting](#troubleshooting) below for help with this or other
problems.
- By default, UxPlay is locked to its current client until that client
drops the connection; the option `-nohold` modifies this behavior so
that when a new client requests a connection, it removes the current
client and takes over.
To display the accompanying "Cover Art" from sources like Apple Music in
Audio-Only (ALAC) mode, run "`uxplay -ca <name> &`" in the background,
then run a image viewer with an autoreload feature: an example is "feh":
run "`feh -R 1 <name>`" in the foreground; terminate feh and then Uxplay
with "`ctrl-C fg ctrl-C`".
**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
decoding; if this works you can then try to fix accelerated hardware
video decoding if you need it, or just uninstall the GStreamer VAAPI
plugin. If your system uses the Wayland compositor for graphics, use
"`uxplay -vs waylandsink`".** See [Usage](#usage) for more run-time
options.
### Running uxplay Non-Debian-based Linux or \*BSD
### Installing plugins (Non-Debian-based Linux or \*BSD)
- **Red Hat, or clones like CentOS (now continued as Rocky Linux or
Alma Linux):** (sudo dnf install, or sudo yum install) The required
@@ -400,6 +363,57 @@ options.
gtk, gl, vulkan, pulse, v4l2, ...), (+ gstreamer1-vaapi for Intel
graphics).
### Starting UxPlay
**Finally, run uxplay in a terminal window**. On some systems, you can
toggle into and out of fullscreen mode with F11 or (held-down left
Alt)+Enter keys. Use Ctrl-C (or close the window) to terminate it when
done. If the UxPlay server is not seen by the iOS client's drop-down
"Screen Mirroring" panel, check that your DNS-SD server (usually
avahi-daemon) is running: do this in a terminal window with
`systemctl status avahi-daemon`. If this shows the avahi-daemon is not
running, control it with
`sudo systemctl [start,stop,enable,disable] avahi-daemon` (or
avahi-daemon.service). If UxPlay is seen, but the client fails to
connect when it is selected, there may be a firewall on the server that
prevents UxPlay from receiving client connection requests unless some
network ports are opened: if a firewall is active, also open UDP port
5353 (for mDNS queries) needed by Avahi. See
[Troubleshooting](#troubleshooting) below for help with this or other
problems.
- By default, UxPlay is locked to its current client until that client
drops the connection; the option `-nohold` modifies this behavior so
that when a new client requests a connection, it removes the current
client and takes over.
- To display the accompanying "Cover Art" from sources like Apple
Music in Audio-Only (ALAC) mode, run "`uxplay -ca <name> &`" in the
background, then run a image viewer with an autoreload feature: an
example is "feh": run "`feh -R 1 <name>`" in the foreground;
terminate feh and then Uxplay with "`ctrl-C fg ctrl-C`".
- If you wish to listen in Audio-Only mode on the server while
watching the client screen (for video or Apple Music song lyrics,
etc.), the video on the client is delayed by about 5 seconds behind
the the audio on the server. This can be corrected with the **audio
offset** option `-ao x` with an *x* of about 5.0 (allowed values of
*x* are decimal numbers between 0 and 10.0 seconds); this workaround
just delays playing of audio on the server by *x* seconds, so the
effect of pausing or changing tracks on the client will
unfortunately also be delayed. *(The reason for the 5 sec. video
delay on the client may be because, while streaming in Legacy mode,
the client does not get latency information from the server.)*
**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
decoding; if this works you can then try to fix accelerated hardware
video decoding if you need it, or just uninstall the GStreamer VAAPI
plugin. If your system uses the Wayland compositor for graphics, use
"`uxplay -vs waylandsink`".** See [Usage](#usage) for more run-time
options.
### **Special instructions for Raspberry Pi (only tested on model 4B)**:
- For good performance, the Raspberry Pi needs the GStreamer
@@ -495,7 +509,7 @@ Next get the latest macOS release of GStreamer-1.0.
**For the "official" release**: install both the macOS runtime and
development installer packages. Assuming that the latest release is
1.20.4. install `gstreamer-1.0-1.20.5-universal.pkg` and
1.20.5. install `gstreamer-1.0-1.20.5-universal.pkg` and
`gstreamer-1.0-devel-1.20.5-universal.pkg`. (If you have an
Intel-architecture Mac, and have problems with the "universal" packages,
you can also use `gstreamer-1.0-1.18.6-x86_64.pkg` and
@@ -776,6 +790,15 @@ 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** adds an audio offset time in (decimal) seconds to Audio-only
(ALAC) streams to allow synchronization of sound playing on the UxPlay
server with video on the client. In the AirPlay Legacy mode used by
UxPlay, the client cannot obtain audio latency information from the
server, and appears to assume a latency of about 5 seconds. This can be
corrected with offset values such as `-ao 5` or `-ao 4.9`. The -ao
option accepts values of the offset between 0 and 10 seconds, as a
decimal number which it converts to a whole number of milliseconds.
**-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
@@ -1095,6 +1118,11 @@ other settings are set in `UxPlay/lib/dnssdint.h`.
# Changelog
1.62 2023-01-14 Added Audio-only mode time offset -ao x to allow user
synchronization of ALAC audio playing on the server with video, song
lyrics, etc. playing on the client. x = 5.0 appears to be optimal in
many cases.
1.61 2022-12-30 Removed -t option (workaround for an Avahi issue,
correctly solved by opening network port UDP 5353 in firewall). Remove
-g debug flag from CMAKE_CFLAGS. Postpend (instead of prepend) build

View File

@@ -1,11 +1,11 @@
.TH UXPLAY "1" "December 2022" "1.61" "User Commands"
.TH UXPLAY "1" "January 2023" "1.62" "User Commands"
.SH NAME
uxplay \- start AirPlay server
.SH SYNOPSIS
.B uxplay
[\fI\,-n name\/\fR] [\fI\,-s wxh\/\fR] [\fI\,-p \/\fR[\fI\,n\/\fR]] [more \fI OPTIONS \/\fR ...]
.SH DESCRIPTION
UxPlay 1.61: An open\-source AirPlay mirroring (+ audio streaming) server.
UxPlay 1.62: An open\-source AirPlay mirroring (+ audio streaming) server.
.SH OPTIONS
.TP
.B
@@ -73,6 +73,8 @@ UxPlay 1.61: 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 offset time in seconds (default 0.0) in Audio-only mode.
.TP
\fB\-ca\fI fn \fR In Airplay Audio (ALAC) mode, write cover-art to file fn.
.TP
\fB\-reset\fR n Reset after 3n seconds client silence (default 5, 0=never).

View File

@@ -51,7 +51,7 @@
#include "renderers/video_renderer.h"
#include "renderers/audio_renderer.h"
#define VERSION "1.61"
#define VERSION "1.62"
#define DEFAULT_NAME "UxPlay"
#define DEFAULT_DEBUG_LOG false
@@ -387,6 +387,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 offset time in seconds (default 0.0) in Audio-only mode.\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");
@@ -736,20 +737,26 @@ static void parse_arguments (int argc, char *argv[]) {
bt709_fix = true;
} else if (arg == "-nohold") {
max_connections = 3;
} else if (arg == "-ad") {
} else if (arg == "-ao") {
int n;
char *end;
if (i < argc - 1 && *argv[i+1] != '-') {
unsigned int n = 0;
if (get_value (argv[++i], &n)) {
n = (int) (1000 * strtof(argv[++i], &end));
if (*end == '\0' && n >=0 && n <= 10000) {
audiodelay.erase();
if (n > 0) {
audiodelay = argv[i];
char* delay = new char[6];
snprintf(delay, 6, "%d", n);
audiodelay = delay;
delete[] delay;
}
continue;
}
} else {
LOGE("option -ad must be followed by a positive time delay in millisecs");
exit(1);
}
} else {
LOGE("invalid argument -ao %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 milliseconds)", argv[i]);
exit(1);
} else {
LOGE("unknown option %s, stopping\n",argv[i]);
exit(1);
}
@@ -1278,7 +1285,7 @@ int main (int argc, char *argv[]) {
if (use_audio) {
if (audiodelay.c_str()[0]) {
LOGI("Audio-only ALAC streams will be delayed by %s millisecs", audiodelay.c_str());
LOGI("Audio-only ALAC streams will be delayed by %s milliseconds", audiodelay.c_str());
}
audio_renderer_init(render_logger, audiosink.c_str(), audiodelay.c_str());
} else {