Skip to content

Pulseaudio help

So for a while i was starting X11 with just $startx. It worked most of the time, but sometimes there was a weird race condition and it refused to work. Then it became everytime.

So I started X using lightdm and that problem was fixed. But now pulseaudio doesn't work. and just shows dummy output when killed and restarted.

I tried:

aplay -l (no devices)

sudo aplay -l (shows all cards)

playing music w/ cmus and mpd on user account before starting X11 (works with or without pulse. audio dies when X starts)

uninstalling pulse (everything works but can only play 1 audio stream)

starting X11 w/ xdm (same problem w/ lightdm)

starting mpd w/ sudo (audio works)

starting cmus w/ sudo (cmus: Error: an error occured while initializing MPRIS: No such file or directory. MPRIS will be disabled.

In app: No device detected

)

SOLVED: sudo setfacl -m u:username:rw /dev/snd/*

SOLVED PT2: Like a dummy I deleted a block from the default .xinitrc when putting in exec lightdm & i3

Note: At the very least, ensure that the last if block in /etc/X11/xinit/xinitrc is present in your ~/.xinitrc file to ensure that the scripts in /etc/X11/xinit/xinitrc.d are sourced.

Edited 3 Jan 2020. We only hold this version.

37 points11 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
37 · 100% up
Kind
Text
ID
ej24ms

Author

5
posts
15
comments
4
media
View profile

11 comments

If aplay -l shows you no devices but sudo aplay -l does that means ALSA config is broken in ways unrelated to pulseaudio.

Post

ls -l /etc/asound.conf ~/.asoundrc
loginctl show-session $XDG_SESSION_ID
printenv
3 points
ls: cannot access '/etc/asound.conf': No such file or directory
ls: cannot access '/home/cader/.asoundrc': No such file or directory



EnableWallMessages=no
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
RebootToBootLoaderMenu=18446744073709551615
IdleHint=no
IdleSinceHint=1577974536271699
IdleSinceHintMonotonic=562478303
InhibitDelayMaxUSec=5s
UserStopDelayUSec=10s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=no
LidClosed=no
OnExternalPower=yes
RemoveIPC=yes
RuntimeDirectorySize=803586048
InhibitorsMax=8192
NCurrentInhibitors=0
SessionsMax=8192
NCurrentSessions=1




COLORFGBG=0;15
COLORTERM=truecolor
DESKTOP_SESSION=i3
DISPLAY=:0
GDMSESSION=i3
GRADLE_HOME=/usr/share/java/gradle
GTK_MODULES=canberra-gtk-module
HOME=/home/cader
I3SOCK=/run/user/1000/i3/ipc-socket.1040
KONSOLE_DBUS_SERVICE=:1.20
KONSOLE_DBUS_SESSION=/Sessions/1
KONSOLE_DBUS_WINDOW=/Windows/1
KONSOLE_VERSION=191200
LANG=en_US.UTF-8
LANGUAGE=
LOGNAME=cader
MAIL=/var/spool/mail/cader
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
PROFILEHOME=
PWD=/home/cader
SHELL=/bin/zsh
SHELL_SESSION_ID=c1b1186fee954a0ab0b643e1277f2d04
SHLVL=1
TERM=xterm-256color
USER=cader
WINDOWID=27262983
XAUTHORITY=/home/cader/.Xauthority
XDG_CURRENT_DESKTOP=i3
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/cader
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_DESKTOP=i3
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7
_=/usr/bin/printenv
OLDPWD=/home/cader
IN_API_KEY=3f7e30d58db045e08ff0ae22e1f202fc
1 points

I think this is some sort of session permission thing or because of how xinit runs. Because audio only dies when x starts. after login and before xinit, i can run cmus just fine and it shows up in pulsemixer.

1 points

What kernel are you on? Try the linux-lts package if you haven't already.

2 points

See the wiki under PulseAudio/Troubleshooting. The dummy output problem is discussed there.

2 points

Should users be in the "audio" group?

There are three kind of distributions: 1) those who control access to the sound card by adding users to the "audio" group, 2) those who use udev (or HAL) and ConsoleKit to dynamically give access to the currently "active" user, but allow overriding that using the "audio" group and 3) those who don't use the "audio" group at all, but rely solely on HAL+ConsoleKit to grant access to the sound card.

From FreeDesktop: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PerfectSetup/

1 points

You can add yourself to the `audio` group (`sudo gpasswd -a <username> audio`), but your user should automatically be granted access to the `/dev/snd/*` devices upon login (`getfacl /dev/snd/*`).

Additionally, I would not advice running e.g. cmus or mpd as root (unless that is really necessary). The mpd package ships a systemd user service. Unfortunately it also adds the mpd user to the audio group (see the aforementioned link to the pulseaudio setup), which means it's (currently) advisable to add your own user to the audio group as well.

1 points

Seeing both of your [solveds] you are doing absolutely weird things here. Why are you starting lightdm from your xinitrc? Enable it's systemd service. That should both not care about what's in your .xinitrc and properly set up your session which wasn't correct in your previous outputs.

1 points

Probably not the answer you're looking for but I cured my pulseaudio woes by removing it and using ALSA directly.

-3 points

I'm fine with that, but i don't have a hardware mixer (guessing) and can't play from Firefox while another source is going

2 points

Is your user in all the correct groups? Seems like you can't list the devices as user. This seems like a systemd/udev issue and not pulseaudio.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.