Giter Site home page Giter Site logo

neutrinolabs / pulseaudio-module-xrdp Goto Github PK

View Code? Open in Web Editor NEW
197.0 197.0 39.0 152 KB

xrdp sink / source pulseaudio modules

License: GNU Lesser General Public License v2.1

Makefile 1.83% C 65.42% Shell 25.77% M4 6.98%
pulseaudio pulseaudio-modules sink source xrdp

pulseaudio-module-xrdp's People

Contributors

akarl10 avatar jsorg71 avatar lk2000 avatar matt335672 avatar metalefty avatar miklcct avatar natureshadow avatar peanutbutterandcrackers avatar proski avatar rchan-cjj avatar speidy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pulseaudio-module-xrdp's Issues

Audio has long delay in being sent from server.

Hello, I've followed your guide on Ubuntu 19.04 with Xorg, SLIM and XFCE4. XRDP was installed with this custom compiled pulseaudio module for xrdp.

I'm experiencing large delays in audio when using the Remmina RDP connection to the XRDP server. Upon initial login to the server and starting an audio feed and seeing pavumeter showing the signal levels of xrdp sink are outputting the audio has a 10-13 second audio delay. As the time in the XRDP session increases, the delay becomes longer and longer. If I log out and back in to start a new session the audio delay is back to the initial 10-13 seconds.

Also, if I close a session and reconnect to the preexisting session the audio delays are still there. This leads me to believe the issue is on the server side.

Please let me know how to output any useful debug information. Thanks!

ERROR: Program 'doxygen' not found or not executable

Im accessing a Kali Linux VM over XRDP and I have the problem, that I have no sound/audio.
For that I saw the instructions in this repository and started to follow the steps.

Now I have the following problem:
If I run the "install_pulseaudio_sources_apt_wrapper.sh" as sudo , I get this message:

- Creating kali-rolling build root. Log file in /var/tmp/pa-build-root-debootstrap.log
- Creating schroot config file /etc/schroot/chroot.d/pa-build-root.conf
- Copying /etc/apt/sources.list to the root
- Creating the build directory /build
- Copying the wrapped script to the build directory
- Building PA sources. Log file in /var/tmp/pa-build-root-schroot.log
** schroot failed. Check log file /var/tmp/pa-build-root-schroot.log

The log-file contains following error:

The Meson build system
Version: 1.0.0
Source dir: /build/pulseaudio-16.1+dfsg1
Build dir: /build/pulseaudio-16.1+dfsg1/build
Build type: native build
Program git-version-gen found: YES (/build/pulseaudio-16.1+dfsg1/git-version-gen)
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
Project name: pulseaudio
Project version: 16.1_...
...
...
Configuring doxygen.conf using configuration

doxygen/meson.build:9:0: ERROR: Program 'doxygen' not found or not executable

Do you know how to fix this?

I had to manually modify /etc/xrdp/pulse/default.pa at the end of the installation procedure

I followed the «other distro» installation steps and it went fine. After reopening a session with xrdp, the session was still using the null sink.
I had to modify /etc/xrdp/pulse/default.pa to make it work.

Original content:
.nofail
.fail
load-module module-augment-properties
load-module module-always-sink
.ifexists /var/lib/xrdp-pulseaudio-installer/module-xrdp-sink.so
load-module /var/lib/xrdp-pulseaudio-installer/module-xrdp-sink.so
.endif
.ifexists /var/lib/xrdp-pulseaudio-installer/module-xrdp-source.so
load-module /var/lib/xrdp-pulseaudio-installer/module-xrdp-source.so
.endif
load-module module-native-protocol-unix

Modified content:
.nofail
.fail
load-module module-augment-properties
load-module module-always-sink
.ifexists /usr/lib/pulse-11.1/modules/module-xrdp-sink.so
load-module /usr/lib/pulse-11.1/modules/module-xrdp-sink.so
.endif
.ifexists /usr/lib/pulse-11.1/modules/module-xrdp-source.so
load-module /usr/lib/pulse-11.1/modules/module-xrdp-source.so
.endif
load-module module-native-protocol-unix

There is no "xrdp sink" device for session

OS: CentOS 7.5.1804
xrdp: xrdp-0.9.7.gita9e2dcc+master-1.el7.x86_64
pulseaudio: 10.0
pulseaudio xrdp modules have been built from b88ff01 by instruction from here.

pulseaudio doesn't start when Xrdp session is started, if it started manually required modules are loaded:

