Audacity can't record a second track with "default" playback

Help for Audacity on GNU/Linux.
Forum rules
ImageThis forum is for Audacity on GNU/Linux.
Please state:
  • which version of Linux you are using,
  • the exact three-section version number of Audacity from Help menu > About Audacity,
  • whether you installed your distribution's release, PPA version, or compiled Audacity from source code.

Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade (see https://www.audacityteam.org/download/).
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
foul_owl
Posts: 2
Joined: Thu Nov 10, 2016 7:27 am
Operating System: OS X 10.7 - 10.8 Lion / Mountain Lion

Audacity can't record a second track with "default" playback

Post by foul_owl » Thu Nov 10, 2016 7:50 am

Hi folks,

Running Debian 8, Audacity 2.0.6. (Current version that ships with Debian)

I have a Presonus Audiobox USB. I can record one track via Audacity without issue.

Trying to record a second track, it randomly records between 0 and 0.1 second of time and prints to the terminal:

Code: Select all

ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
Expression 'err' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3355
Expression 'ContinuePoll( self, StreamDirection_In, &pollTimeout, &pollCapture )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3881
Expression 'PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4253
This is only if the "default" device is selected for playback. I can select the audiobox as the output device and that lets me record a second track while the first one is playing, no problem. But the issue for me is that I want to play back audio through the default device while recording a second track.

Another thing to note: I can play back sound on the "default" device no problem, the issue only occurs if default is selected for playback and I try to record a second track while listening to the first.

Thank you so much!

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Audacity can't record a second track with "default" play

Post by steve » Thu Nov 10, 2016 9:47 am

On Debian 8 Jessie, the default "device" is PulseAudio, which in this context you can think of as a "virtual device" in that it isn't actually a hardware device but a middle-man between the application (Audacity) and the hardware devices. Unfortunately, using "Pulse" (PulseAudio) with Audacity can be unreliable on some machines due to the way that Audacity opens audio streams ("ports") "on demand" rather than opening in/out ports once and keeping them open.

The workaround for this problem (and this looks to be the problem on your machine) is to select actual hardware devices (via their ALSA drivers) for play/record.
In addition to your Presonus Audiobox USB, I assume that you also have an on-board sound card, and I assume that is the device that you want to use for playback.
The hardware devices can be recognised by "hw" in the device name. For example, on my machine I have:

HDA Intel: ALC268 Analog (hw:0,0)
this is the on-board sound card.

Device name: USB Audio CODEC: - (hw:1,0)
this is a USB sound card.

To use the on-board sound card for playback, select the "hw" device that corresponds with your on-board sound card.

Limitations:
Most modern sound cards do not have hardware mixing capability.
What this means is that if you use the device directly via its ALSA driver, only one application at a time can use the device. If any other application is accessing the device, then the device will be unavailable to Audacity. To use the "hw" options, ensure that no other audio applications are running (this includes Flash player).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply