pulseaudio-module-xrdp icon indicating copy to clipboard operation
pulseaudio-module-xrdp copied to clipboard

Wrong sampling rate in audio

Open skra72 opened this issue 5 years ago • 2 comments

Hi,

I'm using xRDP on Debian Buster on a Raspberry Pi and installed the pulseaudio-module-xrdp.

Although I can hear sound from the RDP session, the sound is played with a too low sampling rate. So everything sounds like being in slow motion and keeps getting more and more delay to video.

The modules have been build with pulseaudio-12.2 sources as well as respective dev libs. The RDP client is JumpDesktop on macOS and iOS.

Is there any way to control what sampling rate is used when a RDP client connects?

skra72 avatar May 17 '20 22:05 skra72

It turns out that always the default sample rate of the pulse audio daemon is used regardless of what sample rate the client asks for.

I did several tests and even when the Microsoft RDP client is used, the sound pitches up or down when the pulseaudio daemon's default sample rate is decreased or increased from its default 44.1kHz.

I saw in module-xrdp-source.c in pa__init() it seems that for some reason always the default specs are used. Alternatively there is code to hardcode the sample rate to 22kHz, but this code is always disabled.

Any idea why and how the sampling rate of the client can be taken into account?

Thanks!

skra72 avatar May 22 '20 13:05 skra72

I've found somewhat of a workaround. In /etc/pulse/daemon.conf, I've uncommented and changed the following:

default-sample-rate = 22050 alternate-sample-rate = 44100

This allows audio to play correctly in an RDP session and still allows audio to play correctly in a console session (at least in my VirtualBox VM). It would be great to know if there is a better way to do this.

stoli412 avatar Jul 06 '20 09:07 stoli412