While trying to fix a minor issue on my Arch system, I seem to have created a bigger one. I don't really know what I did to cause this (more on that later) but pulseaudio seems to crash whenever I try using it.
If I try to play an mp3 file with Clementine, I get:
pa_stream_writable_size() failed: Connection terminated
Vlc seems to be playing but there is no sound output and I get a stream of the following error messages on the terminal window I launched it from:
[0000000001e24418] pulse audio output error: unknown latency: Bad state [0000000001e24418] pulse audio output error: cannot write: Bad state [0000000001e24418] pulse audio output error: unknown latency: Bad state [0000000001e24418] pulse audio output error: cannot write: Bad state
The similar problems I've found online seem to have solutions involving the removal of
gstreamer. I would rather not do this since there are quite a few packages depending on it, including Cinnamon, my DE. I also don't see how this could be the problem since the sounds was fine until I started fiddling with it.
The only command I ran that might have affected this was my attempt to add my onboard sound card to the list of cards detected by pulseaudio. Sadly, my machine crashed in the meantime and I had to do a hard reboot so I lost the exact command I ran but it was something along the lines of:
pactl load-module module-alsa-card device_id="0" name="pci-0000_00_05.0" card_name="alsa_card.pci-0000_00_05.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes
I am guessing that I used the wrong parameters there and added the same card twice or one of them with a wrong name or similar.
Possibly relevant information
$ pactl list short cards 0 alsa_card.pci-0000_00_1b.0 module-alsa-card.c 1 alsa_card.pci-0000_03_00.0 module-alsa-card.c
When I try to run
pavucontrol, I get a brief glipse of my sound cards which is immediately replaced by:
Establishing connection to pulseaudio server, please wait`
then the cards, then the message etc. This repeats itself a few dozen times until it settles down to:
Attempting to run
start-pulseaudio-x11 manually also fails:
$ start-pulseaudio-x11 Connection failure: Connection refused pa_context_connect() failed: Connection refused
/etc/pulse/client.conf file is (header removed):
; default-sink = ; default-source = ; default-server = ; default-dbus-server = autospawn = no ; autospawn = yes ; daemon-binary = /usr/bin/pulseaudio ; extra-arguments = --log-target=syslog ; cookie-file = ; enable-shm = yes ; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB ; auto-connect-localhost = no ; auto-connect-display = no
I tried removing relevant packages:
sudo pacman -Rdd pavucontrol pulseaudio pulseaudio-alsa lib32-libpulse libcanberra-pulse
And, then reinstalling them:
sudo pacman -S pavucontrol pulseaudio pulseaudio-alsa lib32-libpulse libcanberra-pulse
But that made no difference. What else can I try? Ideally, how can I reset pulseaudio to the state it was in yesterday, before I broke it? If the issue is indeed that my
pactl command broke it, how can I undo that command?