Constant crashes

I don’t know why, but Audacity 2.2.1 keeps on crashing after maybe 10 minutes of usage. I end up having to open a terminal and kill the process and re-open and then recover the session. Why is it so unstable?

Try setting the recording and playback setting to the “hw” options in the device toolbar, that correspond with the audio device that you are using. That will set Audacity to use the device directly through ALSA, bypassing PulseAudio, and should resolve the stability problems.

Try un-maximizing Audacity. I know this sounds dumb, but I read someone else suggest it in another forum and it totally stopped the random crashes for me.

FWIW, this workaround doesn’t seem to work for me. I have several hw entries, all of which I have checked, and none of which produce any sound.
I only get the sound when I pick pulse or default. I also checked that none of the channels are muted in alsamixer.
Screenshot_20180919_100609.png

The default sound card (the one that you would expect to work) is hw:0,0.
I see that is not listed in the device toolbar, which indicates that it is probably being used by some other software.
Try logging out and back in again, then launch Audacity before any other applications and see if hw:0,0 is available.

Note that if Pulse Audio Volume Control is open, then PulseAudio will grab exclusive access to hw:0,0 so it will be unavailable to Audacity. Same goes for “Sound Settings” (which is usually based on Pulse Audio Volume Control).

That must have been it. Thanks steve!

So is it working now?
Say what you did to fix it - that could help others.

Well, as you said, I made sure that pavucontrol is not running, and now I do see the hw:0,0 device and it works.

As for the crashes, I haven’t observed them since I switched to ALSA, but it hasn’t been that long.

Thanks for the update.

Today I had a particularly hard time making hw:0,0 show up in Audacity, so I discovered a simple and reliable solution: pasuspender. Simply run

pasuspender audacity

pasuspender shouldn’t be necessary. All that does is to suspend (temporarily disable) PulseAudio, but if nothing is using PulseAudio it will suspend itself anyway without pasuspender.

Note that if Pulse Audio Volume Control is open, the PulseAudio is active and will grab exclusive control of your sound card.

Another alternative to using the “hw:” device if crashing is happening on playback, is to use dmix for playback.

Well, I tried rebooting the computer, and made sure no other desktop app (including pavucontrol) was running. Nothing helped except pasuspender.

Including your web browser? That’s caught me out a couple of times when there was a page loaded but not visible that contained media, and a browser plug-in was using Pulse.

Note also that when Audacity first opens, it scans the sound system, including Pulse, so Pulse will be active for a few seconds after launching Audacity.
(Audacity 2.3.0 works around this by retrying a few times, so as to give Pulse chance to time-out and suspend itself. For earlier version, I’d suggest waiting 30 seconds after launching Audacity before attempting to record with “hw:”).

Yes, including the browser. Audacity was literally the first and only app I launched after a fresh boot. I also tried restarting it.