Package: release.debian.org
Severity: normal
Tags: buster
User: [email protected]
Usertags: pu

Hello,

I have uploaded the attached change for buster.

The story dates back with #697637 and LP #1208826 which noted that
speech dispatcher requests very low latency (1ms) from pulseaudio to get
the maximum snappiness of speech feedback. This was frowned upon as
eating more CPU than needed, and patched over to increase the request to
20ms in version 0.8-1 of speech-dispatcher, as well as in upstream. That
patch however was not complete, it missed the attached change to
actually change the configuration default, so the requested latency
remained 1ms by default.

This was not so much a problem beyond a bit more battery drain so
far. But with more recent releases of pulseaudio, apparently data
transfer management with ALSA got bogus, to the point that this 1ms
request is currently making pulseaudio step over itself, which I
reported upstream:

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/871

The end-user visible result is that on computer start, the speech is
disturbed, scratchy, making it unusable, we have heard this with various
audio cards. This solves over time, once pulseaudio determines that it
gets underruns and should increase the latency beyond 1ms, but that can
take from seconds to minutes, thus really a pain for the user who just
wants to use the computer. I have proposed to upstream some patch to try
to detect the underruns more quickly, but I don't know pulseaudio enough
to determine whether it is safe.

That's why I'm proposing to just really increase the latency request in
speech-dispatcher (as was already planned to save battery) to avoid the
pulseaudio bug in Buster.

Samuel

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 
'proposed-updates'), (500, 'oldstable-proposed-updates-debug'), (500, 
'oldstable-proposed-updates'), (500, 'oldoldstable'), (500, 'buildd-unstable'), 
(500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 
'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.6.0 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru speech-dispatcher-0.9.0/debian/changelog 
speech-dispatcher-0.9.0/debian/changelog
--- speech-dispatcher-0.9.0/debian/changelog    2019-02-20 13:22:57.000000000 
+0100
+++ speech-dispatcher-0.9.0/debian/changelog    2020-05-02 12:05:06.000000000 
+0200
@@ -1,3 +1,10 @@
+speech-dispatcher (0.9.0-5+deb10u1) buster; urgency=medium
+
+  * patches/pulseaudio-latency: Fix default pulseaudio latency which triggers
+    pulseaudio scratchy output.
+
+ -- Samuel Thibault <[email protected]>  Sat, 02 May 2020 12:05:06 +0200
+
 speech-dispatcher (0.9.0-5) unstable; urgency=medium
 
   * control: Do not require exactly the same binary version of
diff -Nru speech-dispatcher-0.9.0/debian/patches/pulseaudio-latency 
speech-dispatcher-0.9.0/debian/patches/pulseaudio-latency
--- speech-dispatcher-0.9.0/debian/patches/pulseaudio-latency   1970-01-01 
01:00:00.000000000 +0100
+++ speech-dispatcher-0.9.0/debian/patches/pulseaudio-latency   2020-05-02 
12:00:39.000000000 +0200
@@ -0,0 +1,13 @@
+diff --git a/src/server/configuration.c b/src/server/configuration.c
+index 2d6cfaca..3623e342 100644
+--- a/src/server/configuration.c
++++ b/src/server/configuration.c
+@@ -473,7 +473,7 @@ void load_default_global_set_options()
+       GlobalFDSet.audio_alsa_device = g_strdup("default");
+       GlobalFDSet.audio_nas_server = g_strdup("tcp/localhost:5450");
+       GlobalFDSet.audio_pulse_server = g_strdup("default");
+-      GlobalFDSet.audio_pulse_min_length = 100;
++      GlobalFDSet.audio_pulse_min_length = 1764;
+ 
+       SpeechdOptions.max_history_messages = 10000;
+ 
diff -Nru speech-dispatcher-0.9.0/debian/patches/series 
speech-dispatcher-0.9.0/debian/patches/series
--- speech-dispatcher-0.9.0/debian/patches/series       2019-02-20 
13:22:53.000000000 +0100
+++ speech-dispatcher-0.9.0/debian/patches/series       2020-05-02 
12:00:48.000000000 +0200
@@ -2,3 +2,4 @@
 systemd-debian
 mbrola-paths
 ibmtts-shim
+pulseaudio-latency

Reply via email to