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.

112 lines
3.8 KiB

  1. The latest version of this document can be found at wiki.
  2. * https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection
  3. # Overview
  4. xrdp supports audio redirection using PulseAudio, which is a sound system for
  5. POSIX operating systems. Server to client redirection is compliant to Remote
  6. Desktop Procol standard [[MS-RDPEA]](https://msdn.microsoft.com/en-us/library/cc240933.aspx)
  7. but client to server redirection implementation is proprietary. Accordingly,
  8. server to client redirection is available with many of RDP clients including
  9. Microsoft client but client to server redirection requires NeutrinoRDP client,
  10. not available with other clients.
  11. Here is how to build pulseaudio modules for your distro, so you can have audio
  12. support through xrdp.
  13. In this instruction, pulseaudio version is **11.1**. You need to **replace the version
  14. number in this instruction** if your environment has different versions. You can find
  15. out your pulseaudio version executing the following command:
  16. pulseaudio --version
  17. # How to build
  18. ## Debian 9 / Ubuntu
  19. This instruction also should be applicable to Ubuntu family.
  20. ### Prerequisites
  21. Some build tools and package development tools are required. Make sure install
  22. the tools.
  23. apt install build-essential dpkg-dev
  24. ### Prepare & build
  25. Install pulseaudio and requisite packages to build pulseaudio.
  26. apt install pulseaudio
  27. apt build-dep pulseaudio
  28. Fetch the pulseaudio source . You'll see `pulseaudio-11.1` directory in your
  29. current directory.
  30. apt source pulseaudio
  31. Enter into the directory and build the pulseaudio package.
  32. cd pulseaudio-11.1
  33. ./configure
  34. Finally, let's build xrdp source / sink modukes. You'll have two .so files `module-xrdp-sink.so` and
  35. `module-xrdp-source.so`.
  36. git clone https://github.com/neutrinolabs/pulseaudio-modules.git
  37. cd pulseaudio-modules
  38. make PULSE_DIR="~/pulseaudio-11.1"
  39. ## Other distro
  40. First off, find out your pulseaudio version using `pulseaudio --version`
  41. command. Download the tarball of the pulseaudio version that you have.
  42. * https://freedesktop.org/software/pulseaudio/releases/
  43. After downloading the tarball, extact the tarball and `cd` into the source
  44. directory, then run `./configure`.
  45. wget https://freedesktop.org/software/pulseaudio/releases/pulseaudio-11.1.tar.xz
  46. tar xf pulseaudio-11.1.tar.gz
  47. cd pulseaudio-11.1
  48. ./configure
  49. If additional packages are required to run `./configure`, install requisite
  50. packages depending on your environment.
  51. Finally, let's build xrdp source / sink modukes. You'll have two .so files `module-xrdp-sink.so` and
  52. `module-xrdp-source.so`.
  53. git clone https://github.com/neutrinolabs/pulseaudio-modules.git
  54. cd pulseaudio-modules
  55. make PULSE_DIR="~/pulseaudio-11.1"
  56. # Install
  57. Install process is not distro specific except for install destination. Install
  58. built two .so files into the pulseaudio modules directory. Typically,
  59. `/usr/lib/pulse-11.1/modules` for Debian, `/usr/lib64/pulse-10.0/modules` for
  60. CentOS 7. Other distro might have different path. Find out the right path and
  61. version that matches your distro/system.
  62. Look into the directory with `ls` command. You'll see lots of `module-*.so`
  63. files. There's the place! now `cd` to `pulseaudio-modules` directory and copy them.
  64. cd pulseaudio-modules
  65. for f in *.so; do install -s -m 644 $f /usr/lib/pulse-11.1/modules; done
  66. This command is equivalent to following:
  67. install -s -m 644 module-xrdp-sink.so /usr/lib/pulse-11.1/modules
  68. install -s -m 644 module-xrdp-source.so /usr/lib/pulse-11.1/modules
  69. Well done! Pulseaudio modules should be properly built and installed.
  70. # See if it works
  71. To see if it works, run `pavumeter` in the xrdp session. Playback any YouTube
  72. video in Firefox. You'll see "Showing signal levels of **xrdp sink**" and
  73. volume meter moving.