LMDE + Winamp = ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

Using LMDE 2014-04 + Wine 1.6+ + Winamp 5.666 I sometimes experienced distorted stuttering audio. The problem did not appear directly, but rather when switching windows away from Winamp, leaving it playing a few tracks or the CPU got busy the audio got terrible again. Very annoying. 

Playing in VLC was no problem.

I caught error messages by doing this in a terminal:
cd ~/.wine/drive_c/Program Files/Winamp
wine winamp

Then I started playback in Winamp. The following errors appeared when the distorted sound started playing:
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
(errors repeated)

Googled for a lot of confusing solutions that told me to edit /etc/pulse/default.pa, but none of these solutions worked as dmix did not exist as a device.

A partly solution that made the most of the distortions get away was to run winecfg as current user and directly select the (analog) output device on the audio tab. Note that I ran winecfg as the current user with Winamp installed, not as root. After that most of the distortions were gone. Still some are left.

Next thing to try - switch to direct ALSA output. Run winetricks -- gui in a terminal, choose "Select the default wineprefix", then scroll down to sound=alsa and check it. This did not affect much, except that wine now bypasses PulseAudio server. Still pops and clicks.
(Source: http://askubuntu.com/questions/77210/how-to-change-the-default-audio-in-wine-to-alsa-only )

Next - raise buffer for ALSA. Did not work either. Go to /proc/asound/cardX/pcmXp/subX and look into prealloc. To find out which folder that is yours have a look at the files in the folders for hints. On my system it was 64 for 64kb, I raised it to 4096 by doing echo 4096 > prealloc. Neither did that do much. Note that /proc is made up on each boot, so if you want this permanent you'll have to put the echo line into /etc/rc.local.
(Source: http://www.gossamer-threads.com/lists/mythtv/users/474457 )

This is a personal note. Last updated: 2014-04-30 00:27:34.








Don't forget to pay my friend a visit too. Joakim