From b3ebf31f69f0758665d70a42e848da1f3f4ccc9b Mon Sep 17 00:00:00 2001 From: fduncanh Date: Sun, 17 Apr 2022 04:12:12 -0400 Subject: [PATCH] make -rpi be the option for framebuffer on RPi --- README.html | 10 +++++----- README.md | 13 +++++++------ README.txt | 29 +++++++++++++++-------------- uxplay.1 | 8 ++++---- uxplay.cpp | 10 +++++----- 5 files changed, 36 insertions(+), 34 deletions(-) diff --git a/README.html b/README.html index 7701ac0..34063a5 100644 --- a/README.html +++ b/README.html @@ -21,7 +21,7 @@

For NVIDIA graphics with the proprietary drivers, the nvh264dec plugin (included in gstreamer1.0-plugins-bad since GStreamer-1.18.0) can be used for accelerated video decoding on the NVIDIA GPU after NVIDIA’s CUDA driver libcuda.so is installed. This plugin should be used with options uxplay -vd nvh264dec -vs glimagesink. For GStreamer-1.16.3 or earlier, the plugin is called nvdec, and must be built by the user: see these instructions. This older form of the plugin should be used with the -vd nvdec -vs glimagesink uxplay options.

Note to packagers: OpenSSL-3.0.0 solves GPL v3 license issues.

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.

@@ -96,9 +96,9 @@

-vc converter chooses the GStreamer pipeline’s videoconverter element, instead of the default value “videoconvert”. When using Video4Linux2 hardware-decoding by a GPU,-vc v4l2convert will also use the GPU for video conversion. Using quotes “…” allows some parameters to be included with the converter name.

-vs videosink 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), kmssink (for systems without X11, like Raspberry Pi OS lite) or fpsdisplaysink (which shows the streaming framerate in fps). Using quotes “…” allows some parameters to be included with the videosink name. For example, fullscreen mode is supported by the vaapisink plugin, and is obtained using -vs "vaapisink fullscreen=true"; this also works with waylandsink. The syntax of such options is specific to a given plugin, and some choices of videosink might not work on your system.

