From 389238ee69e547a0b31f054be176ea0e028c94bc Mon Sep 17 00:00:00 2001 From: fduncanh Date: Tue, 9 Nov 2021 06:53:21 -0500 Subject: [PATCH] UxPlay 1.40 cleaned up ALAC support, show SETUP request plists in debug mode. --- README.html | 9 +++++---- README.md | 14 +++++++++----- README.txt | 29 ++++++++++++++++------------ lib/raop_handlers.h | 5 +++++ renderers/audio_renderer_gstreamer.c | 19 +++++++----------- renderers/video_renderer_gstreamer.c | 19 ++++++++++-------- uxplay.cpp | 2 +- 7 files changed, 55 insertions(+), 42 deletions(-) diff --git a/README.html b/README.html index c0bfe11..592ab31 100644 --- a/README.html +++ b/README.html @@ -1,15 +1,16 @@ -

UxPlay 1.39

+

UxPlay 1.40

This project is a GPLv3 unix AirPlay server which now also works on macOS. Its main use is to act like an AppleTV for screen-mirroring (with audio) of iOS/macOS clients (iPads, iPhones, MacBooks) in a window on the server display (with the possibility of sharing that window on screen-sharing applications such as Zoom) on a host running Linux, macOS, or other unix, using Apple’s AirPlay Mirror protocol first available in iOS 5. (Details of what is known about the AirPlay2 protocol can be found here and here).

The UxPlay server and its client must be on the same local area network, on which a Bonjour/Zeroconf mDNS/DNS-SD server is also running (only DNS-SD “Service Discovery” service is necessary, it is not necessary that the local network also be of the “.local” mDNS-based type). On Linux and BSD Unix servers, this is usually provided by Avahi, through the avahi-daemon service, and is included in most Linux distributions (this service can also be provided by macOS, iOS or Windows servers).

-

New: UxPlay 1.39 now also supports the Airplay audio-only protocol as well as AirPlay Mirror protocol, and can play Apple Lossless (ALAC) 44100/16/2 audio streamed from Apple Music on the client in 2-channel stereo without video (the accompanying cover-art and metadata is received by the server, but not displayed).

-

UxPlay 1.39 is based on https://github.com/FD-/RPiPlay, with GStreamer integration from https://github.com/antimof/UxPlay. (UxPlay only uses GStreamer, and does not contain the alternative Raspberry-Pi-specific audio and video renderers also found in RPiPlay.) Tested on Ubuntu 20.04, Linux Mint 20.2, OpenSUSE 15.3, macOS 10.15.

+

New: UxPlay 1.40 now also supports the Airplay audio-only protocol as well as AirPlay Mirror protocol, and (when the client screen is not being mirrored) can play Apple Lossless (ALAC) 44100/16/2 audio streamed from the client in 2-channel stereo without video (the accompanying cover-art and metadata is received by the server, but not displayed).

+

UxPlay 1.40 is based on https://github.com/FD-/RPiPlay, with GStreamer integration from https://github.com/antimof/UxPlay. (UxPlay only uses GStreamer, and does not contain the alternative Raspberry-Pi-specific audio and video renderers also found in RPiPlay.) Tested on Ubuntu 20.04, Linux Mint 20.2, OpenSUSE 15.3, macOS 10.15.

Features: 1. Based on Gstreamer. 2. Video and audio are supported out of the box. 3. Gstreamer decoding is plugin agnostic. Uses accelerated decoders if available. VAAPI is preferable, (but don’t use VAAPI with nVidia). 4. Automatic screen orientation.

Getting UxPlay:

Either download and unzip UxPlay-master.zip, or (if git is installed): “git clone https://github.com/FDH2/UxPlay”.

This is a pull request on the original site https://github.com/antimof/UxPlay ; it may or may not ever get committed into the codebase on the antimof site, as that project appears to no longer be active. If the pull request ever gets committed, replace “FDH2” by “antimof” in the above.

Building this version:

(Instructions for Ubuntu; adapt these for other Linuxes; for macOS, see below).

-

You need a C/C++ compiler (e.g. g++) with the standard development libraries installed. Make sure that cmake>=3.4.1 and pkg-config are also installed: “sudo apt-get install cmake pkg-config”. In a terminal window, change directories to the source directory of the downloaded source code (“UxPlay-master” for zipfile downloads, “UxPlay” for “git clone” downloads), then do

+

You need a C/C++ compiler (e.g. g++) with the standard development libraries installed. (For recent glibc (or libc6) 2.32 or later, an obsolete RPC header file netdb.h (needed by UxPlay) has been removed; install libtirpc-dev which now provides a compatible implementation, if the compiler reports that it is missing.)

