Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 823215 - media-video/wireplumber: Appears to fail to start unless dbus[user-session] with systemd profile
Summary: media-video/wireplumber: Appears to fail to start unless dbus[user-session] w...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Niklāvs Koļesņikovs
URL:
Whiteboard:
Keywords:
Depends on: 823647
Blocks:
  Show dependency tree
 
Reported: 2021-11-12 04:12 UTC by Ian Hixson
Modified: 2021-11-16 12:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Hixson 2021-11-12 04:12:25 UTC
media-video/wireplumber failed to start on my systemd gentoo install until I enabled dbus[user-session] which appears to be enabled for both the gnome and plasma desktop systemd profiles, which I am not using.

Reproducible: Always

Steps to Reproduce:
1. emerge media-video/pipewire-0.3.39-r4 on a systemd gentoo install.
2. Enable systemd user sessions as directed for pipewire and wireplumber (pulled in as dep)
3. Note the failing status for wireplumber.
Actual Results:  

Oct 29 01:39:59 themisto systemd[1886]: Started PipeWire Multimedia Service.
Oct 29 01:39:59 themisto systemd[1886]: Started Multimedia Service Session Manager.
Oct 29 01:39:59 themisto pipewire[2458]: spa.dbus: Failed to connect to session bus: Unable to aut>
Oct 29 01:39:59 themisto pipewire[2458]: mod.portal: Failed to connect to session bus: Input/outpu>
Oct 29 01:39:59 themisto wireplumber[2459]: Error acquiring session bus address: Cannot autolaunch>
Oct 29 01:39:59 themisto wireplumber[2459]: invalid unclassed pointer in cast to 'WpTransition'
Oct 29 01:39:59 themisto wireplumber[2459]: wp_transition_return_error: assertion 'WP_IS_TRANSITIO>
Oct 29 01:39:59 themisto wireplumber[2459]: disconnected from pipewire
Oct 29 01:39:59 themisto systemd[1886]: wireplumber.service: Main process exited, code=exited, sta>
Oct 29 01:39:59 themisto systemd[1886]: wireplumber.service: Failed with result 'exit-code'.
Oct 29 01:39:59 themisto systemd[1886]: wireplumber.service: Scheduled restart job, restart counte>
Oct 29 01:39:59 themisto systemd[1886]: Stopped Multimedia Service Session Manager.



Expected Results:  
systemctl --user status wireplumber to show a running success status.

Portage 3.0.20 (python 3.9.7-final-0, default/linux/amd64/17.1/no-multilib/systemd, gcc-11.2.0, glibc-2.33-r1, 5.10.61-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-5.10.61-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i7-6500U_CPU_@_2.50GHz-with-glibc2.33
KiB Mem:    16310624 total,  12196972 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Thu, 28 Oct 2021 08:00:01 +0000
Head commit of repository gentoo: 5ecb5ae9d7817b9fba9a5e2e5450653be25749b4
Timestamp of repository guru: Mon, 08 Nov 2021 13:21:22 +0000
Head commit of repository guru: 86bfe3f6f7ebde193c31a5783f167afd00c15bbd

Head commit of repository kubler: e3547c6a6898ca7308c94e14678c96938dea7751

Timestamp of repository nix-guix: Fri, 05 Nov 2021 19:36:28 +0000
Head commit of repository nix-guix: 97d71cf02bed5d770cc19705b4b63612d801f0aa

Timestamp of repository pentoo: Tue, 09 Nov 2021 00:51:24 +0000
Head commit of repository pentoo: 701b495acfbf94ad642ad6972ec6adeaaa91d0ad

Timestamp of repository ricerlay: Fri, 05 Nov 2021 19:36:28 +0000
Head commit of repository ricerlay: 4e487438ae0086466fb886e5d1596c0f73280ae3

sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.34.0-r3::gentoo
dev-lang/python:          3.9.7_p1::gentoo
dev-lang/rust-bin:        1.53.0::gentoo
dev-util/cmake:           3.20.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.25::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.16.4::gentoo
sys-devel/binutils:       2.37_p1::gentoo
sys-devel/gcc:            11.2.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r1::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

kubler
    location: /var/db/repos/kubler
    sync-type: git
    sync-uri: https://github.com/edannenberg/kubler-overlay.git
    masters: gentoo

local
    location: /var/db/repos/local
    masters: gentoo

nix-guix
    location: /var/db/repos/nix-guix
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/nix-guix.git
    masters: gentoo

pentoo
    location: /var/db/repos/pentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/pentoo.git
    masters: gentoo

ricerlay
    location: /var/db/repos/ricerlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/ricerlay.git
    masters: gentoo

cross-aarch64-unknown-linux-gnu
    location: /var/db/repos/cross-aarch64-unknown-linux-gnu
    masters: gentoo
    priority: 10

cross-arm-none-eabi
    location: /var/db/repos/cross-arm-none-eabi
    masters: gentoo
    priority: 10

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=skylake -mabm -madx -maes -mavx -mavx2 -mbmi -mbmi2 -mclflushopt -mcx16 -mf16c -mfma -mfsgsbase -mfxsr -mlzcnt -mmmx -mmovbe -mpclmul -mpopcnt -mprfchw -mrdrnd -mrdseed -msahf -msgx -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsavec -mxsaveopt -mxsaves --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/apache2-php8.0/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=skylake -mabm -madx -maes -mavx -mavx2 -mbmi -mbmi2 -mclflushopt -mcx16 -mf16c -mfma -mfsgsbase -mfxsr -mlzcnt -mmmx -mmovbe -mpclmul -mpopcnt -mprfchw -mrdrnd -mrdseed -msahf -msgx -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsavec -mxsaveopt -mxsaves --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -O2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=3.6 --keep-going --with-bdeps=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=skylake -mabm -madx -maes -mavx -mavx2 -mbmi -mbmi2 -mclflushopt -mcx16 -mf16c -mfma -mfsgsbase -mfxsr -mlzcnt -mmmx -mmovbe -mpclmul -mpopcnt -mprfchw -mrdrnd -mrdseed -msahf -msgx -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsavec -mxsaveopt -mxsaves --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=skylake -mabm -madx -maes -mavx -mavx2 -mbmi -mbmi2 -mclflushopt -mcx16 -mf16c -mfma -mfsgsbase -mfxsr -mlzcnt -mmmx -mmovbe -mpclmul -mpopcnt -mprfchw -mrdrnd -mrdseed -msahf -msgx -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsavec -mxsaveopt -mxsaves --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4 --load-average=3.6"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus dri dts dvd dvdr egl eglfs emboss encode exif flac gdbm gif gles2 gtk gui iconv icu ipv6 jpeg lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg ncurses networkmanager nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline screencast sdl seccomp spell split-usr ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vaapi vorbis vulkan wayland wxwidgets x264 xattr xcb xinerama xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2019" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_SOFTMMU_TARGETS="aarch64" QEMU_USER_TARGETS="aarch64" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="intel i965 iris" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 1 Niklāvs Koļesņikovs 2021-11-12 14:52:47 UTC
Thank you for you report. I have been wondering about that for a while now (in theoretical capacity - this is the first such report). ;)

