diff --git a/README.html b/README.html index 021ad66..eedfe95 100644 --- a/README.html +++ b/README.html @@ -458,17 +458,14 @@ landscape mode as the device is rotated).

id="building-uxplay-on-windows-tested-on-windows-10-64bit-using-msys2-and-mingw-64-compiler">Building UxPlay on Windows (tested on Windows 10 64bit, using MSYS2 and MinGW-64 compiler) -

Limitations: “sudo make install” does not work (due to -lack of “sudo” equivalent on this platform); GStreamer sound was so far -only confirmed to work with the DirectSound audiosink option -“-as directsoundsink”.

  1. Download and install Bonjour SDK for Windows v3.0 from the official Apple site https://developer.apple.com/download

  2. -
  3. (This is for the MSYS2 build enviroment; other build environments -may also work, but are not yet tested): download and install MSYS2 from -the official site https://www.msys2.org/

  4. +
  5. (This is for the unix-like MSYS2 build enviroment; other build +environments may also work, but are not yet tested): download and +install MSYS2 from the official site https://www.msys2.org/

  6. For building on Windows 64 bit, install the MinGW-64 compiler and cmake (MSYS2 packages are @@ -485,7 +482,7 @@ run

    pacman -S mingw-w64-x86_64-cmake

    pacman -S mingw-w64-x86_64-gcc

    echo 'export PATH="/mingw64/bin/:$PATH"' >> ~/.bashrc

    -

    Now close the MSYS2 terminal widow, and reopen a new one from the +

    Now close the MSYS2 terminal window, and reopen a new one from the Start menu, to use the new PATH.

  7. Download latest UxPlay from github (to use git, install it with pacman -S git, then @@ -493,32 +490,32 @@ Start menu, to use the new PATH.

  8. install UxPlay dependencies:

    pacman -S mingw-w64-x86_64-libplist mingw-w64-x86_64-openssl

    pacman -S mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base

    -

    It should also be possible to install gstreamer for Windows from the -offical GStreamer -site, especially if you are trying a different Windows build -system.

    +

    Note that libplist will be linked statically to the uxplay +executable. It should also be possible to install gstreamer for Windows +from the offical +GStreamer site, especially if you are trying a different Windows +build system.

  9. cd to the UxPlay source directory, then -“mkdir build” and “cd build”, then

    +“mkdir build” and “cd build”, followed by

    cmake ..

    ninja

  10. Assuming no error in either of these, you will have built the uxplay executable uxplay.exe in the current (“build”) -directory. Unfortunately “make install” does not yet work, -as an equivalent to sudo does not appear to be available. -You can run uxplay.exe from the command line in the -build directory, or move it it somewhere in your PATH: in the MSYS2 -environment, /usr/local/bin is in the PATH, so install -using

    -

    mkdir /usr/local/bin

    -

    cp uxplay.exe /usr/local/bin/

    -

    This does not install manpages, but you will have access to help with -“uxplay -h”.

  11. +directory. The “sudo make install” and “sudo make uninstall” features +offered in the other builds are not available on Windows; instead, the +MSYS2 environment has /usr/local/... available, and you can +install the uxplay.exe executable in /usr/local/bin (plus +manpage and documentation in /usr/local/share) with

    +

    cmake --install . --prefix /usr/local

    +

    To be able to view the manpage, you need to install the manpage +viewer with “pacman -S man”, then give it the location of +the uxplay manpage:

    +

    echo 'export "MANPATH=$MANPATH:/usr/local/share/man"' >> ~/.bashrc

    +

    (followed by “source ~/.bashrc”).

To run uxplay.exe you need to install gstreamer -plugins. For sound, the audiosink option --as directsoundsink has worked. Install plugins with -pacman -S mingw-w64-x86_64-gst-<plugin>, where -<plugin> is

+plugins with pacman -S mingw-w64-x86_64-gst-<plugin>, +where <plugin> is

  1. libav
  2. plugins-good
  3. @@ -527,20 +524,26 @@ plugins. For sound, the audiosink option

    Other possible MSYS2 gstreamer plugin packages you might use are listed in MSYS2 packages.

    -

    You also will need to grant the uxplay executable permission to have -access through the Windows firewall. You may automatically be offered -the choice to do this when you first run uxplay, or you may need to do -it using Windows Settings->Update and Security->Windows -Security->Firewall & network protection -> allow an app -through firewall. If your virus protection flags uxplay.exe as -“suspicious” (but without a true malware signature) you may need to give -it an exception.

    -

    Now test (in a MSYS2 terminal window) with

    -
    uxplay -as directsoundsink
    -

    Unfortunately, so far there is no success in getting UxPlay to -successfully create a valid GStreamer audio pipeline ending at the -more-modern wasapi Windows audiosink with option -“-as wasapisink”.

    +

    You also will need to grant permission to the uxplay executable +uxplay.exe to access data through the Windows firewall. You may +automatically be offered the choice to do this when you first run +uxplay, or you may need to do it using Windows +Settings->Update and Security->Windows Security->Firewall & +network protection -> allow an app through firewall. If your +virus protection flags uxplay.exe as “suspicious” (but without a true +malware signature) you may need to give it an exception.

    +

    Now test by running “uxplay” (in a MSYS2 terminal +window). If you need to specify the audiosink, there are two main +choices on Windows: the older DirectSound plugin +“-as directsoundsink”, and the more modern Windows Audio +Session API (wasapi) plugin “-as wasapisink”, which +supports options such as

    +
    uxplay -as 'wasapisink low_latency=true device=\"<guid>\"' 
    +

    where <guid> specifies an available audio device +by its GUID, which can be found using +“gst-device-monitor-1.0 Audio”: <guid> +has a form like +\{0.0.0.00000000\}.\{98e35b2b-8eba-412e-b840-fd2c2492cf44\}.

    Usage

    Options:

    -n server_name (Default: UxPlay); @@ -639,9 +642,10 @@ for Ubuntu 21.10 for Raspberry Pi 4B).

    -as audiosink chooses the GStreamer audiosink, instead of letting autoaudiosink pick it for you. Some audiosink choices are: pulsesink, alsasink, pipewiresink, osssink, -oss4sink, jackaudiosink, a2dpsink, 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.)

    +oss4sink, jackaudiosink, osxaudiosink (for macOS), wasapisink, +directsoundsink (for Windows). 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.

    -ca filename provides a file (where diff --git a/README.md b/README.md index 59ba516..12c2efd 100644 --- a/README.md +++ b/README.md @@ -383,14 +383,14 @@ as the device is rotated). ## Building UxPlay on Windows (tested on Windows 10 64bit, using MSYS2 and MinGW-64 compiler) -Limitations: "`sudo make install`" does not work (due to lack of "sudo" equivalent on this platform); -GStreamer sound was so far only confirmed to work with the DirectSound audiosink option "`-as directsoundsink`". 1. Download and install **Bonjour SDK for Windows v3.0** from the official Apple site [https://developer.apple.com/download](https://developer.apple.com/download/all/?q=Bonjour%20SDK%20for%20Windows) -2. (This is for the MSYS2 build enviroment; other build environments may also work, but are not yet tested): - download and install MSYS2 from the official site https://www.msys2.org/ +2. (This is for the unix-like MSYS2 build enviroment; other build environments may also work, but are not yet tested): + download and install MSYS2 from the official site [https://www.msys2.org/](https://www.msys2.org/) + + 3. For building on Windows 64 bit, install the **MinGW-64** compiler and cmake ([MSYS2 packages](https://packages.msys2.org/package/) are installed with a variant of the "pacman" package manager adapted from Arch Linux). After installation, you can add this @@ -406,7 +406,7 @@ GStreamer sound was so far only confirmed to work with the DirectSound audiosink `echo 'export PATH="/mingw64/bin/:$PATH"' >> ~/.bashrc` - Now close the MSYS2 terminal widow, and reopen a new one from the Start menu, to use the new PATH. + Now close the MSYS2 terminal window, and reopen a new one from the Start menu, to use the new PATH. 4. Download latest UxPlay from github **(to use `git`, install it with ``pacman -S git``, then "`git clone https://github.com/FDH2/UxPlay`")**, then install UxPlay dependencies: @@ -416,27 +416,30 @@ GStreamer sound was so far only confirmed to work with the DirectSound audiosink `pacman -S mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base` - It should also be possible to install gstreamer for Windows from the [offical GStreamer site](https://gstreamer.freedesktop.org/download/), - especially if you are trying a different Windows build system. - -5. cd to the UxPlay source directory, then "`mkdir build`" and "``cd build``", then + Note that libplist will be linked statically to the uxplay executable. + It should also be possible to install gstreamer for Windows from the [offical GStreamer site](https://gstreamer.freedesktop.org/download/), + especially if you are trying a different Windows build system. +5. cd to the UxPlay source directory, then "`mkdir build`" and "``cd build``", followed by `cmake ..` `ninja` -6. Assuming no error in either of these, you will have built the uxplay executable **uxplay.exe** in the current ("build") directory. Unfortunately - "`make install`" does not yet work, as an equivalent to ``sudo`` does not appear to be available. You can run **uxplay.exe** from the command line in - the build directory, or move it it somewhere in your PATH: in the MSYS2 environment, `/usr/local/bin` is in the PATH, so install using - - `mkdir /usr/local/bin` - - `cp uxplay.exe /usr/local/bin/` - - This does not install manpages, but you will have access to help with "`uxplay -h`". +6. Assuming no error in either of these, you will have built the uxplay executable **uxplay.exe** in the current ("build") + directory. The "sudo make install" and "sudo make uninstall" features offered in the other builds are not available + on Windows; instead, the MSYS2 environment has + `/usr/local/...` available, and you can install the uxplay.exe executable + in `/usr/local/bin` (plus manpage and documentation in ``/usr/local/share``) with -To run **uxplay.exe** you need to install gstreamer plugins. For sound, the audiosink option `-as directsoundsink` has worked. -Install plugins with `pacman -S mingw-w64-x86_64-gst-`, where ```` is + `cmake --install . --prefix /usr/local` + + To be able to view the manpage, you need to install the manpage viewer with "`pacman -S man`", then give it the location of the uxplay manpage: + + `echo 'export "MANPATH=$MANPATH:/usr/local/share/man"' >> ~/.bashrc ` + + (followed by "`source ~/.bashrc`"). + +To run **uxplay.exe** you need to install gstreamer plugins with `pacman -S mingw-w64-x86_64-gst-`, where ```` is 1. **libav** 2. **plugins-good** @@ -444,17 +447,22 @@ Install plugins with `pacman -S mingw-w64-x86_64-gst-`, where `` Other possible MSYS2 gstreamer plugin packages you might use are listed in [MSYS2 packages](https://packages.msys2.org/package/). -You also will need to grant the uxplay executable permission to have access through the Windows firewall. You may automatically be offered the choice to do this when you first run uxplay, or you may need to do it using **Windows Settings->Update and Security->Windows Security->Firewall & network protection -> allow an app through firewall**. If your virus protection flags uxplay.exe as "suspicious" (but without a true malware signature) you may need to give it an exception. +You also will need to grant permission to the uxplay executable uxplay.exe to access data through the Windows firewall. You may automatically +be offered the choice to do this when you first run uxplay, or you may need to do it +using **Windows Settings->Update and Security->Windows Security->Firewall & network protection -> allow an app through firewall**. If +your virus protection flags uxplay.exe as "suspicious" (but without a true malware signature) you may need to give it an exception. -Now test (in a MSYS2 terminal window) with +Now test by running "`uxplay`" (in a MSYS2 terminal window). If you +need to specify the audiosink, there are two main choices on Windows: the older DirectSound plugin "`-as directsoundsink`", +and the more modern Windows Audio Session API (wasapi) plugin "`-as wasapisink`", which supports options such as ``` -uxplay -as directsoundsink +uxplay -as 'wasapisink low_latency=true device=\"\"' ``` +where `` specifies an available audio device by its GUID, which can be found using +"`gst-device-monitor-1.0 Audio`": ```` has a form like ```\{0.0.0.00000000\}.\{98e35b2b-8eba-412e-b840-fd2c2492cf44\}```. + -Unfortunately, so far there is no success in getting UxPlay to successfully create a valid GStreamer audio pipeline ending at -the more-modern **wasapi** Windows audiosink with option "`-as wasapisink`". - # Usage Options: @@ -549,7 +557,7 @@ which will not work if a firewall is running. **-as _audiosink_** chooses the GStreamer audiosink, instead of letting autoaudiosink pick it for you. Some audiosink choices are: pulsesink, alsasink, pipewiresink, - osssink, oss4sink, jackaudiosink, a2dpsink, and osxaudiosink (for macOS). Using quotes + osssink, oss4sink, jackaudiosink, osxaudiosink (for macOS), wasapisink, directsoundsink (for Windows). Using quotes "..." might allow some parameters to be included with the audiosink name. (Some choices of audiosink might not work on your system.) diff --git a/README.txt b/README.txt index 05849e5..0db5745 100644 --- a/README.txt +++ b/README.txt @@ -462,17 +462,13 @@ landscape mode as the device is rotated). ## Building UxPlay on Windows (tested on Windows 10 64bit, using MSYS2 and MinGW-64 compiler) -Limitations: "`sudo make install`" does not work (due to lack of "sudo" -equivalent on this platform); GStreamer sound was so far only confirmed -to work with the DirectSound audiosink option "`-as directsoundsink`". - 1. Download and install **Bonjour SDK for Windows v3.0** from the official Apple site [https://developer.apple.com/download](https://developer.apple.com/download/all/?q=Bonjour%20SDK%20for%20Windows) -2. (This is for the MSYS2 build enviroment; other build environments - may also work, but are not yet tested): download and install MSYS2 - from the official site https://www.msys2.org/ +2. (This is for the unix-like MSYS2 build enviroment; other build + environments may also work, but are not yet tested): download and + install MSYS2 from the official site 3. For building on Windows 64 bit, install the **MinGW-64** compiler and cmake ([MSYS2 packages](https://packages.msys2.org/package/) are @@ -494,7 +490,7 @@ to work with the DirectSound audiosink option "`-as directsoundsink`". `echo 'export PATH="/mingw64/bin/:$PATH"' >> ~/.bashrc` - Now close the MSYS2 terminal widow, and reopen a new one from the + Now close the MSYS2 terminal window, and reopen a new one from the Start menu, to use the new PATH. 4. Download latest UxPlay from github **(to use `git`, install it with @@ -506,36 +502,39 @@ to work with the DirectSound audiosink option "`-as directsoundsink`". `pacman -S mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base` - It should also be possible to install gstreamer for Windows from the - [offical GStreamer + Note that libplist will be linked statically to the uxplay + executable. It should also be possible to install gstreamer for + Windows from the [offical GStreamer site](https://gstreamer.freedesktop.org/download/), especially if you are trying a different Windows build system. 5. cd to the UxPlay source directory, then "`mkdir build`" and - "`cd build`", then + "`cd build`", followed by `cmake ..` `ninja` 6. Assuming no error in either of these, you will have built the uxplay - executable **uxplay.exe** in the current ("build") directory. - Unfortunately "`make install`" does not yet work, as an equivalent - to `sudo` does not appear to be available. You can run - **uxplay.exe** from the command line in the build directory, or move - it it somewhere in your PATH: in the MSYS2 environment, - `/usr/local/bin` is in the PATH, so install using + executable **uxplay.exe** in the current ("build") directory. The + "sudo make install" and "sudo make uninstall" features offered in + the other builds are not available on Windows; instead, the MSYS2 + environment has `/usr/local/...` available, and you can install the + uxplay.exe executable in `/usr/local/bin` (plus manpage and + documentation in `/usr/local/share`) with - `mkdir /usr/local/bin` + `cmake --install . --prefix /usr/local` - `cp uxplay.exe /usr/local/bin/` + To be able to view the manpage, you need to install the manpage + viewer with "`pacman -S man`", then give it the location of the + uxplay manpage: - This does not install manpages, but you will have access to help - with "`uxplay -h`". + `echo 'export "MANPATH=$MANPATH:/usr/local/share/man"' >> ~/.bashrc` -To run **uxplay.exe** you need to install gstreamer plugins. For sound, -the audiosink option `-as directsoundsink` has worked. Install plugins -with `pacman -S mingw-w64-x86_64-gst-`, where `` is + (followed by "`source ~/.bashrc`"). + +To run **uxplay.exe** you need to install gstreamer plugins with +`pacman -S mingw-w64-x86_64-gst-`, where `` is 1. **libav** 2. **plugins-good** @@ -544,22 +543,26 @@ with `pacman -S mingw-w64-x86_64-gst-`, where `` is Other possible MSYS2 gstreamer plugin packages you might use are listed in [MSYS2 packages](https://packages.msys2.org/package/). -You also will need to grant the uxplay executable permission to have -access through the Windows firewall. You may automatically be offered -the choice to do this when you first run uxplay, or you may need to do -it using **Windows Settings-\>Update and Security-\>Windows -Security-\>Firewall & network protection -\> allow an app through -firewall**. If your virus protection flags uxplay.exe as "suspicious" -(but without a true malware signature) you may need to give it an -exception. +You also will need to grant permission to the uxplay executable +uxplay.exe to access data through the Windows firewall. You may +automatically be offered the choice to do this when you first run +uxplay, or you may need to do it using **Windows Settings-\>Update and +Security-\>Windows Security-\>Firewall & network protection -\> allow an +app through firewall**. If your virus protection flags uxplay.exe as +"suspicious" (but without a true malware signature) you may need to give +it an exception. -Now test (in a MSYS2 terminal window) with +Now test by running "`uxplay`" (in a MSYS2 terminal window). If you need +to specify the audiosink, there are two main choices on Windows: the +older DirectSound plugin "`-as directsoundsink`", and the more modern +Windows Audio Session API (wasapi) plugin "`-as wasapisink`", which +supports options such as - uxplay -as directsoundsink + uxplay -as 'wasapisink low_latency=true device=\"\"' -Unfortunately, so far there is no success in getting UxPlay to -successfully create a valid GStreamer audio pipeline ending at the -more-modern **wasapi** Windows audiosink with option "`-as wasapisink`". +where `` specifies an available audio device by its GUID, which +can be found using "`gst-device-monitor-1.0 Audio`": `` has a form +like `\{0.0.0.00000000\}.\{98e35b2b-8eba-412e-b840-fd2c2492cf44\}`. # Usage @@ -671,10 +674,10 @@ systems using the framebuffer, like RPi OS Bullseye Lite). **-as *audiosink*** chooses the GStreamer audiosink, instead of letting autoaudiosink pick it for you. Some audiosink choices are: pulsesink, -alsasink, pipewiresink, osssink, oss4sink, jackaudiosink, a2dpsink, 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.) +alsasink, pipewiresink, osssink, oss4sink, jackaudiosink, osxaudiosink +(for macOS), wasapisink, directsoundsink (for Windows). 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. diff --git a/renderers/audio_renderer_gstreamer.c b/renderers/audio_renderer_gstreamer.c index 95920ba..57393a6 100644 --- a/renderers/audio_renderer_gstreamer.c +++ b/renderers/audio_renderer_gstreamer.c @@ -103,6 +103,9 @@ void audio_renderer_init(logger_t *render_logger, const char* audiosink) { break; } g_string_append (launch, "audioconvert ! volume name=volume ! level ! "); +#ifdef _WIN32 + g_string_append (launch, "audioresample ! "); /* wasapisink must resample from 44.1 kHz to 48 kHz */ +#endif g_string_append (launch, audiosink); g_string_append (launch, " sync=false"); renderer_type[i]->pipeline = gst_parse_launch(launch->str, &error); diff --git a/uxplay.1 b/uxplay.1 index cee973c..5c914c9 100644 --- a/uxplay.1 +++ b/uxplay.1 @@ -68,7 +68,7 @@ UxPlay 1.56: An open\-source AirPlay mirroring server based on RPiPlay .IP choices:pulsesink,alsasink,pipewiresink,osssink,oss4sink, .IP - jackaudiosink,a2dpsink,osxaudiosink,.. + jackaudiosink,osxaudiosink,wasapisink,directsoundsink,.. .PP .TP \fB\-as\fR 0 (or \fB\-a\fR) Turn audio off, streamed video only. diff --git a/uxplay.cpp b/uxplay.cpp index 8fa435c..d701b22 100644 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -411,8 +411,8 @@ static void print_info (char *name) { printf("-rpifb Same as \"-rpi -vs kmssink\" for RPi using framebuffer.\n"); printf("-rpiwl Same as \"-rpi -vs waylandsink\" for RPi using Wayland.\n"); printf("-as ... Choose the GStreamer audiosink; default \"autoaudiosink\"\n"); - printf(" choices include: pulsesink,alsasink,pipewiresink,osssink,\n"); - printf(" oss4sink,jackaudiosink,a2dpsink,osxaudiosink, etc.\n"); + 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("-ca In Airplay Audio (ALAC) mode, write cover-art to file \n"); printf("-reset n Reset after 3n seconds client silence (default %d, 0=never)\n", NTP_TIMEOUT_LIMIT);