Bug#581624: pulseaudio: Stuttering playback from Wine
On Sat, Apr 5, 2014 at 5:22 PM, Michael Gilbert wrote: It probably makes sense to change the default to 5 rather than 25. It appears that this breaks other software such as skype[1], and the workaround would be to actually raise the latency. Quoting from the link: Applications can ask PulseAudio for the latency that they wish to have (the amount of time between writing out a sample and it being played out the speaker/headphones/whatever). Skype seemed to have some weird buggy math that only kicked in at low latencies (20-25ms or less) that caused the problem you saw. Setting PULSE_LATENCY_MSEC forces the requested latency (60 is pretty safe across most setups), making sure this bug in Skype is not triggered. Rather than change the default, perhaps wine can set PULSE_LATENCY_MSEC? Applications that are buggy with too high or too low latencies will probably exist always. I don't know what should we do in this case. [1] http://arunraghavan.net/2013/08/pulseaudio-4-0-and-skype/#comment-723074 -- Saludos, Felipe Sateler -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#581624: pulseaudio: Stuttering playback from Wine
The discussion here: http://bugs.winehq.org/show_bug.cgi?id=28282 suggests setting default-fragment-size-msec=5 in /etc/pulse/daemon.conf, and that solution works for me. The default is currently 25 milliseconds, which does seem kind of long, and very likely the cause of overflowing the buffer that results in stuttering. It probably makes sense to change the default to 5 rather than 25. Best wishes, Mike -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#581624: pulseaudio: Stuttering playback from Wine
control: tag -1 patch On Sat, Apr 5, 2014 at 5:22 PM, Michael Gilbert wrote: It probably makes sense to change the default to 5 rather than 25. Hi, I've attached a proposed patch that makes this change. Please review. Best wishes, Mike diff -Nru pulseaudio-5.0/debian/changelog pulseaudio-5.0/debian/changelog --- pulseaudio-5.0/debian/changelog 2014-03-28 23:21:13.0 + +++ pulseaudio-5.0/debian/changelog 2014-04-05 21:34:41.0 + @@ -1,3 +1,10 @@ +pulseaudio (5.0-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Set default-fragment-size-msec to 5 milliseconds (closes: #581624). + + -- Michael Gilbert mgilb...@debian.org Sat, 05 Apr 2014 21:33:06 + + pulseaudio (5.0-1) unstable; urgency=medium [ Balint Reczey ] diff -Nru pulseaudio-5.0/debian/patches/0004-fragment-size.patch pulseaudio-5.0/debian/patches/0004-fragment-size.patch --- pulseaudio-5.0/debian/patches/0004-fragment-size.patch 1970-01-01 00:00:00.0 + +++ pulseaudio-5.0/debian/patches/0004-fragment-size.patch 2014-04-05 22:06:48.0 + @@ -0,0 +1,50 @@ +Description: the default fragment size of 25 milliseconds is too large, which leads to buffer overruns and audio stuttering +Author: Michael Gilbert mgilb...@debian.org +Bug-Debian: http://bugs.debian.org/581624 + +--- a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c +@@ -96,7 +96,7 @@ static const pa_daemon_conf default_conf + .lock_memory = false, + .deferred_volume = true, + .default_n_fragments = 4, +-.default_fragment_size_msec = 25, ++.default_fragment_size_msec = 5, + .deferred_volume_safety_margin_usec = 8000, + .deferred_volume_extra_delay_usec = 0, + .default_sample_spec = { .format = PA_SAMPLE_S16NE, .rate = 44100, .channels = 2 }, +--- a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in +@@ -87,7 +87,7 @@ ifelse(@HAVE_SYS_RESOURCE_H@, 1, [dnl + ; default-channel-map = front-left,front-right + + ; default-fragments = 4 +-; default-fragment-size-msec = 25 ++; default-fragment-size-msec = 5 + + ; enable-deferred-volume = yes + ; deferred-volume-safety-margin-usec = 8000 +--- a/src/pulsecore/core.c b/src/pulsecore/core.c +@@ -111,7 +111,7 @@ pa_core* pa_core_new(pa_mainloop_api *m, + c-default_sample_spec.channels = 2; + pa_channel_map_init_extend(c-default_channel_map, c-default_sample_spec.channels, PA_CHANNEL_MAP_DEFAULT); + c-default_n_fragments = 4; +-c-default_fragment_size_msec = 25; ++c-default_fragment_size_msec = 5; + + c-deferred_volume_safety_margin_usec = 8000; + c-deferred_volume_extra_delay_usec = 0; +--- a/man/pulse-daemon.conf.5.xml.in b/man/pulse-daemon.conf.5.xml.in +@@ -465,8 +465,8 @@ USA. + /option + option + poptdefault-fragment-size-msec=/optThe duration of a +- single fragment. Defaults to 25ms (i.e. the total buffer is thus +- 100ms long)./p ++ single fragment. Defaults to 5ms (i.e. the total buffer is thus ++ 20ms long)./p + /option + + /section diff -Nru pulseaudio-5.0/debian/patches/series pulseaudio-5.0/debian/patches/series --- pulseaudio-5.0/debian/patches/series 2014-03-28 23:21:13.0 + +++ pulseaudio-5.0/debian/patches/series 2014-04-05 22:05:24.0 + @@ -2,3 +2,4 @@ 0002-Use-the-fixed-point-speex-resampler-on-ARM.patch 0003-exit-with-X-session.patch kfreebsd_no_lock_and_threads_synchro.patch +0004-fragment-size.patch
Bug#581624: pulseaudio: Stuttering playback from Wine
I have the same problem. When the audio leaking, in the mixer I see an alsa device appear and disappear (pavucontrol and kmix). pulseaudio and kmix use a lot of cpu: 23480 andrea 9 -11 383816 50804 2556 R 99,4 1,3 26:40.74 pulseaudio 23550 andrea20 0 691120 23872 9700 R 87,7 0,6 22:35.62 kmix On log I read: (1539.838| 0.000) D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Stream removed from object /org/pulseaudio/core1/playback_stream73959 (1539.838| 0.000) I: [pulseaudio] sink-input.c: Freeing input 73959 ALSA Playback (1539.838| 0.000) D: [pulseaudio] module-intended-roles.c: Not setting device for stream ALSA Playback, because it lacks role. (1539.838| 0.000) I: [pulseaudio] sink-input.c: Trying to change sample rate (1539.838| 0.000) I: [pulseaudio] sink.c: Cannot update rate, SINK_IS_RUNNING, will keep using 48000 Hz (1539.838| 0.000) I: [pulseaudio] module-stream-restore.c: Restoring volume for sink input sink-input-by-application-name:ALSA plug-in [wine-preloader]. (1539.838| 0.000) D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-_00_1b.0.analog-stereo becomes busy, resuming. (1539.838| 0.000) I: [pulseaudio] resampler.c: Forcing resampler 'copy', because of fixed, identical sample rates. (1539.838| 0.000) I: [pulseaudio] resampler.c: Using resampler 'copy' (1539.838| 0.000) I: [pulseaudio] resampler.c: Using s16le as working format. (1539.838| 0.000) D: [pulseaudio] resampler.c: Resampler: (1539.838| 0.000) D: [pulseaudio] resampler.c: rate 48000 - 48000 (method copy), (1539.838| 0.000) D: [pulseaudio] resampler.c: format float32le - s16le (intermediate s16le), (1539.838| 0.000) D: [pulseaudio] resampler.c: channels 2 - 2 (resampling 2) (1539.838| 0.000) D: [pulseaudio] memblockq.c: memblockq requested: maxlength=33554432, tlength=0, base=4, prebuf=0, minreq=1 maxrewind=0 (1539.838| 0.000) D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=33554432, tlength=33554432, base=4, prebuf=0, minreq=4 maxrewind=0 (1539.838| 0.000) I: [pulseaudio] sink-input.c: Created input 73961 ALSA Playback on alsa_output.pci-_00_1b.0.analog-stereo with sample spec float32le 2ch 48000Hz and channel map front-left,front-right verbose log in attachment. -- Mancausoft - http://www.mancausoft.org/ GPG key: B53F90F2 (1539.834| 0.000) I: [pulseaudio] sink-input.c: Created input 73959 ALSA Playback on alsa_output.pci-_00_1b.0.analog-stereo with sample spec float32le 2ch 48000Hz and channel map front-left,front-right (1539.834| 0.000) I: [pulseaudio] sink-input.c: media.name = ALSA Playback (1539.834| 0.000) I: [pulseaudio] sink-input.c: application.name = ALSA plug-in [wine-preloader] (1539.834| 0.000) I: [pulseaudio] sink-input.c: native-protocol.peer = UNIX socket client (1539.834| 0.000) I: [pulseaudio] sink-input.c: native-protocol.version = 28 (1539.834| 0.000) I: [pulseaudio] sink-input.c: application.process.id = 24998 (1539.834| 0.000) I: [pulseaudio] sink-input.c: application.process.user = andrea (1539.834| 0.000) I: [pulseaudio] sink-input.c: application.process.host = mrburns (1539.834| 0.000) I: [pulseaudio] sink-input.c: application.process.binary = wine-preloader (1539.834| 0.000) I: [pulseaudio] sink-input.c: application.language = it_IT.UTF-8 (1539.834| 0.000) I: [pulseaudio] sink-input.c: window.x11.display = :0 (1539.834| 0.000) I: [pulseaudio] sink-input.c: application.process.machine_id = 7135e97663f57205e2d64d9850d1d5a3 (1539.834| 0.000) I: [pulseaudio] sink-input.c: module-stream-restore.id = sink-input-by-application-name:ALSA plug-in [wine-preloader] (1539.834| 0.000) I: [pulseaudio] protocol-native.c: Requested tlength=40.00 ms, minreq=10.00 ms (1539.834| 0.000) D: [pulseaudio] protocol-native.c: Early requests mode enabled, configuring sink latency to minreq. (1539.834| 0.000) D: [pulseaudio] protocol-native.c: Requested latency=10.00 ms, Received latency=96.00 ms (1539.834| 0.000) D: [pulseaudio] memblockq.c: memblockq requested: maxlength=4194304, tlength=110592, base=8, prebuf=3840, minreq=36864 maxrewind=0 (1539.834| 0.000) D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=4194304, tlength=110592, base=8, prebuf=3840, minreq=36864 maxrewind=0 (1539.834| 0.000) I: [pulseaudio] protocol-native.c: Final latency 384.00 ms = 96.00 ms + 2*96.00 ms + 96.00 ms (1539.834| 0.000) D: [alsa-sink-CX20585 Analog] alsa-sink.c: Latency set to 96.00ms (1539.834| 0.000) D: [alsa-sink-CX20585 Analog] alsa-sink.c: hwbuf_unused=47104 (1539.834| 0.000) D: [alsa-sink-CX20585 Analog] alsa-sink.c: setting avail_min=12737 (1539.834| 0.000)
Bug#581624: pulseaudio: Stuttering playback from Wine
Package: pulseaudio Version: 0.9.21-1 Severity: normal I listen to music using Spotify running under Wine. Every now and then -- I don't know exactly how to provoke it, but leaving the machine idle for a few hours is usually good enough -- the audio output of Spotify is unlistenably choppy, and not in a way that recovers as described in #523389. I get the same problem on two machines running a squeeze/sid mix (one with a stock 686 kernel, one with a tuned low-latency kernel with PREEMPT and HZ=1000, specifically configured to keep JACK happy) and on my laptop which runs Ubuntu Lucid (with stock kernel). No, I'm not actually trying to run JACK at the same time as Spotify. I'm blaming PulseAudio for this because I've not found anything I can do to Spotify or Wine to make the choppiness go away, but if I set the card's profile to `off' and then back to whatever it was before, the sound immediately becomes fine. I have the following (deeply unpleasant) script saved as `~/bin/kick-pulseaudio'. It gets a lot of use. #! /bin/sh set -e pacmd list-cards | sed -n ' /^[[:space:]]*index: / { s/// h } /^[[:space:]]*active profile: \(.*\).*$/ { s//\1/ H x s/\ / / p } ' | while read index profile; do pacmd set-card-profile $index off /dev/null pacmd set-card-profile $index $profile /dev/null done I realise that this is probably very hard to track down. -- System Information: Debian Release: squeeze/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.31.9 (PREEMPT) Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages pulseaudio depends on: ii adduser 3.112 add and remove users and groups ii consolekit0.4.1-4framework for defining and trackin ii libasound21.0.22-2 shared library for ALSA applicatio ii libasyncns0 0.3-1 Asyncronous name service query lib ii libc6 2.10.2-6 Embedded GNU C Library: Shared lib ii libcap2 1:2.17-2 support for getting/setting POSIX. ii libdbus-1-3 1.2.24-1 simple interprocess messaging syst ii libgdbm3 1.8.3-9GNU dbm database routines (runtime ii libice6 2:1.0.6-1 X11 Inter-Client Exchange library ii libltdl7 2.2.6b-2 A system independent dlopen wrappe ii libpulse0 0.9.21-1 PulseAudio client libraries ii libsamplerate00.1.7-3Audio sample rate conversion libra ii libsm62:1.1.1-1 X11 Session Management library ii libsndfile1 1.0.21-2 Library for reading/writing audio ii libspeexdsp1 1.2~rc1-1 The Speex extended runtime library ii libudev0 153-2 libudev shared library ii libwrap0 7.6.q-18 Wietse Venema's TCP wrappers libra ii libx11-6 2:1.3.3-3 X11 client-side library ii libxtst6 2:1.1.0-2 X11 Testing -- Resource extension ii lsb-base 3.2-23.1 Linux Standard Base 3.2 init scrip ii udev 153-2 /dev/ and hotplug management daemo Versions of packages pulseaudio recommends: ii gstreamer0.10-pulseaudio 0.10.22-1 GStreamer plugin for PulseAudio ii libasound2-plugins1.0.22-1 ALSA library additional plugins ii pulseaudio-esound-compat 0.9.21-1 PulseAudio ESD compatibility layer ii pulseaudio-module-x11 0.9.21-1 X11 module for PulseAudio sound se Versions of packages pulseaudio suggests: ii paman 0.9.4-1PulseAudio Manager ii paprefs 0.9.9-2PulseAudio Preferences ii pavucontrol 0.9.9-1PulseAudio Volume Control ii pavumeter 0.9.3-1PulseAudio Volume Meter ii pulseaudio-utils 0.9.21-1 Command line tools for the PulseAu -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org