You are not logged in.

#1 2023-11-19 16:04:40

aleb
Member
Registered: 2013-10-14
Posts: 17

[SOLVED] Audio broken with i3 and pipewire

Audio is working fine in GNOME, but not in i3.

Seems to be caused by a failing wireplumber.service:

$ systemctl --user status wireplumber        
× wireplumber.service - Multimedia Service Session Manager
     Loaded: loaded (/usr/lib/systemd/user/wireplumber.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sun 2023-11-19 00:14:20 CET; 16h ago
   Duration: 14ms
    Process: 4676 ExecStart=/usr/bin/wireplumber (code=exited, status=70)
   Main PID: 4676 (code=exited, status=70)
        CPU: 14ms

Nov 19 00:14:20 xxx systemd[1346]: wireplumber.service: Scheduled restart job, restart counter is at 5.
Nov 19 00:14:20 xxx systemd[1346]: wireplumber.service: Start request repeated too quickly.
Nov 19 00:14:20 xxx systemd[1346]: wireplumber.service: Failed with result 'exit-code'.
Nov 19 00:14:20 xxx systemd[1346]: Failed to start Multimedia Service Session Manager.

More details from the logs:

$ journalctl -xe | grep wireplumber                              	 
Nov 18 21:35:31 xxx wireplumber[111131]: Failed to connect to session bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
Nov 18 21:35:31 xxx wireplumber[111131]: Error acquiring bus address: Error spawning command line “dbus-launch --autolaunch=3c14ea129513406db9095b4944732d51 --binary-syntax --close-stderr”: Child process exited with code 1
Nov 18 21:35:31 xxx wireplumber[111131]: 0x562deb7da8c0: leaked proxy 0x562deb86f950 id:4
Nov 18 21:35:31 xxx wireplumber[111131]: disconnected from pipewire
Nov 18 21:35:31 xxx systemd[3122]: wireplumber.service: Main process exited, code=exited, status=70/SOFTWARE
Nov 18 21:35:31 xxx systemd[3122]: wireplumber.service: Failed with result 'exit-code'.
Nov 18 21:35:31 xxx systemd[3122]: wireplumber.service: Scheduled restart job, restart counter is at 1.
Nov 18 21:35:31 xxx wireplumber[111144]: Failed to connect to session bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
Nov 18 21:35:31 xxx wireplumber[111144]: Error acquiring bus address: Error spawning command line “dbus-launch --autolaunch=3c14ea129513406db9095b4944732d51 --binary-syntax --close-stderr”: Child process exited with code 1
Nov 18 21:35:31 xxx wireplumber[111144]: 0x563ea81ccf00: leaked proxy 0x563ea8256360 id:4
Nov 18 21:35:31 xxx wireplumber[111144]: disconnected from pipewire
Nov 18 21:35:31 xxx systemd[3122]: wireplumber.service: Main process exited, code=exited, status=70/SOFTWARE
Nov 18 21:35:31 xxx systemd[3122]: wireplumber.service: Failed with result 'exit-code'.

The relevant part seems to be:
> Failed to connect to session bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

If I launch manually a dbus session, for example with dbus-launch and then set the DBUS_SESSION_BUS_ADDRESS env var, I'm able to start wireplumber in the background and then restart firefox and the sound works fine.

Now the question is how to start the d-bus session such that the wireplumber.service knows about it.

If I start the dbus session in ~/.xprofile, the env var is not passed to wireplumber.service and it still fails the same way. Any suggestions?

(I'd give a try to i3-gnome but it seems deserted)

Last edited by aleb (2023-12-07 23:11:00)

Offline

#2 2023-11-19 19:28:51

seth
Member
Registered: 2012-09-03
Posts: 52,591

Re: [SOLVED] Audio broken with i3 and pipewire

ov 18 21:35:31 xxx wireplumber[111144]: Failed to connect to session bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

If I launch manually a dbus session, for example with dbus-launch … If I start the dbus session in ~/.xprofile

abandon all of that, how do you start the session? startx/xinit?
See the last link below.
Do NOT use dbus-launch to work around this.

Offline

#3 2023-11-19 20:01:22

aleb
Member
Registered: 2013-10-14
Posts: 17

Re: [SOLVED] Audio broken with i3 and pipewire

The session is started by gdm, which presents the options in /usr/share/xsessions when logging in, for example:

$ cat /usr/share/xsessions/i3.desktop     
[Desktop Entry]
Name=i3
Comment=improved dynamic tiling window manager
Exec=i3
TryExec=i3
Type=Application
X-LightDM-DesktopName=i3
DesktopNames=i3
Keywords=tiling;wm;windowmanager;window;manager;

With htop I see the following tree: /usr/bin/gdm -> gdm-session-worker -> /usr/lib/gdm-x-session --register-session --run-script i3
..which starts both of:
- /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp ...
- i3

Offline

#4 2023-11-19 20:05:02

seth
Member
Registered: 2012-09-03
Posts: 52,591

Re: [SOLVED] Audio broken with i3 and pipewire

If you don't do anything to mitigate this (notbaly not run dbus-launch anywhere) what are the outputs of

echo $DBUS_SESSION_BUS_ADDRESS
loginctl session-status

Do you have proper behavior with https://wiki.archlinux.org/title/GDM#Use_Xorg_backend ?

Offline

#5 2023-11-20 00:28:58

aleb
Member
Registered: 2013-10-14
Posts: 17

Re: [SOLVED] Audio broken with i3 and pipewire

Without any mitigation, the d-bus session is started:

$ env | grep DBUS      
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-iGDWI0HQ3C,guid=8912134a1581753ede96bd40655a7b1f
$ loginctl session-status       
11 - aleb (1000)
           Since: Sun 2023-11-19 22:16:14 CET; 26s ago
          Leader: 42651 (gdm-session-wor)
            Seat: seat0; vc2
             TTY: tty2
         Service: gdm-password; type x11; class user
           State: active
            Idle: no
            Unit: session-11.scope
                  ├─42651 "gdm-session-worker [pam/gdm-password]"
                  ├─42686 /usr/lib/gdm-x-session --register-session --run-script i3
                  ├─42690 /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtswitch -verbose 3
                  ├─42709 dbus-daemon --print-address 4 --session
                  ├─42717 i3
                  ├─42777 xss-lock --transfer-sleep-lock -- i3lock --nofork
                  ├─42778 nm-applet
                  ├─42779 flameshot
                  ├─42780 i3bar --bar_id=bar-0 --socket=/run/user/1000/i3/ipc-socket.42717
                  ├─42793 /usr/bin/i3status-rs /home/aleb/.config/i3status-rust/config.toml
                  ├─42798 /usr/lib/xdg-desktop-portal
                  ├─42811 /usr/lib/xdg-document-portal
                  ├─42818 /usr/lib/xdg-permission-store
                  ├─42825 fusermount3 -o rw,nosuid,nodev,fsname=portal,auto_unmount,subtype=portal -- /run/user/1000/doc
                  ├─42843 /usr/lib/gvfsd
                  ├─42852 /usr/lib/gvfsd-fuse /run/user/1000/gvfs -f
                  ├─42862 /usr/lib/at-spi-bus-launcher
                  ├─42867 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 10 --address=unix:path=/run/user/1000/at-spi/bus_0
                  ├─42898 /usr/lib/at-spi2-registryd --use-gnome-session
                  ├─42945 /usr/lib/gnome-terminal-server
                  ├─42964 zsh
                  ├─42990 loginctl session-status
                  └─42991 less

Nov 19 22:16:15 xxx /usr/lib/gdm-x-session[42709]: dbus-daemon[42709]: [session uid=1000 pid=42709] Activating service name='org.gtk.vfs.Daemon' requested by ':1.6' (uid=1000 pid=42778 comm="nm-applet")
Nov 19 22:16:15 xxx /usr/lib/gdm-x-session[42709]: dbus-daemon[42709]: [session uid=1000 pid=42709] Successfully activated service 'org.gtk.vfs.Daemon'
Nov 19 22:16:15 xxx /usr/lib/gdm-x-session[42709]: dbus-daemon[42709]: [session uid=1000 pid=42709] Activating service name='org.a11y.Bus' requested by ':1.10' (uid=1000 pid=42778 comm="nm-applet")
Nov 19 22:16:15 xxx /usr/lib/gdm-x-session[42709]: dbus-daemon[42709]: [session uid=1000 pid=42709] Successfully activated service 'org.a11y.Bus'
Nov 19 22:16:15 xxx /usr/lib/gdm-x-session[42867]: dbus-daemon[42867]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1000 pid=42778 comm="nm-applet")
Nov 19 22:16:15 xxx /usr/lib/gdm-x-session[42867]: dbus-daemon[42867]: Successfully activated service 'org.a11y.atspi.Registry'
Nov 19 22:16:15 xxx /usr/lib/gdm-x-session[42898]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Nov 19 22:16:15 xxx nm-applet[42778]: unable to send notifications through org.freedesktop.Notifications: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files
Nov 19 22:16:33 xxx /usr/lib/gdm-x-session[42709]: dbus-daemon[42709]: [session uid=1000 pid=42709] Activating service name='org.gnome.Terminal' requested by ':1.13' (uid=1000 pid=42940 comm="gnome-terminal")
Nov 19 22:16:34 xxx /usr/lib/gdm-x-session[42709]: dbus-daemon[42709]: [session uid=1000 pid=42709] Successfully activated service 'org.gnome.Terminal'

As before, wireplumber.service still fails to find the dbus session, probably because DBUS_SESSION_BUS_ADDRESS is not passed to it.

I dug up a bit and found that gdm-x-session is running the session using the /etc/gdm/Xsession wrapper script:

$ ps aux | grep i3
aleb        3418  0.0  0.0 232320  7632 tty2     Ssl+ Nov19   0:00 /usr/lib/gdm-x-session --register-session --run-script i3
$ /usr/lib/gdm-x-session --help
[...]
  -r, --run-script               	Run program through /etc/gdm/Xsession wrapper script

The wrapper script sources some scripts and then starts i3:

$ cat /etc/gdm/Xsession 
command="$@"
[...]
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"
[...]
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for i in /etc/X11/xinit/xinitrc.d/* ; do
        if [ -x "$i" -a ! -d "$i" ]; then
            . "$i"
        fi
    done
fi
[...]
eval exec $command
[...]

One of the scripts seems to do kind of what I need, but it only imports the DISPLAY and XAUTHORITY variables, not DBUS_SESSION_BUS_ADDRESS:

$ cat /etc/X11/xinit/xinitrc.d/50-systemd-user.sh     
systemctl --user import-environment DISPLAY XAUTHORITY

if command -v dbus-update-activation-environment >/dev/null 2>&1; then
    dbus-update-activation-environment DISPLAY XAUTHORITY
fi

I tried this in $HOME/xprofile and it did make DBUS_SESSION_BUS_ADDRESS available to systemd --user:

$ cat .xprofile 
echo >> ~/are-we-there-yet
date >> ~/are-we-there-yet
echo $PID $0 >> ~/are-we-there-yet
echo $DBUS_SESSION_BUS_ADDRESS >> ~/are-we-there-yet

if [ ! "x$DBUS_SESSION_BUS_ADDRESS" = "x" ]; then
  systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS
fi

Long story short I rebooted and wireguard.service does get a DBUS_SESSION_BUS_ADDRESS, or at least it runs fine.

$ cat are-we-there-yet

Mo 20. Nov 01:04:26 CET 2023
/etc/gdm/Xsession
unix:path=/tmp/dbus-FALPAtObgV,guid=3f5ba6de25c6005370d04711655aa28a

But I have the impression what I did is a hack. According to the logs the wireplumber.service first fails and then it happens to succeed only because the DBUS_SESSION_BUS_ADDRESS becomes available in time:

Nov 20 01:04:26 xxx wireplumber[1469]: Failed to connect to session bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
Nov 20 01:04:26 xxx wireplumber[1469]: Error acquiring bus address: Cannot autolaunch D-Bus without X11 $DISPLAY
Nov 20 01:04:26 xxx wireplumber[1469]: 0x558fdee899c0: leaked proxy 0x558fdef1c130 id:4
Nov 20 01:04:26 xxx wireplumber[1469]: disconnected from pipewire
Nov 20 01:04:26 xxx systemd[1325]: wireplumber.service: Main process exited, code=exited, status=70/SOFTWARE
Nov 20 01:04:26 xxx systemd[1325]: wireplumber.service: Failed with result 'exit-code'.
Nov 20 01:04:26 xxx systemd[1325]: wireplumber.service: Scheduled restart job, restart counter is at 3.
Nov 20 01:04:26 xxx wireplumber[1527]: [0:00:17.281397255] [1527] ERROR IPAModule ipa_module.cpp:172 Symbol ipaModuleInfo not found
Nov 20 01:04:26 xxx wireplumber[1527]: [0:00:17.281406476] [1527] ERROR IPAModule ipa_module.cpp:292 v4l2-compat.so: IPA module has no valid info
Nov 20 01:04:26 xxx wireplumber[1527]: [0:00:17.281421395] [1527]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0
Nov 20 01:04:26 xxx wireplumber[1527]: GetManagedObjects() failed: org.freedesktop.DBus.Error.NameHasNoOwner
Nov 20 01:04:26 xxx wireplumber[1527]: <WpSiAudioAdapter:0x55b9f303c480> Object activation aborted: proxy destroyed
Nov 20 01:04:26 xxx wireplumber[1527]: <WpSiAudioAdapter:0x55b9f303c480> failed to activate item: Object activation aborted: proxy destroyed

How can I make sure that the DBUS_SESSION_BUS_ADDRESS is available before wireplumber.service is started?

Last edited by aleb (2023-11-20 20:04:32)

Offline

#6 2023-11-25 12:03:29

seth
Member
Registered: 2012-09-03
Posts: 52,591

Re: [SOLVED] Audio broken with i3 and pipewire

Sorry for the delay.

But I have the impression what I did is a hack.

Correct.

DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-iGDWI0HQ3C,guid=8912134a1581753ede96bd40655a7b1f

This should not be there. It's presence prevents the DBUS_SESSION_BUS_ADDRESS from being imported/updated (changed!)

The pattern of the socket fits some "dbus-launch" call and wherever that is, you need to get rid of it.

If you login on a console (and not through GDM at all!), what's the value of the variable i that session?

Offline

#7 2023-12-05 23:41:49

aleb
Member
Registered: 2013-10-14
Posts: 17

Re: [SOLVED] Audio broken with i3 and pipewire

seth wrote:

If you login on a console (and not through GDM at all!), what's the value of the variable i that session?

DBUS_SESSION_BUS_ADDRESS is not set when logging in on a console.

I'm giving up on i3. I found out that there are gnome-shell extensions that allow tiling the windows.

Thanks! Maybe this will be useful to others.

Offline

#8 2023-12-06 07:21:14

seth
Member
Registered: 2012-09-03
Posts: 52,591

Re: [SOLVED] Audio broken with i3 and pipewire

This has *nothing* to do w/ i3 but with how you start the session and whereever you're injecting a dbus-launch there, and apparently it happens somewhere with/in GDM

Offline

#9 2023-12-07 21:32:35

aleb
Member
Registered: 2013-10-14
Posts: 17

Re: [SOLVED] Audio broken with i3 and pipewire

Yes, i3 is Millicent bystander. https://youtu.be/HSmrTFJlD2Q?si=brwsX_F9k8a7jzKb&t=164

I managed to solve the issue by removing this symlink:

$ rm /home/aleb/.config/systemd/user/dbus.service

Not sure how this appeared, since "systemctl --user enable dbus.service" does not seem to create it.

Funny thing is: it also affected my GNOME session, not only the i3 one.

Offline

#10 2023-12-07 21:36:35

seth
Member
Registered: 2012-09-03
Posts: 52,591

Re: [SOLVED] Audio broken with i3 and pipewire

The only google hit seems https://github.com/NixOS/nixpkgs/issues/151974 - was the symlink stale for you as well?

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#11 2023-12-07 23:23:01

aleb
Member
Registered: 2013-10-14
Posts: 17

Re: [SOLVED] Audio broken with i3 and pipewire

I have the impression it was a valid link to something like /user/lib/systemd/user/dbus.service IIRC. I removed it without thinking twice. smile

Thanks for all the help!

Offline

Board footer

Powered by FluxBB