-vs 0 suppresses display of streamed video, but plays streamed audio. (The client’s 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.

-

-rpifb Video settings for Raspberry Pi, for hardware h264 video decoding in the GPU and rendering by the framebuffer, for systems not using X11 or Wayland (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 videosink “kmssink”.

-

-rpigl (or just -rpi) Similar to -rpifb, but uses the OpenGL videosink “glimagesink” (for Raspberry Pi systems with X11).

-

-rpiwl Similar to -rpifb, but for Raspberry Pi systems using the Wayland video compositor (uses the videosink “waylandsink”.

+

-rpi Video settings for Raspberry Pi, for hardware h264 video decoding in the GPU and rendering by the framebuffer, for “Lite” or minimal systems not using X11 or Wayland (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 videosink “kmssink”.

+

-rpigl Similar to -rpi, but uses the OpenGL videosink “glimagesink” (for Raspberry Pi “Desktop” systems with X11).

+

-rpiwl Similar to -rpi, but for Raspberry Pi “Desktop” systems using the Wayland video compositor (uses the videosink “waylandsink”.

-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.

-as audiosink 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.)

-as 0 (or just -a) suppresses playing of streamed audio, but displays streamed video.

@@ -138,7 +138,7 @@

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 AirMyPC, the protocol can be switched to the older version by the setting OLD_PROTOCOL_CLIENT_USER_AGENT_LIST in lib/global.h. UxPlay reports the client’s “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.

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 “Notes on AirPlay protocol versions” 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.

ChangeLog

-

1.50 2022-04-15 Added -fs fullscreen option (for Wayland or VAAPI plugins only), and -rpifb -rpigl -rpiwl options for RPi. Also modified timestamps from “DTS” to “PTS” for latency improvement, plus internal cleanups.

+

1.50 2022-04-15 Added -fs fullscreen option (for Wayland or VAAPI plugins only), Changed -rpi to be for framebuffer (“lite”) RPi systems and added -rpigl (OpenGL) and -rpiwl (Wayland) options for RPi Desktop systems. Also modified timestamps from “DTS” to “PTS” for latency improvement, plus internal cleanups.

1.49 2022-03-28 Addded options for dumping video and/or audio to file, for debugging, etc. h264 PPS/SPS NALU’s are shown with -d. Fixed video-not-working for M1 Mac clients.

1.48 2022-03-11 Made the GStreamer 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 to reset the connection after n ntp timeouts (also reset after “connection reset by peer” error in video stream).

diff --git a/README.md b/README.md index 78d2544..6c501f3 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ This older form of the plugin should be used with the `-vd nvdec -vs glimagesi the [UxPlay Wiki](https://github.com/FDH2/UxPlay/wiki). Patches for GStreamer-1.18.5 (used in Ubuntu 21.10 for RPi) and GStreamer-1.20.1 (used in Manjaro for RPi) are also available. On a non-"Desktop" system without X11 that uses - framebuffer video (such as RPi OS Bullseye "Lite") use option `uxplay -rpifb` with the patched GStreamer. + framebuffer video (such as RPi OS Bullseye "Lite") use option `uxplay -rpi` with the patched GStreamer. On "Desktop" operating systems, use the options `uxplay -rpigl` (for openGL video), or ``uxplay -rpiwl`` (for Wayland video). @@ -397,15 +397,15 @@ 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. -**-rpifb** Video settings for Raspberry Pi, for hardware h264 video decoding in the GPU and rendering by the - framebuffer, for systems not using X11 or Wayland (requires the +**-rpi** Video settings for Raspberry Pi, for hardware h264 video decoding in the GPU and rendering by the + framebuffer, for "Lite" or minimal systems not using X11 or Wayland (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 videosink "kmssink". -**-rpigl** (or just **-rpi**) Similar to -rpifb, but uses the OpenGL videosink "glimagesink" (for Raspberry Pi systems +**-rpigl** Similar to -rpi, but uses the OpenGL videosink "glimagesink" (for Raspberry Pi "Desktop" systems with X11). -**-rpiwl** Similar to -rpifb, but for Raspberry Pi systems using the Wayland video compositor (uses the +**-rpiwl** Similar to -rpi, but for Raspberry Pi "Desktop" systems using the Wayland video compositor (uses the videosink "waylandsink". @@ -591,7 +591,8 @@ tvOS 12.2.1), so it is unclear what setting prompts the client to use the "legacy" protocol needed by UxPlay. # ChangeLog -1.50 2022-04-15 Added -fs fullscreen option (for Wayland or VAAPI plugins only), and -rpifb -rpigl -rpiwl options for RPi. +1.50 2022-04-15 Added -fs fullscreen option (for Wayland or VAAPI plugins only), Changed -rpi to be for framebuffer ("lite") RPi + systems and added -rpigl (OpenGL) and -rpiwl (Wayland) options for RPi Desktop systems. Also modified timestamps from "DTS" to "PTS" for latency improvement, plus internal cleanups. 1.49 2022-03-28 Addded options for dumping video and/or audio to file, for debugging, etc. h264 PPS/SPS NALU's are shown with -d. diff --git a/README.txt b/README.txt index f99bd1d..b2c8c7e 100644 --- a/README.txt +++ b/README.txt @@ -122,7 +122,7 @@ This older form of the plugin should be used with the for GStreamer-1.18.5 (used in Ubuntu 21.10 for RPi) and GStreamer-1.20.1 (used in Manjaro for RPi) are also available. On a non-"Desktop" system without X11 that uses framebuffer video (such - as RPi OS Bullseye "Lite") use option `uxplay -rpifb` with the + as RPi OS Bullseye "Lite") use option `uxplay -rpi` with the patched GStreamer. On "Desktop" operating systems, use the options `uxplay -rpigl` (for openGL video), or `uxplay -rpiwl` (for Wayland video). @@ -510,18 +510,18 @@ 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. -**-rpifb** Video settings for Raspberry Pi, for hardware h264 video -decoding in the GPU and rendering by the framebuffer, for systems not -using X11 or Wayland (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 -videosink "kmssink". +**-rpi** Video settings for Raspberry Pi, for hardware h264 video +decoding in the GPU and rendering by the framebuffer, for "Lite" or +minimal systems not using X11 or Wayland (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 videosink "kmssink". -**-rpigl** (or just **-rpi**) Similar to -rpifb, but uses the OpenGL -videosink "glimagesink" (for Raspberry Pi systems with X11). +**-rpigl** Similar to -rpi, but uses the OpenGL videosink "glimagesink" +(for Raspberry Pi "Desktop" systems with X11). -**-rpiwl** Similar to -rpifb, but for Raspberry Pi systems using the -Wayland video compositor (uses the videosink "waylandsink". +**-rpiwl** Similar to -rpi, but for Raspberry Pi "Desktop" systems using +the Wayland video compositor (uses the videosink "waylandsink". **-avdec** forces use of software h264 decoding using Gstreamer element avdec\_h264 (libav h264 decoder). This option should prevent @@ -774,9 +774,10 @@ ChangeLog ========= 1.50 2022-04-15 Added -fs fullscreen option (for Wayland or VAAPI -plugins only), and -rpifb -rpigl -rpiwl options for RPi. Also modified -timestamps from "DTS" to "PTS" for latency improvement, plus internal -cleanups. +plugins only), Changed -rpi to be for framebuffer ("lite") RPi systems +and added -rpigl (OpenGL) and -rpiwl (Wayland) options for RPi Desktop +systems. Also modified timestamps from "DTS" to "PTS" for latency +improvement, plus internal cleanups. 1.49 2022-03-28 Addded options for dumping video and/or audio to file, for debugging, etc. h264 PPS/SPS NALU's are shown with -d. Fixed diff --git a/uxplay.1 b/uxplay.1 index fc87ea3..5f17540 100644 --- a/uxplay.1 +++ b/uxplay.1 @@ -5,7 +5,7 @@ uxplay \- start AirPlay server .B uxplay [\fI\,-n name\/\fR] [\fI\,-s wxh\/\fR] [\fI\,-p \/\fR[\fI\,n\/\fR]] [more \fI OPTIONS \/\fR ...] .SH DESCRIPTION -UxPlay 1.49: An open\-source AirPlay mirroring server based on RPiPlay +UxPlay 1.50: An open\-source AirPlay mirroring server based on RPiPlay .SH OPTIONS .TP .B @@ -60,11 +60,11 @@ UxPlay 1.49: An open\-source AirPlay mirroring server based on RPiPlay .TP \fB\-vs\fR 0 Streamed audio only, with no video display window. .TP -\fB\-rpigl\fR (or "-rpi") Raspberry Pi GPU h264 video with OpenGL. +\fB\-rpi\fR Raspberry Pi "Lite" GPU video with KMS framebuffer. .TP -\fB\-rpiwl\fR Raspberry Pi GPU h264 video with Wayland compositor. +\fB\-rpigl\fR Raspberry Pi GPU video with OpenGL. .TP -\fB\-rpifb\fR Raspberry Pi "Lite" video with KMS framebuffer (no X11). +\fB\-rpiwl\fR Raspberry Pi GPU video with Wayland compositor. .TP \fB\-avdec\fR Force software h264 video decoding with libav decoder. .TP diff --git a/uxplay.cpp b/uxplay.cpp index 094e3ba..d930eaf 100644 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -323,9 +323,9 @@ static void print_info (char *name) { printf(" some choices: ximagesink,xvimagesink,vaapisink,glimagesink,\n"); printf(" gtksink,waylandsink,osximagesink,kmssink,fpsdisplaysink etc.\n"); printf("-vs 0 Streamed audio only, with no video display window\n"); - printf("-rpigl (or \"-rpi\") Raspberry Pi GPU h264 video with OpenGL.\n"); - printf("-rpiwl Raspberry Pi GPU h264 video with Wayland compositor.\n"); - printf("-rpifb Raspberry Pi \"Lite\" video with KMS frame buffer (no X11).\n"); + printf("-rpi Raspberry Pi \"Lite\" GPU video with KMS frame buffer.\n"); + printf("-rpigl Raspberry Pi GPU video with OpenGL.\n"); + printf("-rpiwl Raspberry Pi GPU video with Wayland compositor.\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"); @@ -584,7 +584,7 @@ int main (int argc, char *argv[]) { video_decoder = "avdec_h264"; video_converter.erase(); video_converter = "videoconvert"; - } else if (arg == "-rpi" || arg == "-rpigl") { + } else if (arg == "-rpigl") { video_parser.erase(); video_parser = "h264parse ! capssetter caps=\"video/x-h264, colorimetry=bt709\""; video_decoder.erase(); @@ -602,7 +602,7 @@ int main (int argc, char *argv[]) { video_converter = "v4l2convert"; videosink.erase(); videosink = "waylandsink"; - } else if (arg == "-rpifb" ) { + } else if (arg == "-rpi" ) { video_parser.erase(); video_parser = "h264parse ! capssetter caps=\"video/x-h264, colorimetry=bt709\""; video_decoder.erase();