pulseaudio -v
...
I: [pulseaudio] source.c: Created source 1 "xrdp-sink.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] source.c:     device.description = "Monitor of xrdp sink"
I: [pulseaudio] source.c:     device.class = "monitor"
I: [pulseaudio] source.c:     device.icon_name = "audio-input-microphone"
E: sink_process_msg: not running
E: close_send:
I: [pulseaudio] module-always-sink.c: A new sink has been discovered. Unloading null-sink.
I: [pulseaudio] module.c: Loaded "module-xrdp-sink" (index: #3; argument: "").
I: [pulseaudio] source.c: Created source 2 "xrdp-source" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] source.c:     device.description = "xrdp source"
I: [pulseaudio] source.c:     device.class = "abstract"
I: [pulseaudio] source.c:     device.icon_name = "audio-input-microphone"
I: [pulseaudio] core.c: default_source: auto_null.monitor -> xrdp-source
I: [pulseaudio] module.c: Loaded "module-xrdp-source" (index: #4; argument: "").
I: [pulseaudio] module.c: Loaded "module-native-protocol-unix" (index: #5; argument: "").
I: [pulseaudio] main.c: Daemon startup complete.
I: [pulseaudio] module.c: Unloading "module-null-sink" (index: #2).

But 'xrdp sink' device doesn't appear in pavucontrol and pulseadio crashes when pavucontrol tying to communicate with it:

I: [pulseaudio] client.c: Created 0 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
I: [pulseaudio] source-output.c: Trying to change sample rate
I: [pulseaudio] remap.c: Using stereo to mono remapping
I: [pulseaudio] source-output.c: Created output 0 "Peak detect" on xrdp-sink.monitor with sample spec float32le 1ch 25Hz and channel map mono
I: [pulseaudio] source-output.c:     media.name = "Peak detect"
I: [pulseaudio] source-output.c:     application.name = "PulseAudio Volume Control"
I: [pulseaudio] source-output.c:     native-protocol.peer = "UNIX socket client"
I: [pulseaudio] source-output.c:     native-protocol.version = "32"
I: [pulseaudio] source-output.c:     application.id = "org.PulseAudio.pavucontrol"
I: [pulseaudio] source-output.c:     application.icon_name = "audio-card"
I: [pulseaudio] source-output.c:     application.version = "3.0"
I: [pulseaudio] source-output.c:     application.process.id = "10335"
I: [pulseaudio] source-output.c:     application.process.user = "centos"
I: [pulseaudio] source-output.c:     application.process.host = "host"
I: [pulseaudio] source-output.c:     application.process.binary = "pavucontrol"
I: [pulseaudio] source-output.c:     application.language = "en_US.UTF-8"
I: [pulseaudio] source-output.c:     window.x11.display = ":10.0"
I: [pulseaudio] source-output.c:     application.process.machine_id = "609bbd29e32a4898e604f49bff82a88c"
I: [pulseaudio] source-output.c:     application.process.session_id = "c2"
I: [pulseaudio] protocol-native.c: Final latency 80,00 ms = 40,00 ms + 40,00 ms
E: 1 block_usec 30000
E: 1 block_usec 30000
I: [pulseaudio] source-output.c: Trying to change sample rate
I: [pulseaudio] remap.c: Using stereo to mono remapping
I: [pulseaudio] source-output.c: Created output 1 "Peak detect" on xrdp-source with sample spec float32le 1ch 25Hz and channel map mono
I: [pulseaudio] source-output.c:     media.name = "Peak detect"
I: [pulseaudio] source-output.c:     application.name = "PulseAudio Volume Control"
I: [pulseaudio] source-output.c:     native-protocol.peer = "UNIX socket client"
I: [pulseaudio] source-output.c:     native-protocol.version = "32"
I: [pulseaudio] source-output.c:     application.id = "org.PulseAudio.pavucontrol"
I: [pulseaudio] source-output.c:     application.icon_name = "audio-card"
I: [pulseaudio] source-output.c:     application.version = "3.0"
I: [pulseaudio] source-output.c:     application.process.id = "10335"
I: [pulseaudio] source-output.c:     application.process.user = "centos"
I: [pulseaudio] source-output.c:     application.process.host = "host"
I: [pulseaudio] source-output.c:     application.process.binary = "pavucontrol"
I: [pulseaudio] source-output.c:     application.language = "en_US.UTF-8"
I: [pulseaudio] source-output.c:     window.x11.display = ":10.0"
I: [pulseaudio] source-output.c:     application.process.machine_id = "609bbd29e32a4898e604f49bff82a88c"
I: [pulseaudio] source-output.c:     application.process.session_id = "c2"
I: [pulseaudio] protocol-native.c: Final latency 41,00 ms = 40,00 ms + 1,00 ms
E: Could not obtain source_socket from environment.

In the trace:

write(2, "I: [pulseaudio] protocol-native."..., 79I: [pulseaudio] protocol-native.c: Final latency 41,00 ms = 40,00 ms + 1,00 ms
) = 79
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
read(3, "WW", 10)                       = 2
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(14, "\1\0\0\0\0\0\0\0", 8)        = 8
write(4, "W", 1)                        = 1
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
read(3, "W", 10)                        = 1
write(14, "\1\0\0\0\0\0\0\0", 8)        = 8
write(14, "\1\0\0\0\0\0\0\0", 8)        = 8
write(4, "W", 1)                        = 1
write(18, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x55d1bab5f1c0, FUTEX_WAIT_PRIVATE, 0, NULLE: Could not obtain source_socket from environment.
 <unfinished ...>
+++ killed by SIGSEGV +++
Segmentation fault

Maintain this module in pulseaudio upstream?

Hi,

recently I packaged pulseaudio-module-xrdp for Kali Linux, see: https://pkg.kali.org/pkg/pulseaudio-module-xrdp.

In the process, I found out that it needs the whole PulseAudio source code to build, as it requires PA internal library. It makes the packaging process slightly awkward, although it's doable. But from a packager point of view, it would be easier if this code was just part of PulseAudio itself.

So I was curious and wanted to ask the question here. Did you consider approaching the PulseAudio maintainers and offer to maintain this module within the PA source tree?

Cheers,

Arnaud

sink_process_msg: not running error during speaker-test

i am using xfreerdp to connect to xrdp on the same computer with pulse sound.

inside xfreerdp session, i run speaker-test, but the noise stutters, it stops for several seconds every tens of seconds.

i can see error message "sink_process_msg: not running" in syslog.

after i set the log-level to debug in /etc/pulse/daemon.conf, i can see what follows with command:
guyuming@gymDesktop:/var/log$ tail -n 5000 syslog|grep 'Free|Created|sink_process_msg: not running'
Jan 20 13:59:50 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 13:59:50 gymDesktop pulseaudio[11432]: Freeing input 152 "ALSA Playback"
Jan 20 13:59:50 gymDesktop pulseaudio[11432]: Created input 153 "ALSA Playback" on xrdp-sink with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 13:59:50 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:00:10 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:00:10 gymDesktop pulseaudio[11432]: Freeing input 153 "ALSA Playback"
Jan 20 14:00:10 gymDesktop pulseaudio[11432]: Created input 154 "ALSA Playback" on xrdp-sink with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:00:10 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:00:30 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:00:30 gymDesktop pulseaudio[11432]: Freeing input 154 "ALSA Playback"
Jan 20 14:00:30 gymDesktop pulseaudio[11432]: Created input 155 "ALSA Playback" on xrdp-sink with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:00:30 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:00:50 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:00:50 gymDesktop pulseaudio[11432]: Freeing input 155 "ALSA Playback"
Jan 20 14:00:50 gymDesktop pulseaudio[11432]: Created input 156 "ALSA Playback" on xrdp-sink with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:00:50 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:01:10 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:01:10 gymDesktop pulseaudio[11432]: Freeing input 156 "ALSA Playback"
Jan 20 14:01:10 gymDesktop pulseaudio[11432]: Created input 157 "ALSA Playback" on xrdp-sink with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:01:10 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:01:30 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:01:30 gymDesktop pulseaudio[11432]: Freeing input 157 "ALSA Playback"
Jan 20 14:01:30 gymDesktop pulseaudio[11432]: Created input 158 "ALSA Playback" on xrdp-sink with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:01:30 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:01:50 gymDesktop pulseaudio[11432]: sink_process_msg: not running
Jan 20 14:01:50 gymDesktop pulseaudio[11432]: Freeing input 158 "ALSA Playback"
Jan 20 14:01:50 gymDesktop pulseaudio[11432]: Created input 159 "ALSA Playback" on xrdp-sink with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:01:50 gymDesktop pulseaudio[11432]: sink_process_msg: not running

and its sound OK if i run speaker-test on the same computer, but on inside a xfreerdp session:
guyuming@gymDesktop:/var/log$ tail -n 500 syslog|grep 'Free|Created|sink_process_msg: not running'
Jan 20 14:06:02 gymDesktop pulseaudio[1470]: Freeing input 48 "ALSA Playback"
Jan 20 14:06:02 gymDesktop pulseaudio[1470]: Created input 49 "ALSA Playback" on alsa_output.pci-0000_00_1b.0.analog-stereo with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:06:13 gymDesktop pulseaudio[1470]: Freeing input 49 "ALSA Playback"
Jan 20 14:06:13 gymDesktop pulseaudio[1470]: Created input 50 "ALSA Playback" on alsa_output.pci-0000_00_1b.0.analog-stereo with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:06:24 gymDesktop pulseaudio[1470]: Freeing input 50 "ALSA Playback"
Jan 20 14:06:24 gymDesktop pulseaudio[1470]: Created input 51 "ALSA Playback" on alsa_output.pci-0000_00_1b.0.analog-stereo with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:06:35 gymDesktop pulseaudio[1470]: Freeing input 51 "ALSA Playback"
Jan 20 14:06:35 gymDesktop pulseaudio[1470]: Created input 52 "ALSA Playback" on alsa_output.pci-0000_00_1b.0.analog-stereo with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:06:46 gymDesktop pulseaudio[1470]: Freeing input 52 "ALSA Playback"
Jan 20 14:06:46 gymDesktop pulseaudio[1470]: Created input 53 "ALSA Playback" on alsa_output.pci-0000_00_1b.0.analog-stereo with sample spec s16le 1ch 48000Hz and channel map mono
Jan 20 14:06:57 gymDesktop pulseaudio[1470]: Freeing input 53 "ALSA Playback"
Jan 20 14:06:57 gymDesktop pulseaudio[1470]: Created input 54 "ALSA Playback" on alsa_output.pci-0000_00_1b.0.analog-stereo with sample spec s16le 1ch 48000Hz and channel map mono

crash: memblock.c: Assertion 'pa_atomic_load(&b->pool->stat.allocated_size)

Just for the record, I got another crash.

Aug  3 17:06:20 icepick pulseaudio[30352]: [(null)] memblock.c: Assertion 'pa_atomic_load(&b->pool->stat.allocated_size) >= (int) b->length' failed at pulsecore/memblock.c:236, function void stat_remove(pa_memblock *)(). Aborting.
pid 30352 (pulseaudio), jid 0, uid 1001: exited on signal 6

1 second latency

I'm trying to get xrdp working on Ubuntu 22.04 LTS VM running on Proxmox with PCI Passthrough of my Nvidia 3090.
I have installed xrdp with the xrdp-installer script (https://c-nergy.be/blog/?p=18725) which I have modified to get acceleration going with my Nvidia card according to this gist: https://gist.github.com/Nexarian/0eb26a3284b21b55b6e1e8653ed88ec9.

Everything works great except I'm getting about 1-second delay on the audio stream. I have tried every tip and trick that I have found, but nothing really helps. The only thing that looks to help sometimes is to fast forward and rewind the video a few times and then all of a sudden I start hearing some audio stutter, and the video and audio are syncing up. After doing that everything works fine both in a browser and if I play a video with say mpv. If I reboot it's all out of sync again :(

Listing all the things I have tried would make this a very long thread, but here are some of them:

  • Tried it on several versions of Ubuntu: 20.04, 22.04 LTS, 22.12, 23.04 (The last two with pipewire patch from here: https://c-nergy.be/blog/?p=18772)
  • Disabling all the modules I can in default.pa
  • tschedule=0, tschedule=1
  • and several other things :(
  • Enabling and disabling MSR

What I have not tried is running it on bare metal as the point of all of this is to have RD to my VMs on proxmox.

I don't know if this is an issue with pulseaudio-module-xrdp, xrdp, but those to modules and the proxmox server are the only thing that has remained unchanged between all the things I have tried.

Really hope someone here can help to get this sorted. It's basically the only thing keeping this from being a "perfect" solution for my needs.

Thank you!

The module crashes pulseaudio in container.

I am running Archlinux in container. Without this module, pulseaudio worked just fine. With this module, pulseaudio exited with message in dmesg:

pulseaudio[14616] trap invalid opcode ip:7fb2b1eb73c4 sp:7ffee7249330 error:0 in module-xrdp-sink.so

Debian 10: no sound, Code 11 - module-xrdp-sink.c: sink_process_msg: not running

I followed the steps on the README on Debian Buster and I see the "xrdp sink" on pulseaudio but hear no sound.

I stopped pulseaudio in systemd, made sure no instances were running and ran pulseaudio -vvvv as a regular user on a terminal. I see this in stdout:

D: [xrdp-sink] module-xrdp-sink.c: Thread starting up
D: [xrdp-sink] module-xrdp-sink.c: sink_process_msg: code 11
E: [xrdp-sink] module-xrdp-sink.c: sink_process_msg: not running
E: [xrdp-sink] module-xrdp-sink.c: close_send:
D: [xrdp-sink] module-xrdp-sink.c: process_render: u->block_usec 30000

How can I troubleshoot this further?

For more info, I added these lines to /etc/pulse/default.pa (the others were already present):

### XRDP modules
.ifexists module-xrdp-sink.so
load-module module-xrdp-sink.so
.endif
.ifexists module-xrdp-source.so
load-module module-xrdp-source.so
.endif

Ubuntu installation script fails under ZFS, but not EXT4

I have a completely fresh (VM) install of xubuntu 21.10 in a completely unmodified configuration. After install, I run apt update, apt upgrade, apt install xrdp, and then proceed to follow the Debian/Ubuntu build instructions.

If the filesystem chosen during install is EXT4, everything works correctly, virtual user sessions have audio, all is well.

If the filesystem chosen during install is ZFS, the process reaches - Building PA Sources. Log file in /var/tmp/pa-build-testuser-schroot.log and then ** schroot failed. Check log file /var/tmp/pa-build-testuser-schroot.log

Here are the content of the log:

E: Failed to change directory '/home/testuser/pulseaudio-module-xrdp': No such file or directory
I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory
E: Failed to change directory '/home/testuser/pulseaudio-module-xrdp': No such file or directory
I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory
E: Failed to change directory '/home/testuser/pulseaudio-module-xrdp': No such file or directory
I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory
E: Failed to change directory '/home/testuser/pulseaudio-module-xrdp': No such file or directory
I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory

The installation is completely unmodified other than choosing ext4 vs zfs in the installer. I am running the installer through the graphical display (not an xrdp session or ssh) in both cases. On the ZFS system many directories are separate mount points (including each individual home directory), I'm not sure if schroot / any other commands used by the script are struggling to traverse mount points.

Fedora 33 Beta No Audio / Sound

Hi,

I compiled the module in two ways:

  1. Followed the CentOS 7.5 and greater
  2. Followed the other distro method by downloading the source tarball for xrdp 13.99.2.

Both methods compile without errors and all the ini files and such appear to be correct but the module fails to load as follows;

Oct 11 12:54:13 localhost.localdomain pulseaudio[1681]: Failed to load module "module-xrdp-source" (argument: ""): initialization failed.
Oct 11 12:54:13 localhost.localdomain pulseaudio[1681]: Invalid sample format specification or channel map
Oct 11 12:54:13 localhost.localdomain pulseaudio[1681]: Failed to load module "module-xrdp-sink" (argument: ""): initialization failed.
Oct 11 12:54:13 localhost.localdomain pulseaudio[1681]: Invalid sample format specification or channel map

TIA for any help.

Pulseaudio server not supported on Ubuntu 22.10

Previously on Ubuntu 22.04 these modules worked. The sound was not perfect (very slow and stuttering) but it was audible. Today I decided to upgrade to a newer Ubuntu version and since then, despite the code built and installed fine, I don't see xrdp sink output device in GNOME Settings. Obviously, neither paplay nor YouTube in Firefox don't produce any sound. Debugging load_pa_modules.sh showed the following malformed behavior.

$> sh -x /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh
+ status=0
+ [ -n 1 -a -n /run/xrdp/sockdir ]
+ [ -z xrdp_chansrv_audio_out_socket_10 -o -z xrdp_chansrv_audio_in_socket_10 ]
+ pactl unload-module module-xrdp-sink
+ pactl unload-module module-xrdp-source
+ pactl load-module module-xrdp-sink xrdp_socket_path=/run/xrdp/sockdir xrdp_pulse_sink_socket=xrdp_chansrv_audio_out_socket_10
Failure: No such entity
+ echo ? Can't load pulseaudio xrdp-sink
? Can't load pulseaudio xrdp-sink
+ status=1
+ pactl load-module module-xrdp-source xrdp_socket_path=/run/xrdp/sockdir xrdp_pulse_source_socket=xrdp_chansrv_audio_in_socket_10
Failure: No such entity
+ echo ? Can't load pulseaudio xrdp-source
? Can't load pulseaudio xrdp-source
+ status=1
+ exit 1

Then I tried to trace pactl (don't know if it makes any sense) but it didn't give me any new clue. I attached the log here. Maybe someone will see anything interesting in it - pactl.log.

What else can I do to track the problem down?

Note: Despite I upgraded Ubuntu (i.e. not installed it from scratch) I purged everything related to pulseaudio and alsa and reinstalled those packages. After that I rebuilt XRDP modules again.
Another note: There are no problems with the sound in non-XRDP (local) setup.

Create packages for Debian/CentOS/Fedora/

Currently only Ubuntu 18.04 Bionic has a package in launchpad. However if you install xrdp, you get a Suggested package xrdp-installer-pulseaudio but has no source available. If I want to get audio through xrdp, I have to build it myself. That is not a acceptable solution for regular users. Users should simply install it from package manager. So please create binaries and publish them to EPEL (Fedora/CentOS) and Debian SID (since it needs to be tested by Debian team before being pushed to stable).

An alternative is to simply release the binaries on the Release page, which is easier than building yourself but has the problem of self-maintenance. There should be auto-updates using CI/CD to the repositories listed above.

Build failed on Ubuntu22.04

Hi, I follow the Wiki to install this module, when I try to build this module with the command ./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src , I got the following error:

configure: WARNING: PULSE_DIR may not be valid - can't find expected file
configure: PULSE_CONFIG_DIR not defined
checking Searching for config.h under PULSE_DIR... find: '~/pulseaudio.src': No such file or directory
no
configure: error: Can't find config.h under PULSE_DIR. Define PULSE_CONFIG_DIR?

The content of 'pulseaudio.src' is as follows:

[~/pulseaudio.src]$ tree -L 2
.
├── build
│   ├── config.h
│   ├── doxygen
│   ├── man
│   ├── meson-info
│   ├── meson-logs
│   ├── meson-private
│   ├── po
│   ├── shell-completion
│   ├── src
│   └── vala
└── src
    ├── daemon
    ├── modules
    ├── pulse
    ├── pulsecore
    ├── tests
    └── utils

17 directories, 1 file

What should I do next?

No sound on Debian Buster.

Just upgraded to Debian Buster. Xrdp sound had previously worked fine with the xrdp-pulseaudio-installer package in Stretch. However that package is no longer available so I followed the instructions here to build manually.

I was able to successfully build the xrdp source and sink libraries. They get loaded and I can connect with the volume control. I did have to modify /etc/pulse/default.pa to get them to load, as /etc/xrdp/pulse/default.pa seems to be getting ignored.

When I start playback of a YouTube video, I get no sound and the following message repeats in syslog as long as audio is playing:

Jul 13 12:42:19 robin pulseaudio[1424]: E: [xrdp-sink] module-xrdp-sink.c: 1 block_usec 30000
Jul 13 12:42:19 robin pulseaudio[1424]: E: [xrdp-sink] module-xrdp-sink.c: 1 block_usec 30000

The volume control (pavucontrol) does show audio coming from Chrome, but the sound never gets to my rdp client.

ETA: It also seems that it takes a long time to connect to the pulseaudio server. The pavucontrol client displays a "trying to connect" message for about 30 seconds before showing the main screen.

wrapped_script: Permission denied -- proposed fix

On my ubuntu 22.04 system, when copying wrapped_script it's getting moved over (sudo cp) and gets file permissions that schroot can't run with as a regular user. I think this could be fixed by changing to chmod a+rx (this worked for me) or switching to cp -a (didn't test, but probably would work).

Error log (/var/tmp/pa-build-$USER-schroot.log):

root.log
Reading package lists...
Building dependency tree...
lsb-release is already the newest version (11.1.0ubuntu4).
sudo is already the newest version (1.9.9-1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/bin/sh: 0: cannot open /wrapped_script: Permission denied

Lines of interest:

sudo cp $WRAPPED_SCRIPT $BUILDROOT/wrapped_script || exit $?
sudo chmod +x $BUILDROOT/wrapped_script || exit $?

Proposed change:

sudo cp $WRAPPED_SCRIPT $BUILDROOT/wrapped_script || exit $?
sudo chmod a+rx $BUILDROOT/wrapped_script || exit $?

sudo chmod +x $BUILDROOT/wrapped_script || exit $?

Building against Pulseaudio 15.0 Meson build system

Pulseaudio 15.0 uses Meson now making it incompatible with the current build.
I am not sure what is involved with making a usable module, but currently even after a Meson configure/build you get back:

module-xrdp-sink.c:26:10: fatal error: config.h: No such file or directory
   26 | #include <config.h>

When attempting to build against Pulse 15.0 source files.

Any current workarounds or planned changes ? This effects all the rolling distros out there.

crash when set channels = 6

https://github.com/neutrinolabs/pulseaudio-module-xrdp/blob/devel/src/module-xrdp-sink.c#L363

pulseaudio has an assertion pa_frame_aligned on function pa_sink_render

https://github.com/pulseaudio/pulseaudio/blob/master/src/pulsecore/sink.c#L1234

it restricts request_bytes must be divisible by channels number * 1, 2, 3 or 4

https://github.com/pulseaudio/pulseaudio/blob/master/src/pulsecore/sample-util.c#L121
https://github.com/pulseaudio/pulseaudio/blob/master/src/pulse/sample.c#L69

on surround sound, u->sink->thread_info.max_request is always greater than 16 * 1024. so request_bytes will be 16384. it can not to be divisible by 6.

Wiki updating?

I found out one cannot pull request Wiki pages on GitHub.

I just went through the PA module setup process on Debian buster and would like to correct some small inconsistencies (paths, use of sudo for some parts and not for others when running as regular user, etc.), update with Debian stable info, and most importantly, a workaround for Debian bug #923203 — no sound on Debian buster with sysvinit (namely, adding autospawn = yes to `~/.config/pulse/client.conf).

How would I go submitting those?

module-config.h is not loaded

These macros are defined in module-config.h, generated by configure script.

#define PACKAGE "pulseaudio-module-xrdp"
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE_NAME "pulseaudio-module-xrdp"
#define PACKAGE_STRING "pulseaudio-module-xrdp 0.1"
#define PACKAGE_TARNAME "pulseaudio-module-xrdp"
#define PACKAGE_URL ""
#define PACKAGE_VERSION "0.1"

However, module sources don't include module-config.h at all and actually, these macros are used. This is bad because pulseaudio upstream's information such as version and contact information is compiled in our modules.

#define PACKAGE "pulseaudio"
#define PACKAGE_BUGREPORT "pulseaudio-discuss (at) lists (dot) freedesktop (dot) org"
#define PACKAGE_NAME "pulseaudio"
#define PACKAGE_STRING "pulseaudio 11.1"
#define PACKAGE_TARNAME "pulseaudio"
#define PACKAGE_URL "http://pulseaudio.org/"
#define PACKAGE_VERSION "11.1"

Adding this to the sources includes our macro definition.

#include "module-config.h"

But compiler warns redifinition of macros. This is natural because they're both defined in pulse's config.h and our module-config.h.

In file included from module-xrdp-source.c:50:
../module-config.h:98:9: warning: 'PACKAGE_VERSION' macro redefined [-Wmacro-redefined]
#define PACKAGE_VERSION "0.1"
        ^
/ssd/tmp/ports/usr/ports/audio/pulseaudio/work/pulseaudio-11.1/config.h:605:9: note: previous definition is here
#define PACKAGE_VERSION "11.1"
        ^

Some how we need to integrate 2 config.h s and I'm working on this. Just for a record.

Still no audio after installing the PulseAudio XRDP Module

I installed xrdp on Debian 11, but I installed xorgxrdp 0.2.9.1 because the Bullseye version seems to have a bug where all I see is a black screen. RDP works, however, I don't hear anything. Looking at the xrdp github, it seems like I need to install the pulseaudio module for xrdp. I followed this guide https://github.com/neutrinolabs/pulseaudio-module-xrdp/wiki/README#install. I rebooted the Debian 11 and under the Settings / Sound, I see "xrdp sink" and I see it pulsating when I play some audio - e.g. youtube videos. But I still don't hear any sound.

I am on Fedora 36 and the clients that I am using are Remmina and Connections.

LICENSE: switch to LGPLv2.1

One of the source files lists APL2 another lists GPL2, others have no identification. Can the license information be clarified for this code?

make : fatal error on config.h

Hi,

I followed your readme for Ubuntu.

I've got the following error whith 'make' command to build xrdp source / sink modules :

azerus@LAPTOP-LSFLO6E4:~/pulseaudio-11.1/pulseaudio-module-xrdp$ make
make  all-recursive
make[1]: Entering directory '/home/azerus/pulseaudio-11.1/pulseaudio-module-xrdp'
Making all in src
make[2]: Entering directory '/home/azerus/pulseaudio-11.1/pulseaudio-module-xrdp/src'
  CC       module_xrdp_sink_la-module-xrdp-sink.lo
module-xrdp-sink.c:26:10: fatal error: config.h: No such file or directory
 #include <config.h>
          ^~~~~~~~~~
compilation terminated.
Makefile:472: recipe for target 'module_xrdp_sink_la-module-xrdp-sink.lo' failed
make[2]: *** [module_xrdp_sink_la-module-xrdp-sink.lo] Error 1
make[2]: Leaving directory '/home/azerus/pulseaudio-11.1/pulseaudio-module-xrdp/src'
Makefile:418: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/azerus/pulseaudio-11.1/pulseaudio-module-xrdp'
Makefile:350: recipe for target 'all' failed
make: *** [all] Error 2

I've tried to use the config_ac.h or config.h from audio pulse, but then I've got an error with #include <pulsecore/core-error.h>

Could you help me ?

Change the repository name

what about pulseaudio-module-xrdp? neutrinolabs/pulseaudio-modules is unique in our scope but not unique in the world.

When distro people create a package of this pulse module, they'll consider the package name.
Different distro might name differently. We should provide a unique name not to cause confusion.

configure script can't find libpulse.pc

I'm following the Ubuntu instructions in README.md and when I get to line 73:

./bootstrap && ./configure PULSE_DIR=/path/to/pulseaudio-11.1

configure throws a bunch of errors about not being able to find libpulse.pc. I added an additional env var to make it work for me:

./bootstrap && ./configure PULSE_DIR=/path/to/pulseaudio-11.1 PKG_CONFIG_PATH=/path/to/pulseaudio-11.1

I was going to PR a change to README.md but it looks like Travis is already building for Ubuntu, which suggests to me that it's something with my setup.

TL;DR: The invocation of configure might need an additional env var to work correctly.

Two other small notes, related to README.md:

  1. If you follow the instructions to the letter, it looks like you're supposed to clone this repo in the directory containing the pulseaudio source code. I assume that's not harmful, though I opted to clone it in a different directory.
  2. I had to read ./configure --help to realize that the value of the PULSE_DIR env var should be the path to the pulseaudio source code, not the bin. That could probably be clarified, though TBH I'm not sure what the wording should be.

Install fails on Raspbian GNU/Linux 11 (bullseye)

Received the follow errors in the pa-build-pi-schroot.log file when executing the install_pulseaudio_sources_apt_wrapper.sh script on Raspbian GNU/Linux 11 (bullseye):

Reading package lists...
Building dependency tree...
E: Unable to locate package sudo
E: Unable to locate package lsb-release
/bin/sh: 1: cannot create /etc/sudoers.d/nopasswd-pi: Directory nonexistent
chmod: cannot access '/etc/sudoers.d/nopasswd-pi': No such file or directory
/wrapped_script: 55: lsb_release: not found
/wrapped_script: 55: lsb_release: not found

Adding the follow code to the beginning of the RunWrappedScript() function allowed apt-get to find the required packages on Raspbian resulting in a successful build:

sudo cp -r /etc/apt/trusted.gpg.d/ $BUILDROOT/etc/apt/trusted.gpg.d/
sudo cp /etc/apt/trusted.gpg $BUILDROOT/etc/apt/
schroot -c pa-build-$USER -u root -- apt-get update

Full code of install_pulseaudio_sources_apt_wrapper.sh for reference:

#!/bin/sh
#
# xrdp: A Remote Desktop Protocol server.
#
# Copyright (C) 2021 Matt Burt, all xrdp contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Wrapper to call install_pulseaudio_sources.sh and tidy up afterwards

# ---------------------------------------------------------------------------
# G L O B A L S
# ---------------------------------------------------------------------------
# Where the output files are going. Must be under $HOME as schroot
# assumes this.
PULSE_DIR=$HOME/pulseaudio.src

# Absolute path to the script we're wrapping. This picks it up from
# the same directory this file is in
WRAPPED_SCRIPT=$(cd $(dirname $0) && pwd)/install_pulseaudio_sources_apt.sh

# The buildroot directory. Choose fast, temporary storage if available
BUILDROOT=/var/lib/pa-build/$USER

# Extra packages to install in the build root which the wrapped script
# may be using. These are packages available by default when using
# GitHub actions
WRAPPED_SCRIPT_DEPS="sudo lsb-release"

# -----------------------------------------------------------------------------
# I N S T A L L   R E Q U I R E D   P A C K A G E S
#
# Installs packages required for the build on the host machine
# -----------------------------------------------------------------------------
InstallRequiredPackages()
{
    set -- \
        /usr/sbin/debootstrap   debootstrap \
        /usr/bin/schroot        schroot \
        /usr/bin/lsb_release    lsb-release

    pkgs=
    while [ $# -ge 2 ]; do
        if [ ! -x $1 ]; then
            pkgs="$pkgs $2"
        fi
        shift 2
    done

    if [ -n "$pkgs" ]; then
        echo "- Need to install packages :$pkgs"
        echo
        echo "  These can be removed when this script completes with:-"
        echo "  sudo apt-get purge$pkgs && apt-get autoremove"
        echo
        sudo apt-get install -y $pkgs
    fi
}

# -----------------------------------------------------------------------------
# R U N   W R A P P E D   S C R I P T
#
# Runs the wrapped build script using schroot
#
# This function definition uses () rather than {} to create an extra
# sub-process where we can run 'set -e' without affecting the parent
# -----------------------------------------------------------------------------
RunWrappedScript()
(
    # In this sub-process, fail on error
    set -e

    # Fix for Raspbian
    sudo cp -r /etc/apt/trusted.gpg.d/ $BUILDROOT/etc/apt/trusted.gpg.d/
    sudo cp -r /etc/apt/trusted.gpg $BUILDROOT/etc/apt/
    schroot -c pa-build-$USER -u root -- apt-get update

    # Install extra dependencies
    schroot -c pa-build-$USER -u root -- \
        apt-get install -y $WRAPPED_SCRIPT_DEPS

    # Allow normal user to sudo without a password
    schroot -c pa-build-$USER -u root -- \
        /bin/sh -c "echo '$USER ALL=(ALL) NOPASSWD:ALL'>/etc/sudoers.d/nopasswd-$USER"
    schroot -c pa-build-$USER -u root -- chmod 400 /etc/sudoers.d/nopasswd-$USER

    # Call the wrapped script
    schroot -c pa-build-$USER -- /wrapped_script -d $PULSE_DIR
)

# -----------------------------------------------------------------------------
# M A I N
# -----------------------------------------------------------------------------

# Start with a few sanity checks
if [ -d $PULSE_DIR ]; then
    echo "** Target directory $PULSE_DIR already exists" >&2
    exit 0
fi

if [ ! -x $WRAPPED_SCRIPT ]; then
    echo "** Can't find wrapped script $WRAPPED_SCRIPT" >&2
    exit 1
fi

if [ -e $BUILDROOT ]; then
    echo "** Remove old build root $BUILDROOT before running this script"
    exit 1
fi

# Do we need extra packages?
InstallRequiredPackages || exit $?

# We should be able to determine the distro now
distro=$(lsb_release -cs) ; # e.g. 'bullseye'
if [ -z "$distro" ]; then
    echo "** Can't determine current distro" >&2
    exit 1
fi

# Create the build root
log=/var/tmp/pa-build-$USER-debootstrap.log
echo "- Creating $distro build root. Log file in $log"
sudo debootstrap $distro $BUILDROOT >$log 2>&1 || {
    echo "** debootstrap failed. Check log file" >&2
    exit 1
}

# Create the config file for schroot
schroot_conf=/etc/schroot/chroot.d/pa-build-$USER.conf
echo "- Creating schroot config file $schroot_conf"
{
    echo "[pa-build-$USER]"
    echo "description=Build PA on current system for $USER"
    echo "directory=$BUILDROOT"
    echo "root-users=$USER"
    echo "users=$USER"
    echo "type=directory"
} | sudo tee $schroot_conf >/dev/null || exit $?

# Copy some files to the build root
for file in /etc/apt/sources.list; do
    echo "- Copying $file to the root"
    sudo cp $file $BUILDROOT/$file || exit $?
done

# Copy the wrapped script to the buildroot root
echo "- Copying the wrapped script to the root"
sudo cp $WRAPPED_SCRIPT $BUILDROOT/wrapped_script || exit $?
sudo chmod +x $BUILDROOT/wrapped_script || exit $?

# Run the wrapped script
log=/var/tmp/pa-build-$USER-schroot.log
echo "- Building PA sources. Log file in $log"
RunWrappedScript >$log 2>&1 || {
    echo "** schroot failed. Check log file" >&2
    exit 1
}

# Done! Remove the schroot config file as its no longer needed
echo "- Removing schroot config file and build root"
sudo rm -rf $schroot_conf $BUILDROOT

echo "- All done. Configure PA xrdp module with PULSE_DIR=$PULSE_DIR"
exit 0

Wrong sampling rate in audio

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?

I need help to troubleshoot this: xrdp with audio in a NixOS container

NixOS has a feature where you can define declarative containers that run using systemd-nspawn.

Right now I am able to run xfce and access it using RDP. The RDP port is exposed on the host and right now I am able to do basically anything but listen to stuff.

The way how it's now working (Nix package and container) the session starts, asks for login and the desktop works fine. The module of this repo appears in audio sources and sinks fine, bars wiggle, almost no problem. Except that my client doesn't play anything, not even garbled noise that happens when sync is not right or something like that, just complete silence.

One hypothesis that I though is that is something about /dev/snd not available then I passed it as a volume and still same problem.

I also though that it for some reason may be a chromium issue and tested with firefox but same problem.

Microphone never leaves zero, even though I configure the client to use that. It may be a config that is not allowed.

The host system is a Desktop ready system but I am only exposing /home to /var/lib/something so it shouldn't cause any interference.

I am testing with Remmina (making sure that Advanced > Audio output mode is set to local) and Microsoft Remote Desktop on an Android phone.

You guys may know a detail I am missing.

image

Audio redirect not automatically starting

Auto starting of the xrdp sink doesn't seem to be working for all users, and I suspect this is due to a combination of restrictive umask issues and missing system-wide configuration. Though it does not auto-start at initiation of an xrdp session, I can successfully get audio redirects working after running pulseaudio --start or pulseaudio -D in a terminal.

My initial suspicion is that the file permissions on /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh and /etc/xdg/autostart/pulseaudio-xrdp.desktop are too restrictive due to the default umask and need to be explicitly placed with 755 on the folders. Otherwise they seemed to be installed fine.

Initial troubleshooting with sudo ls -la /usr/libexec/ output:

-rwxr-xr-x  1 root root  121504 Feb 26 06:11 polkitd
-rwxr-xr-x  1 root root   67968 Mar  5 12:17 power-profiles-daemon
drwxr-x---  2 root root    4096 May 12 23:41 pulseaudio-module-xrdp
-rwxr-xr-x  1 root root   14736 Feb 16 09:20 qmi-proxy
-rwxr-xr-x  1 root root  109024 Feb 17 13:39 rhythmbox-metadata

In an effort to address this, I manually changed the permissions on these:

sudo chmod -R 755 /usr/libexec/pulseaudio-module-xrdp
sudo chmod 755 /etc/xdg/autostart/pulseaudio-xrdp.desktop

I think this might be configurable in https://github.com/neutrinolabs/pulseaudio-module-xrdp/blob/devel/instfiles/Makefile.am? I'm not familiar with makefile.am files, so don't initially know how to set this there.

After manually changing the permissions of these two files, I found that sound over XRDP was automatically starting and working, but only for the user I originally ran the wrapped script from. When logging in with another user, I found I needed to run pulseaudio -D to start up a pulseaudio server. This immediately enabled the redirect to work. I'm not familiar enough with pulseaudio to know what the cause of this may be (yet).

The user configuration files populated (~/.config/pulse/, listed below) seem to be what is missing. Though I don't know what the function is, copying these files from one user to another (and restarting) fixes the issue. Maybe if we could instead replicate this configuration in the system config at /etc/pulse/ it may fix things for all users? At least in an initial skim of this codebase, I'm not sure where this might be configured.

For reference, mainuser is the user the scripts from this repo were run as.

mainuser@server:~$ sudo ls -al /home/otheruser/.config/pulse
total 12
drwx------  2 otheruser users 4096 May 14 21:51 .
drwx------ 11 otheruser users 4096 May 12 23:26 ..
lrwxrwxrwx  1 otheruser users   23 May 14 21:51 bf564f865dce40fba054c86133c1c28c-runtime -> /tmp/pulse-PKdhtXMmr18n
-rw-------  1 otheruser users  256 May 12 23:24 cookie
mainuser@server:~$ sudo ls -al /home/mainuser/.config/pulse
total 36
drwx------  2 mainuser mainuser 4096 May 10 01:19 .
drwx------ 11 mainuser mainuser 4096 May 14 22:11 ..
-rw-------  1 mainuser mainuser  696 May 10 01:19 bf564f865dce40fba054c86133c1c28c-card-database.tdb
-rw-------  1 mainuser mainuser    1 May 12 23:26 bf564f865dce40fba054c86133c1c28c-default-sink
-rw-------  1 mainuser mainuser    1 May 12 23:26 bf564f865dce40fba054c86133c1c28c-default-source
-rw-------  1 mainuser mainuser 8192 May 10 01:19 bf564f865dce40fba054c86133c1c28c-device-volumes.tdb
-rw-------  1 mainuser mainuser  696 May 10 01:19 bf564f865dce40fba054c86133c1c28c-stream-volumes.tdb
-rw-------  1 mainuser mainuser  256 May 10 01:19 cookie

I'm happy to put in a PR if I find a successful implementation. Suggestions are welcome!

Connection failed: connection denied

Hello to everyone.

I've installed the xrdp client on FreeBSD 13 and the server on Debian Bullseye emulated with bhyve on FreeBSD 13 and then I have followed this guide :

https://github.com/neutrinolabs/pulseaudio-module-xrdp

the installation and configuration of the modules went good,I didn't see any error,but at the end I get the error "connection failed" and I'm not able to understand why. I'm not so expert that I can fix the error only by myself. I'm an hobbist. I'm looking for some help from you. Below I've attached the log of the commands that I have issued...

On freebsd I have connected the xrdp client to the server (installed inside debian with this command)

root@marietto:~ # xfreerdp /v:192.168.1.8:3389 /relax-order-checks

[11:38:39:506] [2347:02212500] [INFO][com.freerdp.core] - freerdp_connect:freerdp_set_last_error_ex resetting error state
[11:38:39:507] [2347:02212500] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr
[11:38:39:507] [2347:02212500] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd
[11:38:39:507] [2347:02212500] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr
[11:38:39:507] [2347:02212500] [INFO][com.freerdp.client.x11] - No user name set. - Using login name: root
[11:38:40:841] [2347:02212500] [INFO][com.freerdp.primitives] - primitives autodetect, using optimized
[11:38:40:842] [2347:02212500] [INFO][com.freerdp.core] - freerdp_tcp_is_hostname_resolvable:freerdp_set_last_error_ex resetting error state
[11:38:40:842] [2347:02212500] [INFO][com.freerdp.core] - freerdp_tcp_connect:freerdp_set_last_error_ex resetting error state
[11:38:40:019] [2347:02212500] [WARN][com.freerdp.crypto] - Certificate verification failure 'self signed certificate (18)' at stack position 0
[11:38:40:019] [2347:02212500] [WARN][com.freerdp.crypto] - CN = debian
[11:38:41:094] [2347:02212500] [INFO][com.freerdp.gdi] - Local framebuffer format  PIXEL_FORMAT_BGRX32
[11:38:41:094] [2347:02212500] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_RGB16
[11:38:41:184] [2347:02212500] [INFO][com.winpr.clipboard] - initialized POSIX local file subsystem
[11:38:41:186] [2347:02212500] [INFO][com.freerdp.channels.rdpsnd.client] - [static] Loaded fake backend for rdpsnd

and then,inside debian I did the following :

https://pastebin.ubuntu.com/p/8fTFtq97rr/

but unfortunately it does not work :

Istantanea_2021-08-06_15-20-13

pulse-audio connects to hardware first

I built and installed the module for Kali on arm64. The modules basically work, but there's an issue:
each time I log in via xrdp, at first sound doesn't work, because pulseaudio connects to the device hardware.
After issuing once or twice the commands

pulseaudio -k ; pulseaudio --start

things work just fine. I can't find a good reason for this. Also can't find a forum to ask pulseaudio-module-xrdp specific questions, otherwise I'd have asked there first, before reporting this as an issue.

Dependency "scripts/install_pulseaudio_sources_apt_wrapper.sh", Linux Mint, ubuntu: Jammy

Linux Mint
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu Jammy Jellyfish"

scripts/install_pulseaudio_sources_apt_wrapper.sh result:

`
./install_pulseaudio_sources_apt_wrapper.sh --suite=jammy

  • Creating jammy build root. Log file in /var/tmp/pa-build-jaba-debootstrap.log
  • Creating schroot config file /etc/schroot/chroot.d/pa-build-jaba.conf
  • Copying /etc/apt/sources.list to the root
  • Creating the build directory /build
  • Copying the wrapped script to the build directory
  • Building PA sources. Log file in /var/tmp/pa-build-jaba-schroot.log
    ** schroot failed. Check log file /var/tmp/pa-build-jaba-schroot.log
    `

and schroot log:

`
cat /var/tmp/pa-build-jaba-schroot.log
Reading package lists...
Building dependency tree...
lsb-release is already the newest version (11.1.0ubuntu4).
sudo is already the newest version (1.9.9-1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Building for : Ubuntu-22.04 (jammy)
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:4 http://archive.canonical.com/ubuntu jammy InRelease [11.4 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/multiverse Sources [304 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/restricted Sources [23.7 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/universe Sources [17.8 MB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/main Sources [1340 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Sources [18.2 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/universe Sources [271 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main Sources [425 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Sources [47.6 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-security/main Sources [215 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-security/restricted Sources [45.3 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-security/universe Sources [154 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-security/multiverse Sources [9708 B]
Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main Sources [8216 B]
Get:19 http://archive.ubuntu.com/ubuntu jammy-backports/universe Sources [9552 B]
Fetched 21.1 MB in 4s (4832 kB/s)
Reading package lists...
Reading package lists...
Reading package lists...
Building dependency tree...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
builddeps:essentials : Depends: build-essential but it is not installable
builddeps:pulseaudio : Depends: debhelper-compat (= 12) but it is not installable
Depends: meson but it is not installable
Depends: ninja-build but it is not installable
Depends: check but it is not installable
Depends: desktop-file-utils but it is not installable
Depends: dh-exec but it is not installable
Depends: doxygen but it is not installable
Depends: dpkg-dev (>= 1.17.14) but it is not installable
Depends: intltool but it is not installable
Depends: libapparmor-dev but it is not installable
Depends: libasound2-dev but it is not installable
Depends: libasyncns-dev but it is not installable
Depends: libavahi-client-dev but it is not installable
Depends: libbluetooth-dev but it is not installable
Depends: libsbc-dev but it is not installable
Depends: libcap-dev but it is not installable
Depends: libfftw3-dev but it is not installable
Depends: libglib2.0-dev but it is not installable
Depends: libgstreamer1.0-dev (>= 1.14) but it is not installable
Depends: libgstreamer-plugins-base1.0-dev but it is not installable
Depends: libgtk-3-dev but it is not installable
Depends: libice-dev but it is not installable
Depends: libjack-dev but it is not installable
Depends: liblirc-dev but it is not installable
Depends: libltdl-dev (>= 2.2.6a-2) but it is not installable
Depends: liborc-0.4-dev (>= 1:0.4.11) but it is not installable
Depends: libsamplerate0-dev but it is not installable
Depends: libsndfile1-dev (>= 1.0.20) but it is not installable
Depends: liblircclient-dev but it is not installable
Depends: libsnapd-glib-dev (>= 1.49) but it is not installable
Depends: libsoxr-dev (>= 0.1.1) but it is not installable
Depends: libspeexdsp-dev (>= 1.2~rc1) but it is not installable
Depends: libssl-dev but it is not installable
Depends: libsystemd-dev but it is not installable
Depends: libtdb-dev but it is not installable
Depends: libudev-dev but it is not installable
Depends: libwebrtc-audio-processing-dev (>= 0.2) but it is not installable
Depends: libwrap0-dev but it is not installable
Depends: libx11-xcb-dev but it is not installable
Depends: libxcb1-dev but it is not installable
Depends: libxml2-utils but it is not installable
Depends: libxtst-dev but it is not installable
E: Unable to correct problems, you have held broken packages.
`

But I don't know what is wrong. For example:
builddeps:essentials : Depends: build-essential but it is not installable.
If I tried: sudo apt install build-essential then it will annonce me about already installed. (reinstall package i tried too)

Readme file typo

The readme file has the following line:

module-xrdp-sink.la and module-xrdp-source.so may be installed to the target directory, these files are not necessary and you can remove them safely.

Shouldn't that be module-xrdp-source.la instead of module-xrdp-source.so?

How do you remove a failed installation?

I installed this without problems on an Ubuntu 22.04 machine but when i was installing it on an identical machine I accidentally stoped the scripts/install_pulseaudio_sources_apt_wrapper.sh process while it was running and then when i try to run it again i get:

** Remove old build root /var/lib/pa-build/dev before running this script

trying to delete the failed build with sudo rm -rf /var/lib/pa-build/dev returns:

rm: cannot remove '/var/lib/pa-build/dev/sys': Device or resource busy
rm: cannot remove '/var/lib/pa-build/dev/tmp': Device or resource busy
rm: cannot remove '/var/lib/pa-build/dev/home': Device or resource busy
rm: cannot remove '/var/lib/pa-build/dev/proc': Device or resource busy
rm: cannot remove '/var/lib/pa-build/dev/dev': Device or resource busy

When i try to see what process is using it lsof +D /var/lib/pa-build/dev

It returns:

lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
Output information may be incomplete.

If i umount those fuse mounts then i get nothing by lsof +D /var/lib/pa-build/dev

I tried to kill the process id i get when i run ps -ef | grep /var/lib/pa-build/dev but it never gets terminated even though it returns a process terminated message. Rebooting, removing and purging everything i installed along pulseaudio doesn't seem to solve the issue.

Does anybody have any recommendations on how to get rid of that failed build?

Thanks in advance for any insights you may have.

Can't compile pulseaudio in Ubuntu 20.04

Hi!
I'm trying to compile pulseaudio in Ubuntu 20.04 using this guide https://github.com/neutrinolabs/pulseaudio-module-xrdp/wiki/Build-on-Debian-or-Ubuntu

  • and get "schroot failed. Check log file" from convenience script:
user@user-VirtualBox:/pulseaudio-module-xrdp$ sudo scripts/install_pulseaudio_sources_apt_wrapper.sh 
- Creating focal build root. Log file in /var/tmp/pa-build-root-debootstrap.log
- Creating schroot config file /etc/schroot/chroot.d/pa-build-root.conf
- Copying /etc/apt/sources.list to the root
- Copying the wrapped script to the root
- Building PA sources. Log file in /var/tmp/pa-build-root-schroot.log
** schroot failed. Check log file
user@user-VirtualBox:/pulseaudio-module-xrdp$ cat /var/tmp/pa-build-user-schroot.log
E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
user@user-VirtualBox:/pulseaudio-module-xrdp$ 

please help...

Sink and source not detected

I'm trying to follow the build instructions on Debian Bookworm, apt downloaded PulseAudio-15.0+dfsg1

At first I got the same config.h problem as #58, but by copying the file from PulseAudio-15.0+dfsg1/build/config.h to PulseAudio-15.0+dfsg1/config.h I got it to make.

The rest of the instructions worked as-is, and ls $(pkg-config --variable=modlibexecdir libpulse) showed module-xrdp-sink.la module-xrdp-sink.so module-xrdp-source.la module-xrdp-source.so was present.

Problem is, pavumeter shows it's using "Dummy Output".
I checked with pacmd list-sinks and list-sources and the xrdp sink/source isn't visible.

I get:

1 sink(s) available.
  * index: 0
	name: <auto_null>
1 source(s) available.
  * index: 0
	name: <auto_null.monitor>

Am I missing something to configure?

p.s. I'm using the windows Remote Desktop client

No package 'libpulse' found

Hi

I can't get this setup on my Pi with Raspbian Buster - when get to
./bootstrap && ./configure PULSE_DIR=/home/pi/pulseaudio-12.2
I get lots of output that looks OK followed by
checking for LIBPULSE... no
configure: error: Package requirements (libpulse) were not met:

No package 'libpulse' found

Libpulse is installed, if I run
dpkg -l | grep 'libpulse'
then it shows me
ii libpulse0:armhf 12.2-4+deb10u1 armhf PulseAudio client libraries
ii libpulsedsp:armhf 12.2-4+deb10u1 armhf PulseAudio OSS pre-load library

Any ideas?
Thanks

sound redirect does not work on gentoo

i can connect to xrdp running on gentoo through xfreerdp: neutrinolabs/xrdp#1796

but the sound redirection does not work even though i added /sound:latency:100 parameter in xfreerdp command.

xrdp works with sound redirection on my ubuntu machine, where i need to use pulseaudio -k to restart the pulseaudio service after sign in through xfreerdp. i use "pactl list modules short" to show pulse modules loaded in xrdp session. i can see that before pulseaudio -k, the module-xrdp-sink is not loaded, and it is loaded after pulseaudio -k.

but on my gentoo system, module-xrdp-sink never load.

i use OpenRC instead of systemd on gentoo, and start xrdp by running xrdp-sesman and xrdp with root in console.

i can see module-xrdp-sink.so in results of "ls $(pkg-config --variable=modlibexecdir libpulse)"

what can be wrong and what shall i check?

UPDATE: i can see "module-xrdp-sink.c: Invalid sample format specification or channel map" error

Error on make: Ubuntu 16.04, pulseaudio version 8.0

I am following the install instructions, and when I get to make, it fails with

Making all in src
make[2]: Entering directory '/home/xxxxx/pulseaudio-8.0/pulseaudio-module-xrdp/src'
  CC       module_xrdp_sink_la-module-xrdp-sink.lo
module-xrdp-sink.c:26:20: fatal error: config.h: No such file or directory
compilation terminated.
Makefile:472: recipe for target 'module_xrdp_sink_la-module-xrdp-sink.lo' failed
make[2]: *** [module_xrdp_sink_la-module-xrdp-sink.lo] Error 1
make[2]: Leaving directory '/home/xxxxx/pulseaudio-8.0/pulseaudio-module-xrdp/src'
Makefile:418: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/xxxxx/pulseaudio-8.0/pulseaudio-module-xrdp'
Makefile:350: recipe for target 'all' failed
make: *** [all] Error 2

there is indeed no config.h only config_ac.h config_ac.h.in and config_ac.h-

any clues / help on diagnosing what went wrong?

need version and release

Now the pulse module is provided the separated repository. We suppose distro people provide a package for this module. A version is needed for the package.

Let's make a release after switching to Autotools.

xrdp audio redirection instructions issue

I just got the xrdp audio redirection sink working with the instructions listed here:

https://github.com/neutrinolabs/pulseaudio-module-xrdp/wiki/README

However, following the directions exactly as written did not work. The module that got built following the directions exactly on a fresh centos 7.5 install (after updating all packages) resulted in an audio sink that showed up in the system properties. However, if a bell sound tried to be played from the terminal or testing audio at all, no audio would come through and the entire desktop environment would lock up for about a minute. If multiple bells tried to be sounded from a terminal it would lock up and queue them all it seemed - I got some faint bell sound but after a long delay for each one. So, I removed the .so files from the pulseaudio modules folder.

The instructions should be amended as follows, as this is the procedure that I used to get it to work:

At the step after you clone the repo by default you are on the devel branch, so first checkout master:

git checkout master

Then during the configure stage this will now fail because using only the packages described it did not have the xrdp headers, so:

sudo yum install xrdp-devel

Then the rest of the instructions with running the bootstrap script, configuring, making, and installing worked and resulted in a working audio redirection setup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.