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

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

Open
manutenfruits opened this issue May 31, 2020 · 8 comments

Comments

@manutenfruits
Copy link

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
@veixus
Copy link

veixus commented Jun 11, 2020

Hi, I have stumbled on similar problem myself on Ubuntu 20.04 release. By accident I did a "killall pulseaudio" and something started working. I felt like it was hopeless. Maybe there's a conflict of some sort that someone more experienced could dig into? Perhaps give it a try?

What I did to fix this weird thing to survive a reboot was to "mask" the launches of pulseaudio service and to start it later instead with xdg autostart:

systemctl --user mask pulseaudio.service

contents of ~/.config/autostart/pulseaudio.desktop

[Desktop Entry]
Type=Application
Exec=pulseaudio
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=pulseaudio
Name=pulseaudio
Comment[en_US]=pulseaudio
Comment=pulseaudio

@t0dbld
Copy link

t0dbld commented Jun 18, 2020

Can confirm this works !
Kali Linux
Pulseaudio 13.0
xrdp 0.9.12

@didierjrichard
Copy link

I confirm there's a glitch with Ubuntu 20..04. Worked like a charm on previous 18.04, then after upgrade, no more sound from the speakers. Strangely enough, 'pavucontrol' and the likes showed everything running OK, including the moving bars, yet nothing comes out. There's some sort of conflict between 20.04's version of pulseaudio (13.99.1), associated systemd in --user mode, and the xrdp sink.
Recommendations by veixus did the job, I now get sound back from xrdp applications, thanks !

@kkwpsi
Copy link

kkwpsi commented Sep 24, 2020

I have the same problem on Debian 11 and pulseaudio 13.0. I tried module-sink-xrdp that compiled from source and various versions from net. No luck. Veixus' solution doesn't work for me, because I only run pulseaudio as regular user, not as a service.

@ghost
Copy link

ghost commented Nov 12, 2020

Same symptoms here on Ubuntu 20.10 on pulseaudio 13.99.2.

@Kishi85
Copy link

Kishi85 commented Jun 23, 2021

Hi, I have stumbled on similar problem myself on Ubuntu 20.04 release. By accident I did a "killall pulseaudio" and something started working. I felt like it was hopeless. Maybe there's a conflict of some sort that someone more experienced could dig into? Perhaps give it a try?

What I did to fix this weird thing to survive a reboot was to "mask" the launches of pulseaudio service and to start it later instead with xdg autostart:

systemctl --user mask pulseaudio.service

contents of ~/.config/autostart/pulseaudio.desktop

[Desktop Entry]
Type=Application
Exec=pulseaudio
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=pulseaudio
Name=pulseaudio
Comment[en_US]=pulseaudio
Comment=pulseaudio

I've hit this issue as well now and after some debugging i think i unterstand how this workaround fixes it.

The main problem here is that systemd does not use environment variables from the user session when starting services, which means that the necessary environment variables PULSE_SCRIPT, XRDP_SOCKET_PATH, XRDP_PULSE_SOURCE_SOCKET and XRDP_PULSE_SINK_SOCKET are not passed along to pulseaudio when the session (and therefore the pulseaudio user service) starts up.

@metalefty
Copy link
Member

See also neutrinolabs/xrdp#1910

@matt335672
Copy link
Member

matt335672 commented Oct 4, 2021

Note: Edited 5th October 2021 to improve files

Here's a possible way forward:-

  1. Read Module load and unload support #59 to get some background.

  2. Build the pulseaudio module from my testing branch https://github.com/matt335672/pulseaudio-module-xrdp/tree/module_params

  3. Edit /etc/xrdp/sesman.ini and comment out the PULSE_SCRIPT= line in the [SessionVariables] section.

  4. Create this file in /etc/xdg/autostart/pulseaudio-xrdp.desktop

[Desktop Entry]
Version=1.0
Name=PulseAudio xrdp modules
Comment=Load PulseAudio Modules for xrdp
Exec=/etc/xrdp/load_pa_modules.sh
Terminal=false
Type=Application
Categories=
GenericName=
  1. Create this file in /etc/xrdp/load_pa_modules.sh:-
#!/bin/sh

PACTL=/usr/bin/pactl

if [ -n "$XRDP_SESSION" -a \
     -n "$XRDP_SOCKET_PATH" -a \
     -n "$XRDP_PULSE_SINK_SOCKET" -a \
     -n "$XRDP_PULSE_SOURCE_SOCKET" ]
then
    # Unload modules
    $PACTL unload-module module-xrdp-sink >/dev/null 2>&1
    $PACTL unload-module module-xrdp-source >/dev/null 2>&1

    # Reload modules
    $PACTL load-module module-xrdp-sink \
        xrdp_socket_path=$XRDP_SOCKET_PATH \
        xrdp_pulse_sink_socket=$XRDP_PULSE_SINK_SOCKET && \
    \
    $PACTL load-module module-xrdp-source \
        xrdp_socket_path=$XRDP_SOCKET_PATH \
        xrdp_pulse_source_socket=$XRDP_PULSE_SOURCE_SOCKET
fi

exit $?
  1. Make /etc/xrdp/load_pa_modules.sh executable

Reboot for a proper test. I use paplay /usr/share/sounds/sound-icons/trumpet-12.wav

Works for me on Debian 10 and 11 using XFCE.

Bear in mind you can't log the same user in to an xrdp session and the console on these OSes.

Any feedback welcome.

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

8 participants