Pulse audio not working unless root

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
BigAngry

Pulse audio not working unless root

Post 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.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
greerd
Level 6
Level 6
Posts: 1060
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Pulse audio not working unless root

Post by greerd »

Are you perhaps using firejail?
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Pulse audio not working unless root

Post 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
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
BigAngry

Re: Pulse audio not working unless root

Post 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!
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Pulse audio not working unless root

Post 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
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
BigAngry

Re: Pulse audio not working unless root

Post 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.
BigAngry

Re: Pulse audio not working unless root

Post by BigAngry »

I've messed around with it some more but cant seem to figure it out. Any suggestions?
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Pulse audio not working unless root

Post 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.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: Pulse audio not working unless root

Post 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/
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
BigAngry

Re: Pulse audio not working unless root

Post 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?
User avatar
greerd
Level 6
Level 6
Posts: 1060
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Pulse audio not working unless root

Post by greerd »

Try this workaround.
Locked

Return to “Sound”