Skip to content

Instantly share code, notes, and snippets.

@eschen42
Forked from krisalyssa/readme.txt
Created July 20, 2021 18:46
Show Gist options
  • Save eschen42/c7e71b40f0d6aed3f5c06d127e9db54c to your computer and use it in GitHub Desktop.
Save eschen42/c7e71b40f0d6aed3f5c06d127e9db54c 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment