Skip to content

Instantly share code, notes, and snippets.

@krisalyssa
Forked from rkttu/readme.txt
Last active September 12, 2022 20:31
Show Gist options
  • Save krisalyssa/fad000cc2ec4678203acf62c4ad2ab23 to your computer and use it in GitHub Desktop.
Save krisalyssa/fad000cc2ec4678203acf62c4ad2ab23 to your computer and use it in GitHub Desktop.
Ubuntu 20.10 + WSL 2 + XRDP PulseAudio
# Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# https://gist.github.com/rkttu/35ecab5604c9ddc356b0af4644d5a226
# First, you should install XRDP and X11 Desktop Environment first.
# Step 1 - Install Some PreReqs
sudo apt-get install git libpulse-dev autoconf m4 intltool build-essential dpkg-dev libtool libsndfile1-dev libspeexdsp-dev libudev-dev -y
# Enable source repo
sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt-get update
sudo apt build-dep pulseaudio -y
# Download pulseaudio source in /tmp directory - Do not forget to enable source repositories
cd /tmp
apt source pulseaudio
# Compile
pulsever=$(pulseaudio --version | awk '{print $2}')
cd /tmp/pulseaudio-$pulsever
./configure --without-caps
# Create xrdp sound modules
git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
cd pulseaudio-module-xrdp
./bootstrap
./configure PULSE_DIR="/tmp/pulseaudio-$pulsever"
make
#copy files to correct location (as defined in /etc/xrdp/pulse/default.pa)
cd /tmp/pulseaudio-$pulsever/pulseaudio-module-xrdp/src/.libs
sudo install -t "/var/lib/xrdp-pulseaudio-installer" -D -m 644 *.so
# TODO: Register pulseaudio as a service
# Restart xrdp
## not allowed: "may be requested by dependency only (it is configured to refuse manual start/stop)."
# sudo service dbus restart
## only once pulseaudio has been registered as a service
sudo service pulseaudio restart
sudo service xrdp restart
@krisalyssa
Copy link
Author

The first error says that you don't have write permission in the directory where you're running configure. I don't know if that's normal for whatever operating system you're running, and determining that and fixing it is out of scope for this gist.

The cleanest and safest way I can think of to make these instructions work for you is to

  1. create a directory in your home directory like mkdir -p ~/pulseaudio, then
  2. start following the instructions above from line 22, replacing /tmp with ~/pulseaudio everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment