[Linux] Title screen spams ALSA underflow errors to the console.

Issue #39 resolved
Alistair Buxton created an issue

For example:

ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

This makes it difficult to see the debug messages.

I assume this happens because you opened the sound device but don't play any sound on the title screen.

Comments (4)

  1. Alistair Buxton reporter

    This actually happens during the game sometimes, and the sound becomes distorted. This is a symptom of incorrect ALSA usage, most likely too short buffers.

  2. Riot

    Yep, i've observed this before - your suspicion about inappropriate buffer sizes may be correct. We're not specifying buffer size manually right now, just leaving it up to PortAudio to use the system defaults. Will need to experiment with a few different settings. I'll put together a custom debug build for you to test soon that'll report what buffer sizes it assigns (and other output info) which should help us diagnose the issue precisely.

    It should be noted tht the alsa lib spam isn't from our own code, and potentially is the cause of the stuttering in case it occurs inside the interrupt loop (which is called at 44khz, so any IO will put it behind schedule). Will need to see about suppressing the output, in any case.

  3. Riot

    Just a thought - are you using pulseaudio? You may need to call the game via the pasuspender utility as that can interfere with alsa in some cases.

  4. Riot

    Confirmed this is a known issue that's a Pulseaudio conflict. The correct workaround is to execute the binary with pasuspender, as in ```pasuspender AdvertCity_Linux"

  5. Log in to comment