+

Make sure that cmake>=3.4.1 and pkg-config are also installed: “sudo apt-get install cmake pkg-config”. In a terminal window, change directories to the source directory of the downloaded source code (“UxPlay-master” for zipfile downloads, “UxPlay” for “git clone” downloads), then do

  1. sudo apt-get install libssl-dev libplist-dev libavahi-compat-libdnssd-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav gstreamer1.0-plugins-bad
  2. sudo apt-get install gstreamer1.0-vaapi (For Intel graphics, but not nVidia graphics)
  3. diff --git a/README.md b/README.md index 5e531bb..b6fdd28 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# UxPlay 1.39 +# UxPlay 1.40 This project is a GPLv3 unix AirPlay server which now also works on macOS. Its main use is to act like an AppleTV for screen-mirroring (with audio) of iOS/macOS clients @@ -16,11 +16,12 @@ On Linux and BSD Unix servers, this is usually provided by [Avahi](https://www.a through the avahi-daemon service, and is included in most Linux distributions (this service can also be provided by macOS, iOS or Windows servers). -_New: UxPlay 1.39 now also supports the Airplay audio-only protocol as well as AirPlay Mirror protocol, and can play Apple Lossless (ALAC) -44100/16/2 audio streamed from Apple Music on the client in 2-channel stereo without video (the accompanying cover-art and metadata is received by the server, +_New: UxPlay 1.40 now also supports the Airplay audio-only protocol as well as AirPlay Mirror protocol, and (when the client screen is not being mirrored) +can play Apple Lossless (ALAC) +44100/16/2 audio streamed from the client in 2-channel stereo without video (the accompanying cover-art and metadata is received by the server, but not displayed)._ -UxPlay 1.39 is based on https://github.com/FD-/RPiPlay, with GStreamer integration from +UxPlay 1.40 is based on https://github.com/FD-/RPiPlay, with GStreamer integration from https://github.com/antimof/UxPlay. (UxPlay only uses GStreamer, and does not contain the alternative Raspberry-Pi-specific audio and video renderers also found in RPiPlay.) @@ -48,7 +49,10 @@ If the pull request ever gets committed, replace "FDH2" by "antimof" in the abov (Instructions for Ubuntu; adapt these for other Linuxes; for macOS, see below). -You need a C/C++ compiler (e.g. g++) with the standard development libraries installed. +You need a C/C++ compiler (e.g. g++) with the standard development libraries installed. (For recent glibc (or libc6) 2.32 or later, +an obsolete RPC header file netdb.h (needed by UxPlay) has been removed; install libtirpc-dev which now provides a compatible implementation, +if the compiler reports that it is missing.) + Make sure that cmake>=3.4.1 and pkg-config are also installed: "sudo apt-get install cmake pkg-config". In a terminal window, change directories to the source directory of the downloaded source code ("UxPlay-master" for zipfile downloads, "UxPlay" for "git clone" downloads), then do diff --git a/README.txt b/README.txt index bbefc2c..9bcd5a0 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -UxPlay 1.39 +UxPlay 1.40 =========== This project is a GPLv3 unix AirPlay server which now also works on @@ -21,13 +21,13 @@ Linux and BSD Unix servers, this is usually provided by included in most Linux distributions (this service can also be provided by macOS, iOS or Windows servers). -*New: UxPlay 1.39 now also supports the Airplay audio-only protocol as -well as AirPlay Mirror protocol, and can play Apple Lossless (ALAC) -44100/16/2 audio streamed from Apple Music on the client in 2-channel -stereo without video (the accompanying cover-art and metadata is -received by the server, but not displayed).* +*New: UxPlay 1.40 now also supports the Airplay audio-only protocol as +well as AirPlay Mirror protocol, and (when the client screen is not +being mirrored) can play Apple Lossless (ALAC) 44100/16/2 audio streamed +from the client in 2-channel stereo without video (the accompanying +cover-art and metadata is received by the server, but not displayed).* -UxPlay 1.39 is based on https://github.com/FD-/RPiPlay, with GStreamer +UxPlay 1.40 is based on https://github.com/FD-/RPiPlay, with GStreamer integration from https://github.com/antimof/UxPlay. (UxPlay only uses GStreamer, and does not contain the alternative Raspberry-Pi-specific audio and video renderers also found in RPiPlay.) Tested on Ubuntu @@ -58,11 +58,16 @@ Building this version: below). You need a C/C++ compiler (e.g. g++) with the standard development -libraries installed. Make sure that cmake\>=3.4.1 and pkg-config are -also installed: "sudo apt-get install cmake pkg-config". In a terminal -window, change directories to the source directory of the downloaded -source code ("UxPlay-master" for zipfile downloads, "UxPlay" for "git -clone" downloads), then do +libraries installed. (For recent glibc (or libc6) 2.32 or later, an +obsolete RPC header file netdb.h (needed by UxPlay) has been removed; +install libtirpc-dev which now provides a compatible implementation, if +the compiler reports that it is missing.) + +Make sure that cmake\>=3.4.1 and pkg-config are also installed: "sudo +apt-get install cmake pkg-config". In a terminal window, change +directories to the source directory of the downloaded source code +("UxPlay-master" for zipfile downloads, "UxPlay" for "git clone" +downloads), then do 1. `sudo apt-get install libssl-dev libplist-dev libavahi-compat-libdnssd-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav gstreamer1.0-plugins-bad` 2. `sudo apt-get install gstreamer1.0-vaapi` (For Intel graphics, but diff --git a/lib/raop_handlers.h b/lib/raop_handlers.h index 52671d5..5766c96 100755 --- a/lib/raop_handlers.h +++ b/lib/raop_handlers.h @@ -339,6 +339,11 @@ raop_handler_setup(raop_conn_t *conn, // Parsing bplist plist_t req_root_node = NULL; plist_from_bin(data, data_len, &req_root_node); + char * plist_xml; + uint32_t plist_len; + plist_to_xml(req_root_node, &plist_xml, &plist_len); + logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml); + free(plist_xml); plist_t req_streams_node = plist_dict_get_item(req_root_node, "streams"); plist_t req_eiv_node = plist_dict_get_item(req_root_node, "eiv"); plist_t req_ekey_node = plist_dict_get_item(req_root_node, "ekey"); diff --git a/renderers/audio_renderer_gstreamer.c b/renderers/audio_renderer_gstreamer.c index 80fd24e..f5f9ab6 100644 --- a/renderers/audio_renderer_gstreamer.c +++ b/renderers/audio_renderer_gstreamer.c @@ -166,17 +166,12 @@ void audio_renderer_flush(audio_renderer_t *renderer) { void audio_renderer_destroy(audio_renderer_t *renderer) { if(renderer) { - if(renderer->appsrc) { - gst_app_src_end_of_stream (GST_APP_SRC(renderer->appsrc)); - gst_object_unref (renderer->appsrc); - } - if (renderer->pipeline) { - gst_element_set_state (renderer->pipeline, GST_STATE_NULL); - gst_object_unref (renderer->pipeline); - } - if(renderer->volume) { - gst_object_unref (renderer->volume); - } - free(renderer); + gst_app_src_end_of_stream (GST_APP_SRC(renderer->appsrc)); + gst_element_set_state (renderer->pipeline, GST_STATE_NULL); + gst_object_unref (renderer->appsrc); + gst_object_unref (renderer->pipeline); + gst_object_unref (renderer->volume); + free (renderer); + renderer = NULL; } } diff --git a/renderers/video_renderer_gstreamer.c b/renderers/video_renderer_gstreamer.c index eb6cd06..3b06229 100644 --- a/renderers/video_renderer_gstreamer.c +++ b/renderers/video_renderer_gstreamer.c @@ -188,15 +188,18 @@ void video_renderer_flush(video_renderer_t *renderer) { } void video_renderer_destroy(video_renderer_t *renderer) { - gst_app_src_end_of_stream (GST_APP_SRC(renderer->appsrc)); - if(renderer->bus) gst_object_unref(renderer->bus); - gst_element_set_state (renderer->pipeline, GST_STATE_NULL); - if(renderer->pipeline) gst_object_unref (renderer->pipeline); -#ifdef X_DISPLAY_FIX - if(renderer->gst_window) free(renderer->gst_window); -#endif if (renderer) { - free(renderer); + gst_app_src_end_of_stream (GST_APP_SRC(renderer->appsrc)); + gst_element_set_state (renderer->pipeline, GST_STATE_NULL); + gst_object_unref (renderer->appsrc); + gst_object_unref (renderer->bus); + gst_object_unref (renderer->pipeline); + gst_object_unref (renderer->sink); +#ifdef X_DISPLAY_FIX + if(renderer->gst_window) free(renderer->gst_window); +#endif + free (renderer); + renderer = NULL; } } diff --git a/uxplay.cpp b/uxplay.cpp index db67b53..0046045 100755 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -35,7 +35,7 @@ #include "renderers/video_renderer.h" #include "renderers/audio_renderer.h" -#define VERSION "1.39" +#define VERSION "1.40" #define DEFAULT_NAME "UxPlay" #define DEFAULT_DEBUG_LOG false