snapcrafters / android-studio

A community-maintained package to easily install Android Studio on Linux
https://developer.android.com/studio/index.html
47 stars 16 forks source link

Fixed path to pulse socket #95

Closed guss77 closed 2 years ago

guss77 commented 2 years ago

The current PULSE_SERVER setting doesn't work and misses the location of the pulse socket (see this SO comment and reply), but is also wrong if you consult the spec - https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html :

$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.

(emphasis mine)

If $XDG_RUNTIME_DIR is the base directory, you shouldn't go above it. And as expected - on a fresh OS install, using the path $XDG_RUNTIME_DIR/../pulse/native results in /run/user/pulse/native, which is not a thing that exists.

I'm not sure what originally caused PR #74 to be accepted, but either there was a bug in some older Ubuntu version that caused $XDG_RUNTIME_DIR to be set to something weird, or there was a local configuration change in @om26er 's machine and there was no verification of the change on other installations.