14

Sounds in my applications are played in super speed and are crackling horribly. In Spotify, the songs are actually playing at around 3x speed. I have Googled this quite a bit and all I can come up with is a bug report from January 2012 which is marked as closed.

I have tested Spotify and Hearthstone using PlayOnLinux with Wine versions 1.5.0, 1.6, 1.6.0, 1.7.0, 1.7.8 as well as the system Wine which is version 1.4.1. They all have the exact same terrible crackling sound issue. This leads me to assume that this is not a bug with Wine.

The steps to reproduce from the bug report:

Steps to Reproduce:
1. winecfg
2. go to Audio tab
3. Test Sound

Actual results:
crackling sounds produced

Expected results:
normal output

Are also producing crackling noises for me. While doing it, winecfg printed the following to the terminal:

p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/p11-kit-trust.so: /usr/lib/i386-linux-gnu/pkcs11/p11-kit-trust.so: cannot open shared object file: No such file or directory
err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
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

(The first line showed up as I opened winecfg, the last 5 showed up when I clicked Test Sound)

Any clues what could be wrong? Let me know if I can provide any more information.


pulseaudio 1:4.0-0ubuntu6 amd64
Hubro
  • 1,293

6 Answers6

24

Since this is the first result returned by Google, I'd thought I share my experience here. For those who look for a quick fix, put the following in your ~/.bashrc or /etc/profile for system-wide change:

alias wine='PULSE_LATENCY_MSEC=60 wine'

This is the same fix that's used for Skype and PulseAudio 4.0 and above, which is behaving the same way as wine. Hope this helps!

Edit (12.01.2016):

You can enable this variable globally by adding this line to ~/.bashrc and logging out/rebooting

export PULSE_LATENCY_MSEC=60

If you're experiencing audio issues in other applications after this, simply delete the line and logout or reboot. If you want to test it temporarily, open a new terminal and paste that line. Now every application that you invoke from this terminal will have the variable set and PulseAudio will set the latency.

More information on this problem and the 'fix': http://arunraghavan.net/2013/08/pulseaudio-4-0-and-skype/

Iskren
  • 341
  • 2
  • 5
8

Run a terminal (Ctrl+Alt+T)

Issue command pulseaudio -k

Try to recreate issue. Shouldn't play in fast forward anymore.

As to the crackling the log tells you plain and simple, you have a buffer underrun. Change your sampling quality... Sacrifice some quality for speed and see if that solves your underrun.

DeeJayh
  • 408
  • 1
  • 5
  • 17
3

With certain games if you use PlayOnLinux you can open the launcher with your text editor and change the Exec= line as follows:

Exec=env PULSE_LATENCY_MSEC=60 /usr/share/playonlinux/playonlinux --run "GameName" %F
kos
  • 41,268
Skitz
  • 31
1

Try this solution. It mostly had to do with PulseAudio, personally I removed it and tried it again and the underrun was gone, but I lost the ability to move audio output to different sinks. This how-to maintains pulseaudio and ALSA play nicely with each other without letting pulseaudio hog the hardware directly.

allenskd
  • 1,288
0

After running just fine a portaudio application started sounding erratic while shooting errors

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

SOLUTION - first you need to kill the existing process ... issue these cmds

    pulseaudio --kill

    jack_control start

Once you are done with the above then issue these commands :

    jack_control exit

    pulseaudio --start

Now same application then played audio via portaudio just fine

cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"

dpkg -l|grep portaudio
ii  libportaudio2:amd64                         19+svn20140130-1build1                               amd64        Portable audio I/O - shared library
ii  libportaudiocpp0:amd64                      19+svn20140130-1build1                               amd64        Portable audio I/O C++ bindings - shared library
ii  portaudio19-dev                             19+svn20140130-1build1                               amd64        Portable audio I/O - development files