You are not logged in.

#1 2024-04-14 13:08:38

BEST8OY
Member
Registered: 2024-04-14
Posts: 11

[SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

Hello
As the title says when I run those two from service(systemd) or xinitrc, playerctl -l shows no output (which I expect to be mpd)

But when I run an instance of those two in terminal they work as expected and playerctl -l also shows mpd in its output.

Has anyone faced such an issue?

Last edited by BEST8OY (2024-04-14 17:47:35)

Offline

#2 2024-04-14 15:19:01

seth
Member
Registered: 2012-09-03
Posts: 51,767

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

Please post your xinitrc and the output of

loginctl session-status

As for the systemd service: session or user? And did you confirm the service status?

Online

#3 2024-04-14 15:40:09

BEST8OY
Member
Registered: 2024-04-14
Posts: 11

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

seth wrote:

Please post your xinitrc and the output of

loginctl session-status

As for the systemd service: session or user? And did you confirm the service status?

For systemd I enabled the service (--user) rebooted and also tested with not enabling service and just starting them at my current session and yes checked their status and they were enabled and running without any error.

And This is the output for having mpDris2 ran from xinitrc

4 - best8oy (1000)
  Since: Sun 2024-04-14 19:00:42 +0330; 1min 21s ago
  State: active
 Leader: 79341 (login)
   Seat: seat0; vc1
    TTY: tty1
 Remote: no
Service: login
   Type: tty
  Class: user
   Idle: yes since Sun 2024-04-14 18:02:22 +0330 (59min ago)
   Unit: session-4.scope
         ├─79341 "login -- best8oy"
         ├─79367 /bin/sh /usr/bin/startx /home/best8oy/.config/x11/xinitrc
         ├─79372 /usr/bin/dbus-daemon --syslog --fork --print-pid 4 --print-address 6 --session
         ├─79404 xinit /home/best8oy/.config/x11/xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.hsMxcPyhne
         ├─79405 /usr/lib/Xorg -nolisten tcp :0 vt1 -keeptty -auth /tmp/serverauth.hsMxcPyhne
         ├─79417 /bin/sh /home/best8oy/.config/x11/xinitrc
         ├─79424 /bin/sh /home/best8oy/.config/x11/xinitrc
         ├─79425 /bin/sh /home/best8oy/.config/x11/xinitrc
         ├─79429 /bin/sh /home/best8oy/.config/x11/xinitrc
         ├─79434 /bin/sh /home/best8oy/.config/x11/xinitrc
         ├─79435 /bin/sh /home/best8oy/.config/x11/xinitrc
         ├─79443 goldendict
         ├─79444 dwm
         ├─79445 unclutter
         ├─79446 python3 /usr/bin/mpDris2
         ├─79448 picom
         ├─79453 /bin/bash /home/best8oy/.local/bin/remapd
         ├─79454 /usr/bin/dbus-daemon --syslog --fork --print-pid 4 --print-address 6 --session
         ├─79460 ssh-agent dwm
         ├─79467 xcape -e Super_L Escape
         ├─79479 dwmblocks
         ├─79488 udevadm monitor -u -t seat -s input -s usb
         ├─79489 grep -qP -m1 "[^un]bind.+\\/[^:]+\\(usb\\)" /dev/fd/63
         ├─79492 mpd
         ├─79497 /usr/lib/xdg-desktop-portal
         ├─79508 /usr/lib/xdg-document-portal
         ├─79515 /usr/lib/xdg-permission-store
         ├─79525 fusermount3 -o rw,nosuid,nodev,fsname=portal,auto_unmount,subtype=portal -- /run/user/1000/doc
         ├─79553 /bin/sh /home/best8oy/.local/bin/statusbar/sb-music
         ├─79560 /bin/sh /home/best8oy/.local/bin/statusbar/sb-mpdup
         ├─79563 dunst
         ├─79576 "/usr/lib/qt6/QtWebEngineProcess --type=zygote --no-zygote-sandbox --application-name=GoldenDict-ng --webengine-schemes=gdlookup:hlLF;gdau:hlLF;gico:hlLF;qrcx:hlLF;bres:hlLF;bword:hlLF;gdprg:hlLF;gdvideo:hlLF;gdtts:hlLF;ifr:hlLF;entry:hlLF;qrc:sV --lang=en"
         ├─79577 "/usr/lib/qt6/QtWebEngineProcess --type=zygote --application-name=GoldenDict-ng --webengine-schemes=gdlookup:hlLF;gdau:hlLF;gico:hlLF;qrcx:hlLF;bres:hlLF;bword:hlLF;gdprg:hlLF;gdvideo:hlLF;gdtts:hlLF;ifr:hlLF;entry:hlLF;qrc:sV --lang=en"
         ├─79579 "/usr/lib/qt6/QtWebEngineProcess --type=zygote --application-name=GoldenDict-ng --webengine-schemes=gdlookup:hlLF;gdau:hlLF;gico:hlLF;qrcx:hlLF;bres:hlLF;bword:hlLF;gdprg:hlLF;gdvideo:hlLF;gdtts:hlLF;ifr:hlLF;entry:hlLF;qrc:sV --lang=en"
         ├─79623 "/usr/lib/qt6/QtWebEngineProcess --type=renderer --webengine-schemes=gdlookup:hlLF;gdau:hlLF;gico:hlLF;qrcx:hlLF;bres:hlLF;bword:hlLF;gdprg:hlLF;gdvideo:hlLF;gdtts:hlLF;ifr:hlLF;entry:hlLF;qrc:sV --first-renderer-process --disable-speech-api --disable-databases --disable-blink-features=EyeDropperAPI --lang=en --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=3 --time-ticks-at-unix-epoch=-1713105095069329 --launch-time-ticks=3549631919 --shared-files=v8_context_snapshot_data:100"
         ├─79633 "/usr/lib/qt6/QtWebEngineProcess --type=renderer --webengine-schemes=gdlookup:hlLF;gdau:hlLF;gico:hlLF;qrcx:hlLF;bres:hlLF;bword:hlLF;gdprg:hlLF;gdvideo:hlLF;gdtts:hlLF;ifr:hlLF;entry:hlLF;qrc:sV --disable-speech-api --disable-databases --disable-blink-features=EyeDropperAPI --lang=en --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1713105095069329 --launch-time-ticks=3549662662 --shared-files=v8_context_snapshot_data:100"
         ├─80040 /usr/lib/xdg-desktop-portal
         ├─80058 /usr/lib/xdg-permission-store
         ├─80081 /usr/bin/dunst
         ├─80162 /usr/lib/at-spi-bus-launcher
         ├─80745 st -e ncmpcpp
         ├─80748 ncmpcpp
         ├─81262 mpc idle
         ├─82340 st -e lfub
         ├─82341 /bin/sh /home/best8oy/.local/bin/lfub
         ├─82347 ueberzugpp layer --silent --no-stdin --use-escape-codes --pid-file /tmp/.3e2a8d45-3a4e-43b9-89e3-7434e47285fc
         ├─82352 lf
         ├─82359 lf -server
         ├─82424 /bin/zsh
         ├─82614 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 11 --address=unix:path=/run/user/1000/at-spi/bus_0
         ├─82619 /opt/sublime_text/crash_handler --no-rate-limit "--database=/home/best8oy/.cache/sublime-text/Crash Reports" "--metrics-dir=/home/best8oy/.cache/sublime-text/Crash Reports" --url=https://crash-server.sublimehq.com/api/upload --annotation=hash=7404830205192778547 --annotation=ident=sublime_text_4169 --initial-client-fd=16 --shared-client-connection
         ├─82627 /usr/lib/at-spi2-registryd --use-gnome-session
         ├─82644 /opt/sublime_text/plugin_host-3.3 82612 /opt/sublime_text/sublime_text 15:82619 /home/best8oy/.config/sublime-text /home/best8oy/.cache/sublime-text /opt/sublime_text/Packages
         ├─82647 /opt/sublime_text/plugin_host-3.8 82612 /opt/sublime_text/sublime_text 15:82619 /home/best8oy/.config/sublime-text /home/best8oy/.cache/sublime-text /opt/sublime_text/Packages
         └─82987 loginctl session-status

Apr 14 19:00:53 DIAMOND org.freedesktop.portal.Documents[80052]: error: fuse init failed: Can't mount path /run/user/1000/doc
Apr 14 19:00:53 DIAMOND xdg-desktop-por[80040]: No skeleton to export
Apr 14 19:00:53 DIAMOND dbus-daemon[79454]: [session uid=1000 pid=79450] Successfully activated service 'org.freedesktop.portal.Desktop'
Apr 14 19:00:53 DIAMOND dbus-daemon[79454]: [session uid=1000 pid=79450] Activating service name='org.freedesktop.Notifications' requested by ':1.13' (uid=1000 pid=79988 comm="/opt/microsoft/msedge/msedge")
Apr 14 19:00:53 DIAMOND dbus-daemon[79454]: [session uid=1000 pid=79450] Successfully activated service 'org.freedesktop.Notifications'
Apr 14 19:00:53 DIAMOND dbus-daemon[79454]: [session uid=1000 pid=79450] Activating service name='org.a11y.Bus' requested by ':1.15' (uid=1000 pid=79988 comm="/opt/microsoft/msedge/msedge")
Apr 14 19:00:53 DIAMOND dbus-daemon[79454]: [session uid=1000 pid=79450] Successfully activated service 'org.a11y.Bus'
Apr 14 19:01:47 DIAMOND org.a11y.Bus[82614]: dbus-daemon[82614]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1000 pid=82612 comm="/opt/sublime_text/sublime_text --detached 1.txt")
Apr 14 19:01:47 DIAMOND org.a11y.Bus[82614]: dbus-daemon[82614]: Successfully activated service 'org.a11y.atspi.Registry'
Apr 14 19:01:47 DIAMOND org.a11y.Bus[82627]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry

