Sometimes, as many have noticed, sound will work well for a while — several minutes, several hours — and then latency will rise a lot, or static will overlay, or sound will stutter or stop altogether, or all of the above. I have taken to calling this phenomenon “ALSA confusion”, as in “ALSA becoming confused” about what it should be doing and how it should be doing it. I have thus far identified the following causes and cures for ALSA confusion:
- The ALSA Jack plugin. Don’t try to use it. It is bad. I saw this one happen.
- ACPI engaged in the kernel. I turned off ACPI in the kernel, my latency dived, performance rose, and ALSA confusion vanished. This appears to occur with many motherboards.
- Sharing an IRQ between the motherboard sound and one or more other data-heavy systems, e.g., video. This can be tricky to solve, it can require BIOS changes and/or PCI card position changes, and is not always possible for motherboard hardware. Happily, a very good quality PCI implementation of recent version — 2.3 I believe — should not exhibit this problem at all, if both card(s) and motherboard are compliant. I didn’t see this one happen (my motherboard and card are new), but read about it a lot in trying to solve my problems.
- Attempts to write to the same ALSA device by two different apps simultaneously. ALSA docs say the problem doesn’t exist because the ‘dmix’ plugin is automatically engaged at need, but it’s simply not factual, it just does not happen in a great many cases, and my new very-low-noise pro audio sound card is one of them. I solved this one by permitting only Jackd to output directly to the ALSA device; everything else outputs either to ALSA’s Pulse driver (thus far working very well indeed) or to Pulse (itself designed to handle multiple streams), which then hands the data to Jackd, which is tremendously good at handling multiple streams, at the very low latencies which we need. My methods for this are described here.
- Device ID confusion. I found that ALSA sometimes gets very confused about its hardware when one is using USB devices (e.g., a USB MIDI cable) which it knows about. I’m pretty sure I saw it try to output sound to the MIDI device as well as the sound system, simultaneously, until after I rebooted twice, one very scary five-minutes-to-go moment; prayer was involved. I solved this one by use of alphanumeric names (see this page) instead of either “default” or “hw:0″ etcetera in qjackctl, Jackd, and sometimes asound.conf / .asoundrc.
Thank you for sharing all the lessons you’re learning! It makes it much easier for others
You are most welcome