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

focal fossa ubuntu not work with xrdp #98

Open
tst32 opened this issue Jun 15, 2023 · 16 comments
Open

focal fossa ubuntu not work with xrdp #98

tst32 opened this issue Jun 15, 2023 · 16 comments

Comments

@tst32
Copy link

tst32 commented Jun 15, 2023

Hello!
after git clone --depth=1 https://github.com/neutrinolabs/pulseaudio-module-xrdp
i built successfully as by wiki.

ls $(pkg-config --variable=modlibexecdir libpulse) | grep xrdp
module-xrdp-sink.la
module-xrdp-sink.so
module-xrdp-source.la
module-xrdp-source.so

dummy output
and no sound in xrdp session
in xrdp.in sound = true
what do have i do?

@matt335672
Copy link
Member

Run the load_pa_modules.sh by hand to see if you're getting any errors.

See also #79 and #82 which might be relevant.

@tst32
Copy link
Author

tst32 commented Jun 16, 2023

Thanks for your prompt response.
it seems to me that my problem is related to #79 and #82 (permissions) too.

./pulseaudio-module-xrdp/instfiles/load_pa_modules.sh 
Failed to initialize module
? Can't load pulseaudio xrdp-sink
Failed to initialize the module
? Can't load pulseaudio xrdp-source

the output is slightly different further

pulseaudio --start do not fix sound problem, but new devices appear

Снимок экрана от 2023-06-16 19-04-05
devices disappear after shell close

then

➜ bash -x ./pulseaudio-module-xrdp/instfiles/pulseaudio-xrdp.desktop
+ '[Desktop' 'Entry]'
./pulseaudio-module-xrdp/instfiles/pulseaudio-xrdp.desktop: line 1: [Desktop: command not found
+ Version=1.0
+ Name=PulseAudio
+ xrdp modules
./pulseaudio-module-xrdp/instfiles/pulseaudio-xrdp.desktop: line 3: xrdp: command not found
+ Comment=Load
Comment=Load + PulseAudio Modules for xrdp
./pulseaudio-module-xrdp/instfiles/pulseaudio-xrdp.desktop: line 4: PulseAudio: command not found
+ Exec=/usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh
+ Terminal=false
+ Type=Application
+ Categories=
+ GenericName=

then ps -ef | grep '.*pulseaudio'

userme           3150    3140  2 19:25 ?        00:00:22 /usr/bin/pulseaudio --daemonize=no --log-target=journal
userme          15176    6428  0 19:41 pts/0    00:00:00 grep --color=auto .*pulseaudio

the same as #82 for paplay

strace paplay /usr/share/sounds/gnome/default/alerts/glass.ogg 2>&1 | grep 'open.*= [1-9]'

openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libpulse.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-13.99.so", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libsndfile.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libFLAC.so.8", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libogg.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libvorbis.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libvorbisenc.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/share/locale-langpack/ru/LC_MESSAGES/pulseaudio.mo", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/share/sounds/gnome/default/alerts/glass.ogg", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/pulse/client.conf", O_RDONLY|O_CLOEXEC) = 7
openat(AT_FDCWD, "/etc/pulse/client.conf.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 8
openat(AT_FDCWD, "/usr/share/locale-langpack/ru/LC_MESSAGES/libc.mo", O_RDONLY) = 8
openat(AT_FDCWD, "/run/user/1000/pulse", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = 8
openat(AT_FDCWD, "/home/userme/.config/pulse/cookie", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 9

do i need to purge pulseaudio-xrdp and then reinstall after repo clone/build with
sudo make install MKDIR_P="mkdir -p -m 0755" INSTALL_SCRIPT="/usr/bin/install -m 0755" ?
or something else?

@matt335672
Copy link
Member

Try running bash -x /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh rather than bash -x ./pulseaudio-module-xrdp/instfiles/pulseaudio-xrdp.desktop. As you've already seen, the second one of these isn't a script.

Also, what do you get for:-

ls -l $(pkg-config --variable=modlibexecdir libpulse) | grep xrdp

@tst32
Copy link
Author

tst32 commented Jun 18, 2023

ls -l $(pkg-config --variable=modlibexecdir libpulse) | grep xrdp

-rwxr-xr-x 1 root root    984 Jun 15 22:54 module-xrdp-sink.la
-rwxr-xr-x 1 root root 105216 Jun 15 22:54 module-xrdp-sink.so
-rwxr-xr-x 1 root root    996 Jun 15 22:54 module-xrdp-source.la
-rwxr-xr-x 1 root root  93672 Jun 15 22:54 module-xrdp-source.so

bash -x /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh # fails

+ 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: Module initialization failed
+ 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: Module initialization failed
+ echo '? Can'\''t load pulseaudio xrdp-source'
? Can't load pulseaudio xrdp-source
+ status=1
+ exit 1

@matt335672
Copy link
Member

That's useful - it doesn't look like a permissions problem.

In one terminal, can you type the following to get a log from the pulseaudio daemon:-

pacmd set-log-level 3
pacmd set-log-target newfile:/tmp/pa.log
tail -f /tmp/pa.log

Then in another terminal, run /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh and see what we get in the log.

@tst32
Copy link
Author

tst32 commented Jun 19, 2023

tail -f /tmp/pa.log

I: [pulseaudio] client.c: Freed 22 "UNIX socket client"
I: [pulseaudio] client.c: Created 23 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
I: [pulseaudio] client.c: Freed 23 "pactl"
I: [pulseaudio] protocol-native.c: Connection died.
I: [pulseaudio] client.c: Created 24 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
I: [pulseaudio] client.c: Freed 24 "pactl"
I: [pulseaudio] protocol-native.c: Connection died.
I: [pulseaudio] client.c: Created 25 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
W: [pulseaudio] module-xrdp-sink.c: Runtime version '13.99.0' differs from build version '11.1.0'
E: [pulseaudio] module-xrdp-sink.c: Invalid sample format specification or channel map
E: [pulseaudio] module.c: Failed to load module "module-xrdp-sink" (argument: "xrdp_socket_path=/run/xrdp/sockdir xrdp_pulse_sink_socket=xrdp_chansrv_audio_out_socket_10"): initialization failed.
I: [pulseaudio] client.c: Freed 25 "pactl"
I: [pulseaudio] protocol-native.c: Connection died.
I: [pulseaudio] client.c: Created 26 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
W: [pulseaudio] module-xrdp-source.c: Runtime version '13.99.0' differs from build version '11.1.0'
E: [pulseaudio] module-xrdp-source.c: Invalid sample format specification or channel map
E: [pulseaudio] module.c: Failed to load module "module-xrdp-source" (argument: "xrdp_socket_path=/run/xrdp/sockdir xrdp_pulse_source_socket=xrdp_chansrv_audio_in_socket_10"): initialization failed.
I: [pulseaudio] client.c: Freed 26 "pactl"
I: [pulseaudio] protocol-native.c: Connection died.

What could it mean, versions diffs?
some info about my sound, too
aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

@matt335672
Copy link
Member

It looks like you've built the module on a different Ubuntu version, or against the wrong pulseaudio sources.

How did you build it exactly?

@tst32
Copy link
Author

tst32 commented Jun 20, 2023

git clone --dept=1 https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
then followed readme. a few days ago.
I don't know about the parallel installed version. Is there anything i can learn more about it, or is there some way to remove it?

@matt335672
Copy link
Member

The readme points to the wiki here:-

https://github.com/neutrinolabs/pulseaudio-module-xrdp/wiki/Build-on-Debian-or-Ubuntu

Did you use scripts/install_pulseaudio_sources_apt_wrapper.sh ?

If not, try using that.

@tst32
Copy link
Author

tst32 commented Jun 20, 2023

Yes,after delete do scripts/install_pulseaudio_sources_apt_wrapper.sh
rm -rf /home/userme/pulseaudio /home/userme/pulseaudio.src/ /home/userme/pulseaudio-module-xrdp ;
got

** Current distro 'focal' does not appear to be supported by debootstrap
   Need --suite switch?

--suite=focal
** Unsupported suite 'focal'
lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal

@tst32
Copy link
Author

tst32 commented Jun 20, 2023

is it good idea to do-release-upgrade?

@matt335672
Copy link
Member

I've just had a look at this on my machine running 'jammy', and I'm getting the same:-

 scripts/install_pulseaudio_sources_apt_wrapper.sh 
** Current distro 'jammy' does not appear to be supported by debootstrap
   Need --suite switch?

I've traced it back to a change in the debootstrap command, and the way it handles getting information about available distros.

I've attached a patch file patch.txt. Can you download it as /tmp/patch.txt and enter this command from within the pulseaudio-module-xrdp directory:-

patch -p1 </tmp/patch.txt

You should get the message patching file scripts/install_pulseaudio_sources_apt_wrapper.sh. Then try running the script again.

patch.txt

@tst32
Copy link
Author

tst32 commented Jun 21, 2023

thanks for your efforts, i have patched install script after all new git clone
git clone -b devel https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
complete cd ~/pulseaudio-module-xrdp/scripts ./install_pulseaudio_sources_apt_wrapper.sh --suite=focal
🎉

  • Creating focal build root. Log file in /var/tmp/pa-build-y-debootstrap.log
    [sudo] password for userme:
  • Creating schroot config file /etc/schroot/chroot.d/pa-build-y.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-y-schroot.log
  • Copying sources out of the build root
  • Removing schroot config file and build root
  • All done. Configure PA xrdp module with PULSE_DIR=/home/userme/pulseaudio.src

sound not works as before

pacmd set-log-target newfile:/tmp/pa.log
~/pulseaudio-module-xrdp :: git(devel)                                                                                           
➜ tail -f /tmp/pa.log
I: [pulseaudio] client.c: Freed 33 "UNIX socket client"
I: [pulseaudio] client.c: Created 34 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
I: [pulseaudio] client.c: Freed 34 "pactl"
I: [pulseaudio] protocol-native.c: Connection died.
I: [pulseaudio] client.c: Created 35 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
I: [pulseaudio] client.c: Freed 35 "pactl"
I: [pulseaudio] protocol-native.c: Connection died.
I: [pulseaudio] client.c: Created 36 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
W: [pulseaudio] module-xrdp-sink.c: Runtime version '13.99.0' differs from build version '11.1.0'
E: [pulseaudio] module-xrdp-sink.c: Invalid sample format specification or channel map
E: [pulseaudio] module.c: Failed to load module "module-xrdp-sink" (argument: "xrdp_socket_path=/run/xrdp/sockdir xrdp_pulse_sink_socket=xrdp_chansrv_audio_out_socket_10"): initialization failed.
I: [pulseaudio] client.c: Freed 36 "pactl"
I: [pulseaudio] protocol-native.c: Connection died.
I: [pulseaudio] client.c: Created 37 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Got credentials: uid=1000 gid=1000 success=1
W: [pulseaudio] module-xrdp-source.c: Runtime version '13.99.0' differs from build version '11.1.0'
E: [pulseaudio] module-xrdp-source.c: Invalid sample format specification or channel map
E: [pulseaudio] module.c: Failed to load module "module-xrdp-source" (argument: "xrdp_socket_path=/run/xrdp/sockdir xrdp_pulse_source_socket=xrdp_chansrv_audio_in_socket_10"): initialization failed.
I: [pulseaudio] client.c: Freed 37 "pactl"
I: [pulseaudio] protocol-native.c: Connection died.

and concerning module-xrdp-sink.c: Runtime version '13.99.0' differs from build version '11.1.0' in a log file /var/tmp/pa-build-y-schroot.log i remarked

<snip of long text before>
NOTICE: 'pulseaudio' packaging is maintained in the 'Git' version control system at:
https://git.launchpad.net/~ubuntu-audio-dev/pulseaudio
Please use:
git clone https://git.launchpad.net/~ubuntu-audio-dev/pulseaudio
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 1769 kB of source archives.
Get:1 http://security.ubuntu.com/ubuntu bionic-security/main pulseaudio 1:11.1-1ubuntu7.11 (dsc) [3707 B]
Get:2 http://security.ubuntu.com/ubuntu bionic-security/main pulseaudio 1:11.1-1ubuntu7.11 (tar) [1649 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security/main pulseaudio 1:11.1-1ubuntu7.11 (diff) [116 kB]
dpkg-source: info: extracting pulseaudio in pulseaudio-11.1
dpkg-source: info: unpacking pulseaudio_11.1.orig.tar.xz
dpkg-source: info: unpacking pulseaudio_11.1-1ubuntu7.11.debian.tar.xz
<snip of long text after>

my actual focal ubuntu was upgraded from bionic, and i think that old pulseaudio is error cause. i'm a bit frustrated, do i need to remove pulseaudio completeley, then reinstall to v13.99 ?

@matt335672
Copy link
Member

There shouldn't be any of the old pulseaudio left.

Remove the pulseaudio modules completely with:-

MODDIR=$(pkg-config --variable=modlibexecdir libpulse)
ls -l $MODDIR/module-xrdp-*
sudo rm $MODDIR/module-xrdp-*
ls -l $MODDIR/module-xrdp-*

Then redo the sudo make install, check the modules are back and try again.

@MrZajic
Copy link

MrZajic commented Sep 6, 2023

I have the same problem. Stucked on /usr/libexec/pulseaudio-module-xrdp$ ./load_pa_modules.sh:

./pulseaudio-module-xrdp/instfiles/load_pa_modules.sh 
Failed to initialize module
? Can't load pulseaudio xrdp-sink
Failed to initialize the module
? Can't load pulseaudio xrdp-source

Linux Mint distro ubutnu:
/etc/upstream-release/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu Jammy Jellyfish"

The step #98 (comment) I did too. But result is the same.

ls -l $MODDIR/module-xrdp-*
-rwxr-xr-x 1 root root   996 zář  6 20:42 /usr/lib/pulse-15.99.1+dfsg1/modules/module-xrdp-sink.la
-rwxr-xr-x 1 root root 94616 zář  6 20:42 /usr/lib/pulse-15.99.1+dfsg1/modules/module-xrdp-sink.so
-rwxr-xr-x 1 root root  1008 zář  6 20:42 /usr/lib/pulse-15.99.1+dfsg1/modules/module-xrdp-source.la
-rwxr-xr-x 1 root root 82168 zář  6 20:42 /usr/lib/pulse-15.99.1+dfsg1/modules/module-xrdp-source.so
pactl load-module module-
module-allow-passthrough         module-card-restore              module-echo-cancel               module-native-protocol-tcp       module-role-cork                 module-suspend-on-idle           module-virtual-surround-sink
module-alsa-card                 module-cli                       module-filter-apply              module-native-protocol-unix      module-role-ducking              module-switch-on-connect         module-volume-restore
module-alsa-sink                 module-cli-protocol-tcp          module-filter-heuristics         module-null-sink                 module-rtp-recv                  module-switch-on-port-available  module-xrdp-sink
module-alsa-source               module-cli-protocol-unix         module-http-protocol-tcp         module-null-source               module-rtp-send                  module-systemd-login             module-xrdp-source
module-always-sink               module-combine                   module-http-protocol-unix        module-oss                       module-rygel-media-server        module-tunnel-sink               module-x11-bell
module-always-source             module-combine-sink              module-intended-roles            module-pipe-sink                 module-simple-protocol-tcp       module-tunnel-sink-new           module-x11-cork-request
module-augment-properties        module-dbus-protocol             module-ladspa-sink               module-pipe-source               module-simple-protocol-unix      module-tunnel-source             module-x11-publish
module-bluetooth-discover        module-default-device-restore    module-loopback                  module-position-event-sounds     module-sine                      module-tunnel-source-new         module-x11-xsmp
module-bluetooth-policy          module-detect                    module-match                     module-remap-sink                module-sine-source               module-udev-detect               
module-bluez5-device             module-device-manager            module-mmkbd-evdev               module-remap-source              module-snap-policy               module-virtual-sink              
module-bluez5-discover           module-device-restore            module-native-protocol-fd        module-rescue-streams            module-stream-restore            module-virtual-source  
pactl load-module module-xrdp-sink
Failure: No such entity.

@matt335672
Copy link
Member

@MrZajic - try the steps above in this post to see what errors are in the pulseaudio log.

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

3 participants