Offline

#4 2024-04-14 15:43:41

seth
Member
Registered: 2012-09-03
Posts: 51,767

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

xinitrc is relevant and looks broken (session bus daemon inside the session) => post your xinitrc.

Probably unrelated but you might also want to look into why ~/.config/x11/xinitrc is sourced multiple times by itself…

Online

#5 2024-04-14 16:01:50

BEST8OY
Member
Registered: 2024-04-14
Posts: 11

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

seth wrote:

xinitrc is relevant and looks broken (session bus daemon inside the session) => post your xinitrc.

Probably unrelated but you might also want to look into why ~/.config/x11/xinitrc is sourced multiple times by itself…

Not exactly sure why it's being sourced several times!!!
xinitrc

#!/bin/sh

if [[ -f /usr/bin/prime-offload ]]; then
   /usr/bin/prime-offload
fi


if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
	. "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile"
else
	. "$HOME/.xprofile"
fi

# Activate dbus variables
dbus-update-activation-environment --all
dbus-launch ssh-agent dwm

if [[ -f /usr/bin/prime-switch ]]; then
	sudo /usr/bin/prime-switch
fi

and this is xprofile located in x11 folder

#!/bin/sh

xrandr --dpi 96	# Set DPI. User may want to use a larger number for larger screens.
setbg &			# set the background with the `setbg` script

