How to Remote Desktop with Microphone Redirection for Google Hangouts and Google Drive Dictation Using Ubuntu 18.10 Client and Windows 2016 or 2012r2 Server

FreeRDP 2.0.0-r3 has improved microphone redirection. We can also enable sound, USB drive hotplug automount and redirection, multi monitor support, and video streaming.

Install the FreeRDP nightlies:

sudo sh -c 'echo "deb http://pub.freerdp.com/repositories/deb/$(lsb_release -cs)/ freerdp-nightly main" >> /etc/apt/sources.list.d/freerdp-nightly.list' 
wget -O - http://pub.freerdp.com/repositories/ADD6BF6D97CE5D8D.asc | sudo apt-key add - 
sudo apt update 
sudo apt install --yes freerdp-nightly

Us the following command to connect:

/opt/freerdp-nightly/bin/xfreerdp /v:SERVER /u:USER /p:PASSWORD /sound /microphone /rfx /multitransport /network:auto /gfx:AVC444 /f /multimon /cert-ignore /drive:hotplug,*

If you don't want fullscreen, use /dynamic-resolution
If you don't like the floatbar, include -floatbar

More helpful flags here: Manpage: www.mankier.com/1/xfreer…

These flags can help you troubleshoot

/log-level:debug > rdp.log
OR
/log-filters:com.freerdp.channels.audin.client:trace

It seems to choose the AAC codec which is Microsoft’s default. If you want to force a specific codec for testing use:

/microphone:format:1 #Where 1 is PCM, raw good for troubleshooting.

Complete list of formats are below.

#define WAVE_FORMAT_PCM	0x0001
#define WAVE_FORMAT_ADPCM 0x0002
#define WAVE_FORMAT_IEEE_FLOAT 0x0003
#define WAVE_FORMAT_VSELP 0x0004
#define WAVE_FORMAT_IBM_CVSD 0x0005
#define WAVE_FORMAT_ALAW 0x0006
#define WAVE_FORMAT_MULAW 0x0007
#define WAVE_FORMAT_OKI_ADPCM 0x0010
#define WAVE_FORMAT_DVI_ADPCM 0x0011
#define WAVE_FORMAT_MEDIASPACE_ADPCM 0x0012
#define WAVE_FORMAT_SIERRA_ADPCM 0x0013
#define WAVE_FORMAT_G723_ADPCM 0x0014
#define WAVE_FORMAT_DIGISTD 0x0015
#define WAVE_FORMAT_DIGIFIX 0x0016
#define WAVE_FORMAT_DIALOGIC_OKI_ADPCM 0x0017
#define WAVE_FORMAT_MEDIAVISION_ADPCM 0x0018
#define WAVE_FORMAT_CU_CODEC 0x0019
#define WAVE_FORMAT_YAMAHA_ADPCM 0x0020
#define WAVE_FORMAT_SONARC 0x0021
#define WAVE_FORMAT_DSPGROUP_TRUESPEECH 0x0022
#define WAVE_FORMAT_ECHOSC1 0x0023
#define WAVE_FORMAT_AUDIOFILE_AF36 0x0024
#define WAVE_FORMAT_APTX 0x0025
#define WAVE_FORMAT_AUDIOFILE_AF10 0x0026
#define WAVE_FORMAT_PROSODY_1612 0x0027
#define WAVE_FORMAT_LRC 0x0028
#define WAVE_FORMAT_DOLBY_AC2 0x0030
#define WAVE_FORMAT_GSM610 0x0031
#define WAVE_FORMAT_MSNAUDIO 0x0032
#define WAVE_FORMAT_ANTEX_ADPCME 0x0033
#define WAVE_FORMAT_CONTROL_RES_VQLPC 0x0034
#define WAVE_FORMAT_DIGIREAL 0x0035
#define WAVE_FORMAT_DIGIADPCM 0x0036
#define WAVE_FORMAT_CONTROL_RES_CR10 0x0037
#define WAVE_FORMAT_NMS_VBXADPCM 0x0038
#define WAVE_FORMAT_ROLAND_RDAC 0x0039
#define WAVE_FORMAT_ECHOSC3 0x003A
#define WAVE_FORMAT_ROCKWELL_ADPCM 0x003B
#define WAVE_FORMAT_ROCKWELL_DIGITALK 0x003C
#define WAVE_FORMAT_XEBEC 0x003D
#define WAVE_FORMAT_G721_ADPCM 0x0040
#define WAVE_FORMAT_G728_CELP 0x0041
#define WAVE_FORMAT_MSG723 0x0042
#define WAVE_FORMAT_MPEG 0x0050
#define WAVE_FORMAT_RT24 0x0052
#define WAVE_FORMAT_PAC 0x0053
#define WAVE_FORMAT_MPEGLAYER3 0x0055
#define WAVE_FORMAT_LUCENT_G723 0x0059
#define WAVE_FORMAT_CIRRUS 0x0060
#define WAVE_FORMAT_ESPCM 0x0061
#define WAVE_FORMAT_VOXWARE 0x0062
#define WAVE_FORMAT_CANOPUS_ATRAC 0x0063
#define WAVE_FORMAT_G726_ADPCM 0x0064
#define WAVE_FORMAT_G722_ADPCM 0x0065
#define WAVE_FORMAT_DSAT 0x0066
#define WAVE_FORMAT_DSAT_DISPLAY 0x0067
#define WAVE_FORMAT_VOXWARE_BYTE_ALIGNED 0x0069
#define WAVE_FORMAT_VOXWARE_AC8 0x0070
#define WAVE_FORMAT_VOXWARE_AC10 0x0071
#define WAVE_FORMAT_VOXWARE_AC16 0x0072
#define WAVE_FORMAT_VOXWARE_AC20 0x0073
#define WAVE_FORMAT_VOXWARE_RT24 0x0074
#define WAVE_FORMAT_VOXWARE_RT29 0x0075
#define WAVE_FORMAT_VOXWARE_RT29HW 0x0076
#define WAVE_FORMAT_VOXWARE_VR12 0x0077
#define WAVE_FORMAT_VOXWARE_VR18 0x0078
#define WAVE_FORMAT_VOXWARE_TQ40 0x0079
#define WAVE_FORMAT_SOFTSOUND 0x0080
#define WAVE_FORMAT_VOXWARE_TQ60 0x0081
#define WAVE_FORMAT_MSRT24 0x0082
#define WAVE_FORMAT_G729A 0x0083
#define WAVE_FORMAT_MVI_MV12 0x0084
#define WAVE_FORMAT_DF_G726 0x0085
#define WAVE_FORMAT_DF_GSM610 0x0086
#define WAVE_FORMAT_ISIAUDIO 0x0088
#define WAVE_FORMAT_ONLIVE 0x0089
#define WAVE_FORMAT_SBC24 0x0091
#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092
#define WAVE_FORMAT_ZYXEL_ADPCM 0x0097
#define WAVE_FORMAT_PHILIPS_LPCBB 0x0098
#define WAVE_FORMAT_PACKED 0x0099
#define WAVE_FORMAT_RHETOREX_ADPCM 0x0100
#define WAVE_FORMAT_IRAT 0x0101
#define WAVE_FORMAT_VIVO_G723 0x0111
#define WAVE_FORMAT_VIVO_SIREN 0x0112
#define WAVE_FORMAT_DIGITAL_G723 0x0123
#define WAVE_FORMAT_WMAUDIO2 0x0161
#define WAVE_FORMAT_WMAUDIO3 0x0162
#define WAVE_FORMAT_WMAUDIO_LOSSLESS 0x0163
#define WAVE_FORMAT_CREATIVE_ADPCM 0x0200
#define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202
#define WAVE_FORMAT_CREATIVE_FASTSPEECH10 0x0203
#define WAVE_FORMAT_QUARTERDECK 0x0220
#define WAVE_FORMAT_FM_TOWNS_SND 0x0300
#define WAVE_FORMAT_BTV_DIGITAL 0x0400
#define WAVE_FORMAT_VME_VMPCM 0x0680
#define WAVE_FORMAT_OLIGSM 0x1000
#define WAVE_FORMAT_OLIADPCM 0x1001
#define WAVE_FORMAT_OLICELP 0x1002
#define WAVE_FORMAT_OLISBC 0x1003
#define WAVE_FORMAT_OLIOPR 0x1004
#define WAVE_FORMAT_LH_CODEC 0x1100
#define WAVE_FORMAT_NORRIS 0x1400
#define WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS 0x1500
#define WAVE_FORMAT_DVM 0x2000
#define WAVE_FORMAT_AAC_MS 0xA106

