I am trying to figure out what is going on with pulseaudio on my computer because almost every 20 seconds of listening to a song it freezes.
I've tried killall pulseaudio && pulseaudio
to try to get the output of pulseaudio for when it crashes but for some reasons it gives me an error. Oddly something to do with ALSA
E: module-alsa-card.c: Failed to find a working profile.
E: module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="1" card_name="alsa_card.1" tsched=yes ignore_dB=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I am not really sure if this is the problem, but if it is, I would still like to know for future reference how I could monitor the output of a program which has not been manually called through the terminal.
The usual way to read application's outputs is running them from terminal. Some programs have a --quiet option to reduce output, some have an additional --verbous option to view as much as possible (that depends on the code). Still, some programs write a log file to see what happened.
This is all very different from software to software. Thus a general answer to your question cannot be given.
For PulseAudio there is a wiki on how to log output.