Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong sampling rate in audio #43

Open
skra72 opened this issue May 17, 2020 · 2 comments
Open

Wrong sampling rate in audio #43

skra72 opened this issue May 17, 2020 · 2 comments

Comments

@skra72
Copy link

skra72 commented May 17, 2020

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
Copy link
Author

skra72 commented May 22, 2020

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!

@stoli412
Copy link

stoli412 commented Jul 6, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants