updates for R Pi support

This commit is contained in:
fduncanh
2022-03-08 04:22:37 -05:00
parent 12b8d1b2a1
commit c8a9f72419
5 changed files with 52 additions and 34 deletions

View File

@@ -19,8 +19,8 @@
<p>For systems with Intel integrated graphics, hardware GPU decoding with the gstreamer VAAPI plugin is preferable. VAAPI is open-source, and in addition to Intel, can support some AMD GPUs (the open-source “Nouveau” drivers for NVIDIA graphics are also in principle supported when VAAPI is supplemented with firmware extracted from the proprietary NVIDIA drivers).</p>
<p>For NVIDIA graphics with the proprietary drivers, the nvdec plugin (recently renamed nvh264dec) can be used for accelerated video decoding on the NVIDIA GPU with CUDA. The nvdec plugin is part of gstreamer1.0-plugins-bad, but is generally not included in binary packages, as NVIDIAs proprietary <a href="https://docs.nvidia.com/video-technologies/video-codec-sdk/nvdec-video-decoder-api-prog-guide/">Video Codec SDK</a> must be downloaded, and three header files from it must be added to the gstreamer source before the plugin can be compiled. Users must do this themselves: see <a href="https://gist.github.com/corenel/a615b6f7eb5b5425aa49343a7b409200">these instructions</a>, and adapt them as necessary for your GStreamer installation. This plugin should be used with the <code>-vd nvdec</code> (or nvh264dec) and <code>-vs glimagesink</code> uxplay options.</p>
<ul>
<li><p><strong>Support for Raspberry Pi (not yet).</strong></p>
<p>The Raspberry Pi (e.g., model 4B) is powerful enough to run UxPlay, but only with hardware-accelerated h264 decoding by its Broadcom GPU (software decoding with uxplay option <code>-avdec</code> works, but with unacceptable latency). Raspberry Pi OS (Bullseye) has abandoned the omx (OpenMAX) GPU driver used by <a href="http://github.com/FD-/RPiPlay">RPiPlay</a>, and the corresponding GStreamer plugin omxh264dec has been deprecated and broken for some time. The replacement is the Video4Linux (v4l2) plugin v4l2h264dec from gstreamer1.0-plugins-good, which works well for playing mp4 files on the Pi. Unfortunately, features needed by UxPlay are currently broken in this plugin, see the open <a href="https://github.com/FDH2/UxPlay/issues/70">Issue</a>. The (undocumented) UxPlay option <code>-rpi</code> will use the Pis GPU for video decoding, but will only work when an updated v4l2h264dec plugin becomes available. There is now work on this in the GStreamer development cycle: hopefully this might get backported to GStreamer-1.18 or 1.20 for the Pi, otherwise it will appear in v1.22.</p></li>
<li><p><strong>GPU Support for Raspberry Pi</strong></p>
<p>Some Raspberry Pi models (e.g., model 4B) are powerful enough to run UxPlay, but work best with hardware-accelerated h264 decoding by its Broadcom GPU (software decoding with combined uxplay options <code>-rpi -avdec</code> may also work with acceptable latency on Pi model 4). Raspberry Pi OS (Bullseye) has recently abandoned the older omx (OpenMAX) GPU driver used by <a href="http://github.com/FD-/RPiPlay">RPiPlay</a>, and the corresponding GStreamer plugin omxh264dec has been deprecated and broken for some time. The replacement is the Video4Linux (v4l2) plugin v4l2h264dec from gstreamer1.0-plugins-good, which works well for playing mp4 files on the Pi. Unfortunately, features needed by UxPlay are broken in current releases of this plugin, but are fixed as of the v1.21 development branch. See the open <a href="https://github.com/FDH2/UxPlay/issues/70">Issue</a> for a patch against the current stable release 1.20.0. The UxPlay option <code>-rpi</code> by itself will use the Pis GPU for video decoding with the patched plugin.</p></li>
</ul>
<h3 id="note-to-packagers-openssl-3.0.0-solves-gpl-v3-license-issues.">Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues.</h3>
<p>Some Linux distributions such as Debian do not allow distribution of compiled GPL code linked to OpenSSL-1.1.1 because its “dual OpenSSL/SSLeay” license has some incompatibilities with GPL, unless all code authors have explicitly given an “exception” to allow such linking (the historical origins of UxPlay make this impossible to obtain). Other distributions treat OpenSSL as a “System Library” which the GPL allows linking to.</p>
@@ -43,7 +43,7 @@
</ol>
<p><em>If you intend to modify the code, use a separate “build” directory: replace</em><code>cmake [ ] .</code><em>by</em><code>mkdir build ; cd build ; cmake [ ] ..</code>”; <em>you can then clean the build directory with</em><code>rm -rf build/*</code><em>(run from within the UxPlay source directory) without affecting the source directories which contain your modifications</em>.</p>
<p>The above script installs the executable file “<code>uxplay</code>” to <code>/usr/local/bin</code>, (and installs a manpage to somewhere like <code>/usr/local/share/man/man1</code> and README files to somewhere like <code>/usr/local/share/doc/uxplay</code>). It can also be found in the build directory after the build processs.</p>
<p><strong>Finally, run uxplay in a terminal window</strong>. If it 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. See <a href="#troubleshooting">Troubleshooting</a> below for help with this or other problems. See <a href="#usage">Usage</a> for run-time options. For OpenGL support (option -vs glimagesink), needed for NVIDIA GPU-based video decoding, make sure gstreamer1.0-gl is installed.</p>
<p><strong>Finally, run uxplay in a terminal window</strong>. If it 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. See <a href="#troubleshooting">Troubleshooting</a> below for help with this or other problems. See <a href="#usage">Usage</a> for run-time options. For OpenGL support (option -vs glimagesink), needed for Raspberry Pi and NVIDIA GPU-based video decoding, make sure gstreamer1.0-gl is installed.</p>
<ul>
<li><p><strong>Red Hat, Fedora, CentOS (now continued as Rocky Linux or Alma Linux):</strong> (sudo yum install) openssl-devel libplist-devel avahi-compat-libdns_sd-devel (some from the “PowerTools” add-on repository) (+libX11-devel for ZOOMFIX). The required GStreamer packages (some from <a href="https://rpmfusion.org">rpmfusion.org</a>) are: gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-libav gstreamer1-plugins-bad-free (+ gstreamer1-vaapi for intel graphics).</p></li>
<li><p><strong>OpenSUSE:</strong> (sudo zypper install) libopenssl-devel libplist-devel avahi-compat-mDNSResponder-devel (+ libX11-devel for ZOOMFIX). The required GStreamer packages (you may need to use versions from <a href="https://ftp.gwdg.de/pub/linux/misc/packman/suse/">Packman</a>) are: gstreamer-devel gstreamer-plugins-base-devel gstreamer-plugins-libav gstreamer-plugins-bad (+ gstreamer-plugins-vaapi for Intel graphics).</p></li>
@@ -92,6 +92,7 @@
<p><strong>-vc <em>converter</em></strong> chooses the GStreamer pipelines videoconverter element, instead of the default value “videoconvert”. When using video4linux hardware decoding by a GPU,<code>-vc v4l2convert</code> will also use the GPU for video conversion. Using quotes “…” allows some parameters to be included with the converter name.</p>
<p><strong>-vs <em>videosink</em></strong> chooses the GStreamer videosink, instead of letting autovideosink pick it for you. Some videosink choices are: ximagesink, xvimagesink, vaapisink (for intel graphics), gtksink, glimagesink, waylandsink, osximagesink (for macOS), or fpsdisplaysink (which shows the streaming framerate in fps). Using quotes “…” allows some parameters to be included with the videosink name. For example, <strong>fullscreen</strong> mode is supported by the vaapisink plugin, and is obtained using <code>-vs "vaapisink fullscreen=true"</code>; this also works with <code>waylandsink</code>. The syntax of such options is specific to a given plugin, and some choices of videosink might not work on your system.</p>
<p><strong>-vs 0</strong> suppresses display of streamed video, but plays streamed audio. (The clients screen is still mirrored at a reduced rate of 1 frame per second, but is not rendered or displayed.) This feature (which streams audio in AAC audio format) is now probably unneeded, as UxPlay can now stream superior-quality Apple Lossless audio without video in Airplay non-mirror mode.</p>
<p><strong>-rpi</strong> Video settings for Raspberry Pi, for hardware h264 video decoding in the GPU (requires the video4linux2 plugin from GStreamer-1.21.0 or later, or a backported patched version of an earlier release. (If this is unavailable, use <code>uxplay -rpi -avdec</code>). Uses the glimagesink videosink.</p>
<p><strong>-avdec</strong> forces use of software h264 decoding using Gstreamer element avdec_h264 (libav h264 decoder). This option should prevent autovideosink choosing a hardware-accelerated videosink plugin such as vaapisink.</p>
<p><strong>-as <em>audiosink</em></strong> chooses the GStreamer audiosink, instead of letting autoaudiosink pick it for you. Some audiosink choices are: pulsesink, alsasink, osssink, oss4sink, and osxaudiosink (for macOS). Using quotes “…” might allow some 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>
@@ -125,7 +126,7 @@
<p>This triggers an unending stream of error messages, and means that the audio decryption key (also used in video decryption) was not correctly extracted from data sent by the client. This should not happen for iOS 9.3 or later clients. However, if a client uses the same older version of the protocol that is used by the Windows-based AirPlay client emulator <em>AirMyPC</em>, the protocol can be switched to the older version by the setting <code>OLD_PROTOCOL_CLIENT_USER_AGENT_LIST</code> in lib/global.h. UxPlay reports the clients “User Agent” string when it connects. If some other client also fails to decrypt all audio and video, try adding its “User Agent” string in place of “xxx” in the entry “AirMyPC/2.0;xxx” in global.h and rebuild uxplay.</p>
<p>Note that Uxplay declares itself to be an AppleTV3,2 with a sourceVersion 220.68; this can also be changed in global.h. It had been thought that it was necessary for UxPlay to claim to be an older 32 bit AppleTV model that cannot run modern 64bit tvOS, in order for the client to use a “legacy” protocol for pairing with the server (see the <em>“Notes on AirPlay protocol versions”</em> at the end of this README). However, UxPlay still works if it declares itself as an AppleTV6,2 with sourceVersion 380.20.1 (an AppleTV 4K 1st gen, introduced 2017, running tvOS 12.2.1), so it is unclear what setting prompts the client to use the “legacy” protocol needed by UxPlay.</p>
<h1 id="changelog">ChangeLog</h1>
<p>1.48 2022-02-24 Made the video pipeline fully configurable, for use with hardware h264 decoding.</p>
<p>1.48 2022-02-24 Made the video pipeline fully configurable, for use with hardware h264 decoding. Support for Raspberry Pi.</p>
<p>1.47 2022-02-05 Added -FPSdata option to display (in the terminal) regular reports sent by the client about video streaming performance. Internal cleanups of processing of video packets received from the client. Added -reset n option to reset the connection after n ntp timeouts (also reset after “connection reset by peer” error in video stream).</p>
<p>1.46 2022-01-20 Restore pre-1.44 behavior (1.44 may have broken hardware acceleration): once again use decodebin in the video pipeline; introduce new option “-avdec” to force software h264 decoding by libav h264, if needed (to prevent selection of vaapisink by autovideosink). Update llhttp to v6.0.6. UxPlay now reports itself as AppleTV3,2. Restrict connections to one client at a time (second client must now wait for first client to disconnect).</p>
<p>1.45 2022-01-10 New behavior: close video window when client requests “stop mirroring”. (A new “no close” option “-nc” is added for users who wish to retain previous behavior that does not close the video window).</p>

View File

@@ -76,17 +76,18 @@ Users must do this themselves: see [these instructions](https://gist.github.com/
adapt them as necessary for your GStreamer installation.
This plugin should be used with the `-vd nvdec` (or nvh264dec) and `-vs glimagesink` uxplay options.
* **Support for Raspberry Pi (not yet).**
* **GPU Support for Raspberry Pi**
The Raspberry Pi (e.g., model 4B) is powerful enough to run UxPlay, but only with hardware-accelerated h264 decoding by
its Broadcom GPU (software decoding with uxplay option `-avdec` works, but with unacceptable latency). Raspberry Pi OS (Bullseye)
has abandoned the omx (OpenMAX) GPU driver used by [RPiPlay](http://github.com/FD-/RPiPlay), and the corresponding
Some Raspberry Pi models (e.g., model 4B) are powerful enough to run UxPlay, but work best with hardware-accelerated h264 decoding by
its Broadcom GPU (software decoding with combined uxplay options `-rpi -avdec` may also work with acceptable
latency on Pi model 4). Raspberry Pi OS (Bullseye)
has recently abandoned the older omx (OpenMAX) GPU driver used by [RPiPlay](http://github.com/FD-/RPiPlay), and the corresponding
GStreamer plugin omxh264dec has been deprecated and broken for some time. The replacement is the Video4Linux (v4l2) plugin
v4l2h264dec from gstreamer1.0-plugins-good, which works well for playing mp4 files on the Pi. Unfortunately, features needed
by UxPlay are currently broken in this plugin, see the open [Issue](https://github.com/FDH2/UxPlay/issues/70). The (undocumented)
UxPlay option `-rpi` will use the Pi's GPU for video decoding, but will only work when an updated v4l2h264dec plugin becomes available.
There is now work on this in the GStreamer development cycle: hopefully this might get backported to GStreamer-1.18 or 1.20 for the Pi,
otherwise it will appear in v1.22.
by UxPlay are broken in current releases of this plugin, but are fixed as of the v1.21 development branch. See the
open [Issue](https://github.com/FDH2/UxPlay/issues/70) for a patch against the current stable release 1.20.0. The
UxPlay option `-rpi` by itself will use the Pi's GPU for video decoding with the patched plugin.
### Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues.
@@ -148,7 +149,7 @@ If this shows the avahi-daemon is not running, control it with ```sudo systemctl
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. See [Troubleshooting](#troubleshooting) below for
help with this or other problems. See [Usage](#usage) for run-time options. For OpenGL support (option -vs glimagesink), needed for
NVIDIA GPU-based video decoding, make sure gstreamer1.0-gl is installed.
Raspberry Pi and NVIDIA GPU-based video decoding, make sure gstreamer1.0-gl is installed.
* **Red Hat, Fedora, CentOS (now continued as Rocky Linux or Alma Linux):**
(sudo yum install) openssl-devel libplist-devel avahi-compat-libdns_sd-devel (some from the "PowerTools" add-on repository)
@@ -369,6 +370,10 @@ Also: image transforms that had been added to RPiPlay have been ported to UxPlay
feature (which streams audio in AAC audio format) is now probably unneeded, as UxPlay can now
stream superior-quality Apple Lossless audio without video in Airplay non-mirror mode.
**-rpi** Video settings for Raspberry Pi, for hardware h264 video decoding in the GPU (requires the
video4linux2 plugin from GStreamer-1.21.0 or later, or a backported patched version of an earlier release.
(If this is unavailable, use `uxplay -rpi -avdec`). Uses the glimagesink videosink.
**-avdec** forces use of software h264 decoding using Gstreamer element avdec_h264 (libav h264 decoder). This
option should prevent autovideosink choosing a hardware-accelerated videosink plugin such as vaapisink.
@@ -526,7 +531,7 @@ tvOS 12.2.1), so it is unclear what setting prompts the client
to use the "legacy" protocol needed by UxPlay.
# ChangeLog
1.48 2022-02-24 Made the video pipeline fully configurable, for use with hardware h264 decoding.
1.48 2022-02-24 Made the video pipeline fully configurable, for use with hardware h264 decoding. Support for Raspberry Pi.
1.47 2022-02-05 Added -FPSdata option to display (in the terminal) regular reports sent by the client about video streaming
performance. Internal cleanups of processing of video packets received from the client. Added -reset n option

View File

@@ -100,26 +100,25 @@ and adapt them as necessary for your GStreamer installation. This plugin
should be used with the `-vd nvdec` (or nvh264dec) and `-vs glimagesink`
uxplay options.
- **Support for Raspberry Pi (not yet).**
- **GPU Support for Raspberry Pi**
The Raspberry Pi (e.g., model 4B) is powerful enough to run UxPlay,
but only with hardware-accelerated h264 decoding by its Broadcom GPU
(software decoding with uxplay option `-avdec` works, but with
unacceptable latency). Raspberry Pi OS (Bullseye) has abandoned the
omx (OpenMAX) GPU driver used by
Some Raspberry Pi models (e.g., model 4B) are powerful enough to run
UxPlay, but work best with hardware-accelerated h264 decoding by its
Broadcom GPU (software decoding with combined uxplay options
`-rpi -avdec` may also work with acceptable latency on Pi model 4).
Raspberry Pi OS (Bullseye) has recently abandoned the older omx
(OpenMAX) GPU driver used by
[RPiPlay](http://github.com/FD-/RPiPlay), and the corresponding
GStreamer plugin omxh264dec has been deprecated and broken for some
time. The replacement is the Video4Linux (v4l2) plugin v4l2h264dec
from gstreamer1.0-plugins-good, which works well for playing mp4
files on the Pi. Unfortunately, features needed by UxPlay are
currently broken in this plugin, see the open
[Issue](https://github.com/FDH2/UxPlay/issues/70). The
(undocumented) UxPlay option `-rpi` will use the Pi's GPU for video
decoding, but will only work when an updated v4l2h264dec plugin
becomes available. There is now work on this in the GStreamer
development cycle: hopefully this might get backported to
GStreamer-1.18 or 1.20 for the Pi, otherwise it will appear in
v1.22.
files on the Pi. Unfortunately, features needed by UxPlay are broken
in current releases of this plugin, but are fixed as of the v1.21
development branch. See the open
[Issue](https://github.com/FDH2/UxPlay/issues/70) for a patch
against the current stable release 1.20.0. The UxPlay option `-rpi`
by itself will use the Pi's GPU for video decoding with the patched
plugin.
### Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues.
@@ -206,8 +205,9 @@ 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. See [Troubleshooting](#troubleshooting) below
for help with this or other problems. See [Usage](#usage) for run-time
options. For OpenGL support (option -vs glimagesink), needed for NVIDIA
GPU-based video decoding, make sure gstreamer1.0-gl is installed.
options. For OpenGL support (option -vs glimagesink), needed for
Raspberry Pi and NVIDIA GPU-based video decoding, make sure
gstreamer1.0-gl is installed.
- **Red Hat, Fedora, CentOS (now continued as Rocky Linux or Alma
Linux):** (sudo yum install) openssl-devel libplist-devel
@@ -479,6 +479,12 @@ streams audio in AAC audio format) is now probably unneeded, as UxPlay
can now stream superior-quality Apple Lossless audio without video in
Airplay non-mirror mode.
**-rpi** Video settings for Raspberry Pi, for hardware h264 video
decoding in the GPU (requires the video4linux2 plugin from
GStreamer-1.21.0 or later, or a backported patched version of an earlier
release. (If this is unavailable, use `uxplay -rpi -avdec`). Uses the
glimagesink videosink.
**-avdec** forces use of software h264 decoding using Gstreamer element
avdec\_h264 (libav h264 decoder). This option should prevent
autovideosink choosing a hardware-accelerated videosink plugin such as
@@ -693,7 +699,7 @@ ChangeLog
=========
1.48 2022-02-24 Made the video pipeline fully configurable, for use with
hardware h264 decoding.
hardware h264 decoding. Support for Raspberry Pi.
1.47 2022-02-05 Added -FPSdata option to display (in the terminal)
regular reports sent by the client about video streaming performance.

View File

@@ -58,6 +58,8 @@ UxPlay 1.48: An open\-source AirPlay mirroring server based on RPiPlay
.TP
\fB\-vs\fR 0 Streamed audio only, with no video display window.
.TP
\fB\-rpi\fR Video settings for Raspberry Pi (for GPU h264 decoding).
.TP
\fB\-avdec\fR Force software h264 video decoding with libav decoder.
.TP
\fB\-as\fI sink\fR Choose the GStreamer audiosink; default "autoaudiosink"

View File

@@ -237,8 +237,8 @@ static void print_info (char *name) {
printf("-vs ... Choose the GStreamer videosink; default \"autovideosink\"\n");
printf(" some choices: ximagesink,xvimagesink,vaapisink,glimagesink,\n");
printf(" gtksink,waylandsink,osximagesink,fpsdisplaysink, etc.\n");
// printf("-rpi Video settings for Raspberry Pi 4 (h264 decoding in GPU).\n");
printf("-vs 0 Streamed audio only, with no video display window\n");
printf("-rpi Video settings for Raspberry Pi (for GPU h264 decoding).\n");
printf("-avdec Force software h264 video decoding with libav decoder\n");
printf("-as ... Choose the GStreamer audiosink; default \"autoaudiosink\"\n");
printf(" choices: pulsesink,alsasink,osssink,oss4sink,osxaudiosink\n");
@@ -483,9 +483,13 @@ int main (int argc, char *argv[]) {
} else if (arg == "-nc") {
new_window_closing_behavior = false;
} else if (arg == "-avdec") {
video_parser.erase();
video_parser = "h264parse";
video_decoder.erase();
video_decoder = "avdec_h264";
} else if (arg == "-rpi") { /*undocumented option, may be removed */
video_converter.erase();
video_converter = "videoconvert";
} else if (arg == "-rpi") {
video_parser.erase();
video_parser = "h264parse ! capssetter caps=\"video/x-h264, colorimetry=bt709\"";
video_decoder.erase();