xRDP – Sound not always working on Ubuntu 19.10 – Quick Fix

Hello World, 

Recently, we have released the all new in one xrdp installer script (see at http://c-nergy.be/blog/?p=14029) and we have been working in fine tuning and customizing our new xrdp installation script.  While working on this version of the script, we have already identified some minor issues that have been explained in the following posts : 

These issues have been identified and the script already incorporate the fix.   However, we have noticed also during our tests with Ubuntu 19.10 and xRDP that the sound redirection is not working in a consistent way.  This post will explain what to do if you encounter the specific issue as described below… 

Let’s go ! 

Problem Description 

Let’s assume that you have used the latest version of the xrdp installation script (i.e. xrdp-installer-1.0.sh) on Ubuntu 19.10 and you have decided to enable sound redirection (whatever the installation mode you have selected).  You would have executed one of the following command in a terminal session (after making the script executable)

# Make the script executable  
chmod +x ~/Downloads/xrdp-installer-1.0.sh 

# Option 1 - Execute this to perform a standard installation with sound redirection
./xrdp-installer-1.0.sh -s   

# Option 2 - Execute this to perform a custom installation with sound redirection
./xrdp-installer-1.0.sh -c -s 

Note :  please read complete instructions on how to use the xrdp-installer-v1.0.sh script at http://c-nergy.be/blog/?p=14029

If everything is ok, you should be able to perform a remote connection to your Ubuntu and have access to the standard Ubuntu Desktop interface with the Dock bar on the left side.  If you are really lucky, you can check the sound card settings and you should see that the output device is showing something like the screenshot below (xrdp sink)

U1910FXRDP_14

Click on picture for better resolution 

This is what you should see (screenshot above) in order to have sound redirection working as expected…. 

If you are not lucky, when checking your sound card settings within your remote session, you will not see any xrdp sink reference and the sound redirection is basically not working.  The funny thing is that you could start your xrdp session and have no sound. But then, after a variable amount of time,  xrdp sound redirection might start to work (with no user intervention) or will never show the xrdp sink reference in the sound settings.  If you see dummy output device in your sound settings page, sound redirection will not work !

U1910FXRDP_13

Click on picture for better resolution 

The Quick Fix 

We found a quick fix for this issue.  In fact, we hope that some future Ubuntu updates might fix the issue.  In the mean time, if you want to use sound redirection in conjunction with xrdp, you will need to perform the following action.   

  • Perform your remote connection to Ubuntu using your favorite rdp client
  • When remotely connected, open a terminal console and issue the following command 
    • pulseaudio -k
  • Open then your system settings > Sound > and check that xrdp sink object is showing up 

The xrdp sound redirection will stay between login/logout but if the Ubuntu machine restart, you might need to re-issue this fix in order to have the sound redirection working again….

Demo

As a bonus, we have made a quick and dirty video to show you that this fix seems to work all the time 

 

Hope you enjoyed this post 

Till next time

See ya 

Leave a Reply