Page 1 of 1

Pulse audio not working unless root

Posted: Sun Sep 03, 2017 10:28 pm
by BigAngry
I recently started having problems with my audio. I tracked down the issue after some work to a permissions problem.
If I try to open pulse audio using pavucontrol it opens but never establishes a connection with the following issue shm_open() failed: No such file or directory
This works fine if I do sudo pavucontrol.

As a consequence whenever I use a media player it has no sound. Strangely enough sound works fine through my browsers.
I tried adding my user to groups 'audio, pulse, and pulse-access' but that didnt help. After some searching online I tried modifying /etc/fstab and /etc/pulse/client.conf to no avail. I also looked at my /run/user folder and my user owns the pulse files there. I'm at a loss as to how to solve this.

Re: Pulse audio not working unless root

Posted: Mon Sep 04, 2017 7:07 am
by greerd
Are you perhaps using firejail?

Re: Pulse audio not working unless root

Posted: Mon Sep 04, 2017 9:28 am
by Flemur
BigAngry wrote:This works fine if I do sudo pavucontrol.
That's probably how you broke it - now root own your pulse files.

If this command returns files, take ownership of them:

Code: Select all

find $HOME ! -user $USER

Re: Pulse audio not working unless root

Posted: Mon Sep 04, 2017 5:09 pm
by BigAngry
Flemur wrote:
BigAngry wrote:This works fine if I do sudo pavucontrol.
That's probably how you broke it - now root own your pulse files.

If this command returns files, take ownership of them:

Code: Select all

find $HOME ! -user $USER
There were quite a few files returned by that command, among them was the pulse ini. I didnt realize running sudo would cause ownership to change, thats seems a bit odd. I took ownership and after a restart it started working again. Thanks!

Re: Pulse audio not working unless root

Posted: Tue Sep 05, 2017 5:17 pm
by Flemur
BigAngry wrote: I didnt realize running sudo would cause ownership to change, thats seems a bit odd.
I think it's sort-of a bug...because the problems it causes show up here!

When you run GUI programs use "gksudo" (or "ksudo"[?] in KDE), like

Code: Select all

gksudo pavucontrol

Re: Pulse audio not working unless root

Posted: Thu Sep 07, 2017 5:52 pm
by BigAngry
Ok for some reason it stopped working again, and this time nothing shows up from 'find $HOME ! -user $USER'
This is a bit perplexing.

Re: Pulse audio not working unless root

Posted: Thu Sep 21, 2017 3:51 am
by BigAngry
I've messed around with it some more but cant seem to figure it out. Any suggestions?

Re: Pulse audio not working unless root

Posted: Thu Sep 21, 2017 10:03 am
by Flemur
BigAngry wrote:I've messed around with it some more but cant seem to figure it out. Any suggestions?
Well, I removed pulseaudio! (Although that can cause problems depending on your HW and what you do with it, so it's not officially recommended...and isn't possible with Cinnamon. The only thing I used pulseaudio for was to record "what you hear", which I can do without it with a different sound card. Though now firefox requires it...sigh...so use old FF version.)

Anyway, another typical pulseaudio fix/hack is to remove its files under your $HOME.

Code: Select all

find ~ -iname "*pulse* 
then delete them. IIRC, it'll probably be one file ~/.pulse(something). Then restart pulseaudio and/or logout/backin.

Re: Pulse audio not working unless root

Posted: Thu Sep 21, 2017 3:19 pm
by Hoser Rob
Removing pulseaudio is not only not recommended, for good reason, it's unnecessary. Try a read of this by a Canonical dev ...

http://voices.canonical.com/david.henni ... our-audio/

Re: Pulse audio not working unless root

Posted: Thu Sep 21, 2017 6:20 pm
by BigAngry
Alright after digging around some more I figured out the root cause of the issue. Seems to be that whenever I launch firefox with firejail, it prevents pulse from creating new files in /dev/shm and deletes whatever files were present on boot.
I believe its this exact issue referenced here https://bugs.freedesktop.org/show_bug.cgi?id=92141. Towards the bottom they specify that in pulse 9 and 10 that the issue was fixed. I see that the newest version of pulse is 11. However, mine is 8. I looked into updating it to 11, but that seems to be a daunting task.

Could someone point me in the right direction as for a proper guide on how to do the upgrade, or how to configure firejail not to mess my stuff up?

Re: Pulse audio not working unless root

Posted: Thu Sep 21, 2017 9:13 pm
by greerd
Try this workaround.