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.

117 lines
3.7 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. # Prerequisites
  14. Prepare xrdp source in your home directory. Of course, you can choose another
  15. directory.
  16. cd ~
  17. git clone https://github.com/neutrinolabs/xrdp.git
  18. In this instruction, pulseaudio version is **10.0**. Replace the version number
  19. in this instruction if your environment has different versions. You can find
  20. out your pulseaudio version executing the following command:
  21. pulseaudio --version
  22. # How to build
  23. ## Debian 9 / Ubuntu
  24. This instruction also should be applicable to Ubuntu family.
  25. ### Prerequisites
  26. Some build tools and package development tools are required. Make sure install
  27. the tools.
  28. apt install build-essential dpkg-dev
  29. ### Prepare & build
  30. Install pulseaudio and requisite packages to build pulseaudio.
  31. apt install pulseaudio
  32. apt build-dep pulseaudio
  33. Fetch the pulseaudio source . You'll see `pulseaudio-10.0` directory in your
  34. current directory.
  35. apt source pulseaudio
  36. Enter into the directory and build the pulseaudio package.
  37. cd pulseaudio-10.0
  38. ./configure
  39. Finally, let's make. You'll have two .so files `module-xrdp-sink.so` and
  40. `module-xrdp-source.so`.
  41. cd ~/xrdp/sesman/chansrv/pulse
  42. make PULSE_DIR="~/pulseaudio-10.0"
  43. ## Other distro
  44. First off, find out your pulseaudio version using `pulseaudio --version`
  45. command. Download the tarball of the pulseaudio version that you have.
  46. * https://freedesktop.org/software/pulseaudio/releases/
  47. After downloading the tarball, extact the tarball and `cd` into the source
  48. directory, then run `./configure`.
  49. wget https://freedesktop.org/software/pulseaudio/releases/pulseaudio-10.0.tar.xz
  50. tar xf pulseaudio-10.0.tar.gz
  51. cd pulseaudio-10.0
  52. ./configure
  53. If additional packages are required to run `./configure`, install requisite
  54. packages depending on your environment.
  55. Finally, let's make. You'll have two .so files `module-xrdp-sink.so` and
  56. `module-xrdp-source.so`.
  57. cd ~/xrdp/sesman/chansrv/pulse
  58. make PULSE_DIR="~/pulseaudio-10.0"
  59. # Install
  60. Install process is not distro specific except for install destination. Install
  61. built two .so files into the pulseaudio modules directory. Typically,
  62. `/usr/lib/pulse-10.0/modules` for Debian, `/usr/lib64/pulse-10.0/modules` for
  63. CentOS 7. Other distro might have different path. Find out the right path for
  64. your distro.
  65. Look into the directory with `ls` command. You'll see lots of `module-*.so`
  66. files. There's the place!
  67. cd ~/xrdp/sesman/chansrv/pulse
  68. for f in *.so; do install -s -m 644 $f /usr/lib/pulse-10.0/modules; done
  69. This command is equivalent to following:
  70. install -s -m 644 module-xrdp-sink.so /usr/lib/pulse-10.0/modules
  71. install -s -m 644 module-xrdp-source.so /usr/lib/pulse-10.0/modules
  72. Well done! Pulseaudio modules should be properly built and installed.
  73. # See if it works
  74. To see if it works, run `pavumeter` in the xrdp session. Playback any YouTube
  75. video in Firefox. You'll see "Showing signal levels of **xrdp sink**" and
  76. volume meter moving.