You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

281 lines
9.4 KiB

  1. [![Build Status](https://travis-ci.org/neutrinolabs/pulseaudio-module-xrdp.svg?branch=devel)](https://travis-ci.org/neutrinolabs/pulseaudio-module-xrdp)
  2. The latest version of this document can be found at wiki.
  3. * https://github.com/neutrinolabs/pulseaudio-module-xrdp/wiki/README
  4. # Overview
  5. xrdp implements Audio Output redirection using PulseAudio, which is a sound
  6. system used on POSIX operating systems.
  7. The server to client audio redirection is implemented as per **Remote Desktop
  8. Protocol: Audio Output Virtual Channel Extension
  9. [[MS-RDPEA]](https://msdn.microsoft.com/en-us/library/cc240933.aspx)** specs,
  10. which means it is interoperable with any RDP client which implements it
  11. (most of them including: MS RDP clients, FreeRDP).
  12. However, our Microphone redirection (client to server) implementation is
  13. proprietary and doesn't implement the
  14. [[MS-RDPEAI]](https://msdn.microsoft.com/en-us/library/dd342521.aspx)
  15. specs. Its only supported by the following clients so far: NeutrinoRDP client
  16. and rdesktop.
  17. Here is how to build pulseaudio modules for your distro, so you can have audio
  18. support through xrdp.
  19. In this instruction, pulseaudio version is **11.1**. You need to **replace the
  20. version number in this instruction** if your environment has different
  21. versions. You can find out your pulseaudio version executing the following
  22. command:
  23. pulseaudio --version
  24. or
  25. pkg-config --modversion libpulse
  26. # How to build
  27. ## Debian 9 / Ubuntu
  28. This instruction also should be applicable to the Ubuntu family.
  29. ### Prerequisites
  30. Some build tools and package development tools are required. Make sure install
  31. the tools.
  32. apt install build-essential dpkg-dev
  33. ### Prepare & build
  34. Install pulseaudio and requisite packages to build pulseaudio.
  35. apt install pulseaudio
  36. apt build-dep pulseaudio
  37. Fetch the pulseaudio source. You'll see `pulseaudio-11.1` directory in your
  38. current directory.
  39. apt source pulseaudio
  40. Enter into the directory and build the pulseaudio package.
  41. cd pulseaudio-11.1
  42. ./configure
  43. Finally, let's build xrdp source / sink modules. You'll have two .so files
  44. `module-xrdp-sink.so` and `module-xrdp-source.so`.
  45. git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
  46. cd pulseaudio-module-xrdp
  47. ./bootstrap && ./configure PULSE_DIR=/path/to/pulseaudio-11.1
  48. make
  49. ## CentOS 7.x (7.5 or later requires this build procedure)
  50. ### Prerequisites
  51. Some build tools and package development tools are required. Make sure install
  52. the tools.
  53. yum groupinstall "Development Tools"
  54. yum install rpmdevtools yum-utils
  55. rpmdev-setuptree
  56. ### Prepare & build
  57. Install pulseaudio and requisite packages to build pulseaudio.
  58. yum install pulseaudio pulseaudio-libs pulseaudio-libs-devel
  59. yum-builddep pulseaudio
  60. Fetch the pulseaudio source and extract. You'll see `~/rpmbuild/BUILD/
  61. yumdownloader --source pulseaudio
  62. rpm --install pulseaudio*.src.rpm
  63. Build the pulseaudio source. In this phase, pulseaudio is not necessarily needed to be built but
  64. configured however there's no way to do only configure.
  65. rpmbuild -bb --noclean ~/rpmbuild/SPECS/pulseaudio.spec
  66. Finally, let's build xrdp source / sink modules. You'll have two .so files
  67. `module-xrdp-sink.so` and `module-xrdp-source.so`.
  68. git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
  69. cd pulseaudio-module-xrdp
  70. ./bootstrap && ./configure PULSE_DIR=~/rpmbuild/BUILD/pulseaudio-10.0
  71. make
  72. *******************************************************************************
  73. *******************************************************************************
  74. ## Fedora 33 Workstation
  75. Linux/Fedora version
  76. uname -a
  77. Linux localhost.localdomain 5.10.14-200.fc33.x86_64 #1 SMP Sun Feb 7 19:59:31 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  78. *******************************************************************************
  79. Overview
  80. Install Fedora 33 Workstation from DVD/USB
  81. -Select optional software groups
  82. C Development Tools and Libraries
  83. Development Tools
  84. System Tools
  85. Read the following:
  86. -https://github.com/neutrinolabs/xrdp/blob/devel/README.md
  87. Requirements for building xrdp (only used for dependencies)
  88. -https://github.com/neutrinolabs/pulseaudio-module-xrdp/wiki/README
  89. How to install and configure pulseaudio source files
  90. How to install and build xrdp modules for pulseaudio
  91. -https://github.com/neutrinolabs/xrdp/wiki/Audio-Output-Virtual-Channel-support-in-xrdp
  92. How xrdp selects pulseaudio modules (older info. did not do any of the suggestions.)
  93. Install pulseaudio source
  94. -Download source
  95. -Run ./configure to customize for your machine/version
  96. Install xrdp module source
  97. -Download source
  98. -Run ./bootstrap to pre-build compile environment
  99. -Run ./configure make files
  100. -Make modules
  101. -Install modules in system directories
  102. Note:
  103. -You cannot be logged in from a GUI session (on the hardware console) and xrdp at the same time.
  104. *******************************************************************************
  105. Installation steps from neutrino labs pulseaudio-module-xrdp readme.md file
  106. -Changing 11.1 in example to 14.0 for Fedora 33 Workstation
  107. -Adding additional steps for Fedora 33 Workstation
  108. # sudo -s (home-dir is now /root)
  109. Add the following packages:
  110. (from https://github.com/neutrinolabs/xrdp/blob/devel/README.md)
  111. dnf install -y tigervnc-server openssl-devel pam-devel
  112. dnf install -y libX11-devel libXfixes-devel libXrandr-devel
  113. (from many attempts at ./configure)
  114. dnf install -y libjpeg-devel fuse-devel perl-libxml-perl libtool-ltdl-devel
  115. dnf install -y libcap-devel libsndfile-devel libgudev-devel
  116. dnf install -y dbus-devel dbus-doc.noarch dbus-tests
  117. dnf install -y speex-devel speex-tools speexdsp-devel
  118. dnf install -y systemd-devel systemd-tests
  119. dnf install -y sbc-devel
  120. dnf install -y pulseaudio-libs-devel
  121. *******************************************************************************
  122. Find pulseaudio version
  123. # pulseaudio --version
  124. pulseaudio 14.0-rebootstrapped
  125. Check if xrdp modules are already installed
  126. # pulseaudio --dump-modules
  127. note: no xrdp modules were listed on my system
  128. *******************************************************************************
  129. Retrieve and configure the pulseaudio source-version that matches your installed-version
  130. see the (extensive) list source-versions at https://freedesktop.org/software/pulseaudio/releases
  131. #
  132. # wget https://freedesktop.org/software/pulseaudio/releases/pulseaudio-14.0.tar.xz
  133. # tar xf pulseaudio-14.0.tar.xz
  134. # cd pulseaudio-14.0
  135. # ./configure
  136. # cd ..
  137. *******************************************************************************
  138. Retrieve, configure, and compile the source for the xrdp pulseaudio module.
  139. Note: use a fully-qualified path name for ./configure
  140. #
  141. # git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
  142. # cd pulseaudio-module-xrdp
  143. # ./bootstrap
  144. # ./configure PULSE_DIR='/root/pulseaudio-14.0'
  145. # make
  146. # make install
  147. *******************************************************************************
  148. Verify modules are installed
  149. # ls $(pkg-config --variable=modlibexecdir libpulse)
  150. ...
  151. module-xrdp-sink.la module-xrdp-sink.so module-xrdp-source.la module-xrdp-source.so
  152. Verify pulseaudio can use the xrdp modules.
  153. # pulseaudio --dump-modules
  154. module-xrdp-sink xrdp sink
  155. module-xrdp-source xrdp source
  156. Verify Fedora can see xrdp sink/source as audio options
  157. -Close any remote or console sessions to your host
  158. -Open a new xrdp session to your host
  159. -Click:
  160. Activities -> Show Applications -> Settings -> Sound
  161. Output Device should be "xrdp sink"
  162. Test button opens a dialog with "Left" and "Right" tests
  163. Clicking on "Left" and "Right" should make sound from your corresponding speaker
  164. *******************************************************************************
  165. *******************************************************************************
  166. ## Other distro
  167. First off, find out your pulseaudio version using `pulseaudio --version`
  168. command. Download the tarball of the pulseaudio version that you have.
  169. * https://freedesktop.org/software/pulseaudio/releases/
  170. After downloading the tarball, extract the tarball and `cd` into the source
  171. directory, then run `./configure`.
  172. wget https://freedesktop.org/software/pulseaudio/releases/pulseaudio-11.1.tar.xz
  173. tar xf pulseaudio-11.1.tar.xz
  174. cd pulseaudio-11.1
  175. ./configure
  176. If additional packages are required to run `./configure`, install requisite
  177. packages depending on your environment.
  178. Finally, let's build xrdp source / sink modules. You'll have two .so files
  179. `module-xrdp-sink.so` and `module-xrdp-source.so`.
  180. git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
  181. cd pulseaudio-module-xrdp
  182. ./bootstrap && ./configure PULSE_DIR=/path/to/pulseaudio-11.1
  183. make
  184. # Install
  185. Just `make install` should install built modules to the correct directory.
  186. You can confirm if the modules properly installed by following command:
  187. ```
  188. ls $(pkg-config --variable=modlibexecdir libpulse)
  189. ```
  190. If you can see lots of `module-*.so` and `module-xrdp-sink.so`,
  191. `module-xrdp-source.so`, PulseAudio modules should be properly built and
  192. installed.
  193. `module-xrdp-sink.so` and `module-xrdp-source.so` may be installed to the
  194. target directory, these files are not necessary and you can remove them safely.
  195. Enjoy!
  196. # See if it works
  197. To see if it works, run `pavumeter` in the xrdp session. Playback any YouTube
  198. video in Firefox. You'll see "Showing signal levels of **xrdp sink**" and
  199. volume meter moving.