My understanding is that dbus[user-session] ensures there's a dbus --session instance associated with every logged on user via hooks inside PAM. This in turn means that one can then start D-Bus user session dependent things without a worry.

People who do not have dbus[user-session] enabled _must_ ensure it is started before they can use software relying on it. This typically means wrapping your graphical environment startup script in dbus-run-session like so:

dbus-run-session startplasma-wayland # untested but seems like it should work

Alternatively Gentoo Wiki suggests using:

if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi

inside a launcher script before running anything D-Bus related.

As such, I think, this is not something for PipeWire/WirePlumber to fix, since it involves both operator error (not reading documentation) and bad integration between lower level OS components.

Package maintainers for dbus and/or systemd may want to consider either replacing dbus[user-session] with dbus[systemd] or at least make dbus[user-session] a dependency of systemd since this is an issue that will affect other user units, too.
Comment 2 Ian Hixson 2021-11-13 00:33:37 UTC
I have the following lines in my .zlogin file:

[[ $(tty) == /dev/tty1 && ! $WAYLAND_DISPLAY ]] && exec dbus-run-session sway

Maybe if dbus[-user-session] then the dbus-launch command should be used instead, I'm not sure.
Comment 3 Niklāvs Koļesņikovs 2021-11-14 13:52:32 UTC
It appears that I may have misunderstood that dbus[user-session] was a mere convenience when it may be a core requirement for at least some systemctl --user use cases. I'm still a bit surprised that even manually launching dbus user session via a wrapper doesn't help, since then I have no knowledge or understanding of how it could possibly be working with OpenRC (which is known to work). Perhaps linking with libsystemd changes the expected D-Bus user session directory from /tmp to /run/user/$UID/bus?

I'll keep this bug open for now but the issue will be resolved in dbus ebuild by renaming user-session to systemd IUSE. Thanks to Mike for digging into this and then filing a PR that involves many important desktop projects.
Comment 4 Ian Hixson 2021-11-15 20:36:13 UTC
(In reply to Niklāvs Koļesņikovs from comment #3)
> It appears that I may have misunderstood that dbus[user-session] was a mere
> convenience when it may be a core requirement for at least some systemctl
> --user use cases. I'm still a bit surprised that even manually launching
> dbus user session via a wrapper doesn't help, since then I have no knowledge
> or understanding of how it could possibly be working with OpenRC (which is
> known to work). Perhaps linking with libsystemd changes the expected D-Bus
> user session directory from /tmp to /run/user/$UID/bus?
> 
> I'll keep this bug open for now but the issue will be resolved in dbus
> ebuild by renaming user-session to systemd IUSE. Thanks to Mike for digging
> into this and then filing a PR that involves many important desktop projects.

Maybe the environment variables from dbus-run-session / dbus-launch are not passed to systemd user sessions?
I don't have a deep understanding of these components, but the man-pages mention some DBUS_XXX variables that get set, I could image these are not passed to the systemd user sessions under some circumstances.
Comment 5 Niklāvs Koļesņikovs 2021-11-16 12:00:24 UTC
Indeed, if systemd --user is started via a hook in PAM, then by the time the user shell is started after successful authorization, systemd --user is already running and its environment will not be changed by what the user then does in their shell.

This does not affect OpenRC since there's no user daemon manager which would be started that early on. Therefore gentoo-pipewire-launcher can be executed in user's shell environment after dbus-run-session and inherit the environment set by it.