i use artix linux with openrc, dwm and pipewire, if i run apps by using dmenu (alt + p), it works perfectly. but if i try to run something by using terminal, it cannot connect to pipewire. if i run ncpamixer, it gives me "Assertion 'c' failed at ../pulseaudio/src/pulse/context.c:1076, function pa\_context\_disconnect(). Aborting." error, if i run pavucontrol it gives "Connection to PulseAudio failed", but when i run pavucontrol from dmenu it just works. same thing with steam and other apps. for things like "java -jar <filename>" i could create script in /usr/bin, but i won't see terminal output then.
my ~/.local/share/dwm/autostart.sh is:
twmnd &
/usr/bin/pipewire &
/usr/bin/pipewire-pulse &
/usr/bin/wireplumber &
/home/archi/.config/myscripts/wall.sh &
/home/archi/.config/myscripts/bar.sh &
setxkbmap -layout us,ru -option grp:win_space_toggle
i tried to use pulseaudio, but there were other problems, so i use pipewire
and if i start pipewire from terminal, then ncpamixer works fine, but only in that terminal instance
i'd be very thankful if someone could help me figuring this out
What do you mean by "using terminal", switching to another TTY or on a terminal multiplexer? Some user env. variables would have to be exported in that case.
Pavucontrol IIRC exports some variables manually to prevent issues like that (from the early pulse days), it could be that pw-pulse lacks some of those hooks, and they would work by backgrounding the process with nohup.
DWM/Awesome are tough things to work with though, they have very friendly people on irc/discord, you should ask there
i mean terminal multiplexer, in my case it's sakura. which variables have to be exported? i couldn't find any information about them, though i tried.
i will try to ask in dwm discord then, thanks for your time
people on dwm irc told that switching to s6 may be a good option, but s6 feels different after openrc which i am used to, so i am still trying to find another way to make it work, and i don't think that this could be init problem.
at first, i decided to start pipewire services not from dwm autostart but from .xinitrc, and then i tried this (https://www.reddit.com/r/artixlinux/comments/s3p380/audio_not_working_pipewire_and_runit/):
and now my .xinitrc is:
pipewire &
exec dbus-launch --exit-with-session dwm
and i still have the same problem. i tried to start sakura by dmenu, but any sound things still don't start this way. i can't even start mpv.
upd.: i just realized that sakura isn't a multiplexer, but just a terminal emulator, i hope it doesn't matter too much
i tried alacritty, same problem, i have no idea what it could be
turned out it was about $XDG_RUNTIME_DIR, which would be exported as new tmp directory trough .zsession, i think i made it a long time ago even without understanding what i was doing, but now it finally works!