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

Pamixer not working with pipewire-pulse #33167

Closed
timsofteng opened this issue Sep 28, 2021 · 4 comments
Closed

Pamixer not working with pipewire-pulse #33167

timsofteng opened this issue Sep 28, 2021 · 4 comments
Labels
question Further information is requested

Comments

@timsofteng
Copy link

Hello.
I've faced up with trouble with pipewire-pulse.
I use sway wm with seatd and exec pipewire and pipewire-pulse from it config.
They run fine.
But when I try to do something with pactl or pamixer I get error
XDG_RUNTIME_DIR (/tmp) is not owned by us (uid 1000), but by uid 0! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) Connection error

What do I do wrong?
How can I manipulate with pulse layer?

@folliehiyuki
Copy link
Contributor

The error literally said what went wrong.
I assume your $XDG_RUNTIME_DIR is set to /tmp which is owned by root. You should make it a subdir of /tmp instead.

For example, here is a snippet from the script I use to start sway:

if [ -z "${XDG_RUNTIME_DIR}" ]
then
	userid=$(id -u ${USER})
	export XDG_RUNTIME_DIR="$(mktemp -d /tmp/${userid}-runtime-XXXXXX)"
	if [ ! -d "${XDG_RUNTIME_DIR}" ]
	then
		mkdir -p "${XDG_RUNTIME_DIR}"
		chmod 0700 "${XDG_RUNTIME_DIR}"
	fi
fi

@timsofteng
Copy link
Author

timsofteng commented Sep 28, 2021

The error literally said what went wrong. I assume your $XDG_RUNTIME_DIR is set to /tmp which is owned by root. You should make it a subdir of /tmp instead.

For example, here is a snippet from the script I use to start sway:

if [ -z "${XDG_RUNTIME_DIR}" ]
then
	userid=$(id -u ${USER})
	export XDG_RUNTIME_DIR="$(mktemp -d /tmp/${userid}-runtime-XXXXXX)"
	if [ ! -d "${XDG_RUNTIME_DIR}" ]
	then
		mkdir -p "${XDG_RUNTIME_DIR}"
		chmod 0700 "${XDG_RUNTIME_DIR}"
	fi
fi

What if I just will set this variable to /home/username/.tmp?
Without this script.
Should it work?

@folliehiyuki
Copy link
Contributor

You can set it to anything, as long as it satisfies these:

$XDG_RUNTIME_DIR defines the base directory relative to which user-specific non-essential runtime files and other file objects (such as sockets, named pipes, ...) should be stored. The directory MUST be owned by the user, and he MUST be the only one having read and write access to it. Its Unix access mode MUST be 0700.

It is automatically created the first time a user logs in and removed on the user's final logout. If a user logs in twice at the same time, both sessions will see the same $XDG_RUNTIME_DIR and the same contents. If a user logs in once, then logs out again, and logs in again, the directory contents will have been lost in between, but applications should not rely on this behavior and must be able to deal with stale files.

@paper42 paper42 added the question Further information is requested label Sep 29, 2021
@timsofteng
Copy link
Author

You can set it to anything, as long as it satisfies these:

Thanks!
I've just created ~/.local/tmp/ dir without scripts and looks like now it works.
I close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants