WIN32 audio updates, README and manpage

added audioresample to audio pipeline for WIN32
This commit is contained in:
fduncanh
2022-09-03 16:29:40 -04:00
parent c3b31d5edf
commit 2c76b06586
6 changed files with 133 additions and 115 deletions

View File

@@ -458,17 +458,14 @@ landscape mode as the device is rotated).</p>
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)</h2>
<p>Limitations: “<code>sudo make install</code>” 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
<code>-as directsoundsink</code>”.</p>
<ol type="1">
<li><p>Download and install <strong>Bonjour SDK for Windows
v3.0</strong> from the official Apple site <a
href="https://developer.apple.com/download/all/?q=Bonjour%20SDK%20for%20Windows">https://developer.apple.com/download</a></p></li>
<li><p>(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/</p></li>
<li><p>(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 <a
href="https://www.msys2.org/">https://www.msys2.org/</a></p></li>
<li><p>For building on Windows 64 bit, install the
<strong>MinGW-64</strong> compiler and cmake (<a
href="https://packages.msys2.org/package/">MSYS2 packages</a> are
@@ -485,7 +482,7 @@ run</p>
<p><code>pacman -S mingw-w64-x86_64-cmake</code></p>
<p><code>pacman -S mingw-w64-x86_64-gcc</code></p>
<p><code>echo 'export PATH="/mingw64/bin/:$PATH"' &gt;&gt; ~/.bashrc</code></p>
<p>Now close the MSYS2 terminal widow, and reopen a new one from the
<p>Now close the MSYS2 terminal window, and reopen a new one from the
Start menu, to use the new PATH.</p></li>
<li><p>Download latest UxPlay from github <strong>(to use
<code>git</code>, install it with <code>pacman -S git</code>, then
@@ -493,32 +490,32 @@ Start menu, to use the new PATH.</p></li>
install UxPlay dependencies:</p>
<p><code>pacman -S mingw-w64-x86_64-libplist mingw-w64-x86_64-openssl</code></p>
<p><code>pacman -S mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base</code></p>
<p>It should also be possible to install gstreamer for Windows from the
<a href="https://gstreamer.freedesktop.org/download/">offical GStreamer
site</a>, especially if you are trying a different Windows build
system.</p></li>
<p>Note that libplist will be linked statically to the uxplay
executable. It should also be possible to install gstreamer for Windows
from the <a href="https://gstreamer.freedesktop.org/download/">offical
GStreamer site</a>, especially if you are trying a different Windows
build system.</p></li>
<li><p>cd to the UxPlay source directory, then
<code>mkdir build</code>” and “<code>cd build</code>”, then</p>
<code>mkdir build</code>” and “<code>cd build</code>”, followed by</p>
<p><code>cmake ..</code></p>
<p><code>ninja</code></p></li>
<li><p>Assuming no error in either of these, you will have built the
uxplay executable <strong>uxplay.exe</strong> in the current (“build”)
directory. Unfortunately “<code>make install</code>” does not yet work,
as an equivalent to <code>sudo</code> does not appear to be available.
You can run <strong>uxplay.exe</strong> from the command line in the
build directory, or move it it somewhere in your PATH: in the MSYS2
environment, <code>/usr/local/bin</code> is in the PATH, so install
using</p>
<p><code>mkdir /usr/local/bin</code></p>
<p><code>cp uxplay.exe /usr/local/bin/</code></p>
<p>This does not install manpages, but you will have access to help with
<code>uxplay -h</code>”.</p></li>
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 <code>/usr/local/...</code> available, and you can
install the uxplay.exe executable in <code>/usr/local/bin</code> (plus
manpage and documentation in <code>/usr/local/share</code>) with</p>
<p><code>cmake --install . --prefix /usr/local</code></p>
<p>To be able to view the manpage, you need to install the manpage
viewer with “<code>pacman -S man</code>”, then give it the location of
the uxplay manpage:</p>
<p><code>echo 'export "MANPATH=$MANPATH:/usr/local/share/man"' &gt;&gt; ~/.bashrc</code></p>
<p>(followed by “<code>source ~/.bashrc</code>”).</p></li>
</ol>
<p>To run <strong>uxplay.exe</strong> you need to install gstreamer
plugins. For sound, the audiosink option
<code>-as directsoundsink</code> has worked. Install plugins with
<code>pacman -S mingw-w64-x86_64-gst-&lt;plugin&gt;</code>, where
<code>&lt;plugin&gt;</code> is</p>
plugins with <code>pacman -S mingw-w64-x86_64-gst-&lt;plugin&gt;</code>,
where <code>&lt;plugin&gt;</code> is</p>
<ol type="1">
<li><strong>libav</strong></li>
<li><strong>plugins-good</strong></li>
@@ -527,20 +524,26 @@ plugins. For sound, the audiosink option
<p>Other possible MSYS2 gstreamer plugin packages you might use are
listed in <a href="https://packages.msys2.org/package/">MSYS2
packages</a>.</p>
<p>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 <strong>Windows Settings-&gt;Update and Security-&gt;Windows
Security-&gt;Firewall &amp; network protection -&gt; allow an app
through firewall</strong>. If your virus protection flags uxplay.exe as
“suspicious” (but without a true malware signature) you may need to give
it an exception.</p>
<p>Now test (in a MSYS2 terminal window) with</p>
<pre><code>uxplay -as directsoundsink</code></pre>
<p>Unfortunately, so far there is no success in getting UxPlay to
successfully create a valid GStreamer audio pipeline ending at the
more-modern <strong>wasapi</strong> Windows audiosink with option
<code>-as wasapisink</code>”.</p>
<p>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 <strong>Windows
Settings-&gt;Update and Security-&gt;Windows Security-&gt;Firewall &amp;
network protection -&gt; allow an app through firewall</strong>. If your
virus protection flags uxplay.exe as “suspicious” (but without a true
malware signature) you may need to give it an exception.</p>
<p>Now test by running “<code>uxplay</code>” (in a MSYS2 terminal
window). If you need to specify the audiosink, there are two main
choices on Windows: the older DirectSound plugin
<code>-as directsoundsink</code>”, and the more modern Windows Audio
Session API (wasapi) plugin “<code>-as wasapisink</code>”, which
supports options such as</p>
<pre><code>uxplay -as &#39;wasapisink low_latency=true device=\&quot;&lt;guid&gt;\&quot;&#39; </code></pre>
<p>where <code>&lt;guid&gt;</code> specifies an available audio device
by its GUID, which can be found using
<code>gst-device-monitor-1.0 Audio</code>”: <code>&lt;guid&gt;</code>
has a form like
<code>\{0.0.0.00000000\}.\{98e35b2b-8eba-412e-b840-fd2c2492cf44\}</code>.</p>
<h1 id="usage">Usage</h1>
<p>Options:</p>
<p><strong>-n server_name</strong> (Default: UxPlay);
@@ -639,9 +642,10 @@ for Ubuntu 21.10 for Raspberry Pi 4B).</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, 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.)</p>
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.)</p>
<p><strong>-as 0</strong> (or just <strong>-a</strong>) suppresses
playing of streamed audio, but displays streamed video.</p>
<p><strong>-ca <em>filename</em></strong> provides a file (where

View File

@@ -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-<plugin>`, where ``<plugin>`` 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-<plugin>`, where ``<plugin>`` is
1. **libav**
2. **plugins-good**
@@ -444,17 +447,22 @@ Install plugins with `pacman -S mingw-w64-x86_64-gst-<plugin>`, where ``<plugin>
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=\"<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\}```.
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.)

View File

@@ -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 <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
@@ -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-<plugin>`, where `<plugin>` is
(followed by "`source ~/.bashrc`").
To run **uxplay.exe** you need to install gstreamer plugins with
`pacman -S mingw-w64-x86_64-gst-<plugin>`, where `<plugin>` is
1. **libav**
2. **plugins-good**
@@ -544,22 +543,26 @@ with `pacman -S mingw-w64-x86_64-gst-<plugin>`, where `<plugin>` 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=\"<guid>\"'
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 `<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
@@ -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.

View File

@@ -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);

View File

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

View File

@@ -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 <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);