Pulseaudio troubleshooting

From wikinotes

Pulseaudio does not start at boot

If you have set a default source/sink/profile,
and journalctl --user -u pulseaudio is showing lots of messages like:
Sink alsa_output.pci-0000_00_1b.0.analog-stereo does not exist. when you first login
and you know the source/sink/profile are correct, the problem should resolve itself within a few minutes.


pulseaudio is configured to restart automatically on failure,
but on my desktop it is taking about 45s to run and exceeds the max retries.


You can manually restart it on a loop, which should eventually fix the problem.

while true; do
    if systemctl --user status pulseaudio 2>&1 > /dev/null ; then
        break
    else
        sleep 0.5
        systemctl --user restart pulseaudio
    fi
done

Verify your Hardware is Detected

lspci    | grep -i <your card name>
aplay -l | grep -i <your card name>
pacmd list-cards

No Headphone Sound

If using an intel HDA onboard audio, and no headphone sound, occasionally you can manually correct the way that your hardware is being interacted with using a boot override in /etc/modprobe.d/*.conf. You can either do this manually, or use the fantastic hdajackretask program to do it for you.

sudo pacman -S alsa-tools   ## bundle that includes hdajackretask

hdajackretask               ## start GUI program
#   > Options: Advanced override
#   > Green Headphone, Front Side   (make sure all entries make sense, especially location, and device)

NOTE:

with the ALSA898 soundcard, both under alsa and pulseaudio the audio seems to work automatically only occasionally, and the most success I have had is changing the front-facing MIC port to behave as the headphone jack.


WARNING:

if you are runing pulseaudio as a non-root user, you will not be able to press 'Apply Now' to test your override. Installing boot override will also fail, or at least performing it from the GUI. Instead:

  • Install Boot Override (you will be prompted for a password on the CLI
  • check the path to script.sh that is listed on the CLI
  • in a separate shell, manually run the CLI command
  • if you succeeded you should have a new entry at /etc/modprobe.d/hda-jack-retask.conf

Optical Out (No Sound)

Within alsamixer, enable SPDIF

Choose Audio Out

pavucontrol:
  audio mixer:
    (change tabs all the way to the right)
    Configuration: Built-In Audio: Digital Stereo (HDMI 2) Output + Analog Stereo Input

Pulseaudio + Wine

Example conflict

  • Run Program in wine that uses audio
  • Go to youtube in chromium

only wine program gets audio

http://askubuntu.com/questions/91609/what-are-the-problems-between-pulseaudio-and-wine Very helpful description of history of pulseaudio

Invalid Default Frequency

This is likely the underlying cause of aformentioned Pulseaudio + Wine issues.

Default frequency set in daemon.conf

default-sample-rate 48000

See https://www.reddit.com/r/linuxquestions/comments/ogbevk/pulseaudio_some_software_can_initiate_output/