Some of the Codecs are disabled and need to be enabled by compiling FreeRDP using this flag:

-DWITH_DSP_EXPERIMENTAL=ON

How to compile from source:

From github.com/FreeRDP/FreeR…

git clone git://github.com/FreeRDP/FreeRDP.git
cd FreeRDP
ln -s packaging/deb/freerdp-nightly debian
dpkg-buildpackage

 

11:33] <M_akallabeth_[m]> well, a thourough test of all modes would be appreciated (some codecs work better than others)
[11:34] <M_akallabeth_[m]> and, of course, reproducible test cases that are currently not working 😉
[11:34] <M_akallabeth_[m]> then fixing is a lot easier
[11:34] <M_akallabeth_[m]> knowing what to look for
[11:34] <jp_> gladly, where is the list of codecs, and how to force them?
[11:35] <jp_> I notice in my logs that there are many being tried
[11:35] <M_akallabeth_[m]> include/freerdp/codec/audio.h contains the defines
[11:36] <M_akallabeth_[m]> the logs should contain something like server formats
[11:36] <M_akallabeth_[m]> that is a list of supported codecs
[11:36] <jp_> ahhh
[11:36] <M_akallabeth_[m]> using the format: syntax you can force that codec
[11:37] <M_akallabeth_[m]> but only if the server supports it already 😉
[11:38] <jp_> Perfect! I’m excited to try them all.
[11:38] <jp_> I’ll first make a list of what Server 2016 datacenter supports
[11:38] <jp_> from my log
[11:38] <M_akallabeth_[m]> freerdp_dsp_encode is the function converting
[11:38] <jp_> Then match it with include/freerdp/codec/audio.h
[11:39] <M_akallabeth_[m]> some codecs are disabled by default, you´ll need to enable them with -DWITH_DSP_EXPERIMENTAL=ON
[11:39] <M_akallabeth_[m]> (they did not work at all currently)
[11:39] <jp_> OK, I would have to recompile with that flag?
[11:40] <M_akallabeth_[m]> yes, if you want to test any of these codecs
 
Windows 2016 Datacenter supports these codecs by default for Microphone /mic:
WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 
WAVE_FORMAT_PCM: wFormatTag: 0x0001
WAVE_FORMAT_ADPCM: wFormatTag: 0x0002
WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011
WAVE_FORMAT_ALAW: wFormatTag: 0x0006
WAVE_FORMAT_GSM610: wFormatTag: 0x0031

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.