autostart="mpd goldendict picom dunst unclutter pipewire remapd mpDris2"

for program in $autostart; do
	pidof -sx "$program" || "$program" &
done >/dev/null 2>&1

# Ensure that xrdb has finished running before moving on to start the WM/DE.
[ -n "$xrdbpid" ] && wait "$xrdbpid"

Last edited by BEST8OY (2024-04-14 16:02:07)

Offline

#6 2024-04-14 16:21:44

seth
Member
Registered: 2012-09-03
Posts: 51,767

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

Last link below, pay attention to the note that tells you what to include at least (you want to have that before including the xprofile) and drop the dbus-launch and udate-activation-environment stuff.

Since this is prbably all a bit dated: Sure you still want to use prime-switch?
https://wiki.archlinux.org/title/Optimus
https://wiki.archlinux.org/title/PRIME
Esp. if you can use https://wiki.archlinux.org/title/PRIME# … Management

Online

#7 2024-04-14 17:10:00

BEST8OY
Member
Registered: 2024-04-14
Posts: 11

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

seth wrote:

Last link below, pay attention to the note that tells you what to include at least (you want to have that before including the xprofile) and drop the dbus-launch and udate-activation-environment stuff.

Since this is prbably all a bit dated: Sure you still want to use prime-switch?
https://wiki.archlinux.org/title/Optimus
https://wiki.archlinux.org/title/PRIME
Esp. if you can use https://wiki.archlinux.org/title/PRIME# … Management

