xRDP – Missing packages for Sound Redirection in Ubuntu 19.04

Hello World,

Ubuntu 19.04 has been release for some time now and we are still investigating the impact of this release on the installation process of xRDP on top of it.  So far, we can say that the installation process has not changed dramatically since Ubuntu 18.xx.  However, we have already detected some minor changes/issues that can affect the installation process or the user experience process.    We have started our investigation by performing a manual installation of xRDP and we have checked all the possible issues that might raise when such installation method is used.  Then, for each issues/changes detected, we have provided some options to bypass the limitation and provide the most please user experience.  

So far, we have discussed the following topics

Today, we are continuing our journey in the world of xRDP used in conjunction with Ubuntu 19.04 and we will check if sound redirection feature can be still be used…..  So, get ready…. 

Overview

It’s possible to perform sound redirection through xRDP software.  To perform such operation, there is a need to compile some additional packages.  In theory,  with Ubuntu 18.04, the process should be as simple as executing two commands 

apt install xrdp-pulseaudio-installer
xrdp-build-pulse-modules

However, in practice, this is not the case.  The xrdp-build-pulse-modules script contains some errors that prevent the successful completion of the process.  All the necessary information can be found at this location.

Because of this situation, we came up with a different solution in our xrdp installation scripts.  In the script, we are effectively using the xrdp-pulseaudio-installer package and then we perform the necessary compilation operations in order to build the xrdp modules needed in order to have sound redirection working. 

xrdp-pulseaudio-installer package is missing in Ubuntu 19.04… 

In Ubuntu 19.04, it seems that the xrdp-pulseaudio-installer package is simply not available in the repository.  We have tried to perform an xRDP installation with sound redirection and obviously this failed.  Doing a step by step approach, we found out quite quickly that indeed the xrdp-pulseaudio-installer package was not available 

Click on picture for better Resolution

This came as a surprise to us.  The final release of Ubuntu 19.04 does not ship with this package.   So, this means that we need to find another way to enable sound redirection when using xRDP software… 

New Approach : Compiling from Source

Our installation scripts were relying on the xrdp-pulseaudio-installer package. However, because the xrdp-build-modules script was not working as expected, we have basically created our own procedure to compile and build the xrdp modules needed to enable sound redirection.  So, all in all, it might be a good thing that this package is not there anymore.  This is forcing us to re-write our code.  In the coming version of the scripts (Standard and Custom installation xrdp scripts), we will compile from source the necessary components needed to enable the sound redirection feature.  

Based on the information found on neutrinolabs wiki pages, we came with the following procedure (this code might not be complete…) 


# Step 1 - Install Some PreReqs
sudo apt-get install git libpulse-dev autoconf m4 intltool build-essential dpkg-dev -y
sudo apt build-dep pulseaudio -y

#  Download pulseaudio source in /tmp directory - Do not forget to enable source repositories
cd /tmp
sudo apt source pulseaudio

# Compile
pulsever=$(pulseaudio --version | awk '{print $2}')
cd /tmp/pulseaudio-$pulsever
sudo ./configure

# Create xrdp sound modules
sudo git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
cd pulseaudio-module-xrdp
sudo ./bootstrap 
sudo ./configure PULSE_DIR="/tmp/pulseaudio-$pulsever"
sudo 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

After executing the following code, you will need to reboot the system and you should have xRDP sound redirection working.  This code has been tested on Ubuntu 18.04 and Ubuntu 19.04

Final Notes

Voila !  This is it for this post !   

We are ready to release new version of our scripts which will include Ubuntu 19.04 support and provide some minor improvements and code cleanup.  Ubuntu 19.04 release has offered us to revisit our installation process and we have seen that some minor changes needs to be addressed.   During our journey, we have discovered that there is an easier way to fix theme and look’n feel discrepancies between local and remote sessions.  We have also addressed the new Authentication Required dialog box issue detected.  Finally, the fact that Ubuntu 19.04 is not shipping the xrdp-pusleaudio-installer package has forced us to re-write the sound redirection code we were using. We actually quite happy to remove these dependencies and working with source files instead.  

Stay tuned as new version of the scripts are on their way..

Till next time 

See ya 

 

 

 

 

8 thoughts on “xRDP – Missing packages for Sound Redirection in Ubuntu 19.04

  1. Very helpful article! One question not related to the topic: Do you know how to RDP to the same session from different client? For example, I have a Linux machine H. I RDP as user U from my windows desktop at work. At home, I would like to RDP to H as user U from my home desktop. Right now, I can’t do this. I have to log out from H at work. Otherwise, I can’t connect to H as U at all from my home desktop.

    I noticed that there are some online work around about using the ask port thing. But nothing works for me. Any good suggestion?

    Thanks in advance.

  2. @Xiaofang,
    This should be working. So we have made a test.. We have performed a remote connection from machine A to Ubuntu with xRDP software. We then have disconnected our session (no logoff)
    We moved to machine B and we have performed again a connection to Ubuntu. The session was accessible with all the applications that were opened from machine A.
    Try again and perform the test in a short period of time when trying to connect from the second machine…
    We will try to perform more tests and see if you can replicate your issue

    Till next time
    See ya

  3. I’ve just followed your guide and made the sound work via rdp thanks to this. Is a LUbuntu 20.04 machine. Thanks a lot.

  4. @Guillermo,

    Thanks for visiting our blog and sharing your experience. We happy to see that the information provided is helping people. Please do note that our latest version of the xrdp-installer script offers the possibility to enable the sound as well. If you want to have a look or give it a try, next time you need to enable sound over xrdp, check this post (https://c-nergy.be/blog/?p=16817) or always check the page https//www.c-nergy.be/products.html to get the latest version of the script…

    Till next time
    See ya

  5. @Michael,

    Thanks for visiting our blog and providing feedback…Great to see that this post is still working… By the way, please note that we have developed a small script that can be used to automate the installation of xRDP and include the necessary code to compile, enable and configure the sound redirection as well…. have a look at https://www.c-nergy.be/products.html and give it a try

    Till next time
    See ya

Leave a Reply