So you're saying optimus-manager is causing the my issue?
Because I fully deleted it (including its xinitrc stuffs)

But my issue still presist!


Regarding why I'm using prime-switch (with optimus-prime in hybrid mode) is because of "picom". Why? because when I check nvtop, picom constantly is using at least 60% of my discreate gpu (Intel) without any application running and when I use optimus-prime hybrid mode it drops down to 0.

And I couldn't find anything I should include in xinitrc in this link https://wiki.archlinux.org/title/PRIME# … Management

Last edited by BEST8OY (2024-04-14 22:56:56)

Offline

#8 2024-04-14 17:12:43

seth
Member
Registered: 2012-09-03
Posts: 51,767

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

No, I'm saying dbus-launch is causing your issue

seth wrote:

Last link below, pay attention to the note that tells you what to include at least (you want to have that before including the xprofile) and drop the dbus-launch and udate-activation-environment stuff.

http://wiki.archlinux.org/title/Xinit#xinitrc

The wiki wrote:

Note: At the very least, ensure that the last if block in /etc/X11/xinit/xinitrc is present in your ~/.xinitrc file to ensure that the scripts in /etc/X11/xinit/xinitrc.d are sourced.

Your xinitrc leads to a broken session, causing failing integration w/ the session bus.

Online

#9 2024-04-14 17:38:42

BEST8OY
Member
Registered: 2024-04-14
Posts: 11

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

seth wrote:

No, I'm saying dbus-launch is causing your issue
Your xinitrc leads to a broken session, causing failing integration w/ the session bus.

Ah. I misunderstood which last link you were mentioning (the one in your signature)

Any way this should solve my problem? But it didn't!

#!/bin/sh

if [[ -f /usr/bin/prime-offload ]]; then
    /usr/bin/prime-offload
 fi

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
	. "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile"
else
	. "$HOME/.xprofile"
fi

# Activate dbus variables
dbus-update-activation-environment --all
dbus-launch ssh-agent dwm

if [[ -f /usr/bin/prime-switch ]]; then
 	sudo /usr/bin/prime-switch
fi

Offline

#10 2024-04-14 17:42:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,811

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

Remove the dbus launch and the dbus activation environment

Run dwm without doing a dbus launch

Last edited by V1del (2024-04-14 17:43:23)

Offline

#11 2024-04-14 17:51:31

BEST8OY
Member
Registered: 2024-04-14
Posts: 11

Re: [SOLVED] mpd-mpris and mpDris2 ran through systemd or xinitrc issue

V1del wrote:

Remove the dbus launch and the dbus activation environment

Run dwm without doing a dbus launch

Yes thank you and seth

Forgot to do "drop the dbus-launch and udate-activation-environment stuff."

Just to be exact "dbus launch" causes the issue with running mpDris2 through xinitrc.

None of them was the cause of mpDris2 not functioning through its user service!

Last edited by BEST8OY (2024-04-14 18:07:50)

Offline

Board footer

Powered by FluxBB