[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#972814: marked as done (buster-pu: package pcaudiolib/1.1-3+deb10u1)



Your message dated Sat, 05 Dec 2020 11:02:00 +0000
with message-id <b70f86aac27195271a9b5212c7acc936da6ff100.camel@adam-barratt.org.uk>
and subject line Closing bugs for updates in 10.7 point release
has caused the Debian Bug report #972814,
regarding buster-pu: package pcaudiolib/1.1-3+deb10u1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
972814: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972814
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian.org@packages.debian.org
Usertags: pu

Hello,

[ Reason ]
It was reported on the speakup mailing list that some people were
getting speak mixture when e.g. moving fast between lines. More
precisely, the speak for a line would not stop fast enough before the
speak for the next line would happen. We could determine that it is
due to pcaudiolib letting pulseaudio and alsa use a long audio buffer,
which thus keeps getting played. In order to stop audio processing soon
enough, a smaller buffer needs to be set, just like speech-dispatcher
does. This is a regression with respect to Debian 8 in which espeakup
was not using pcaudiolib.

[ Impact ]
Some users are saying that this makes using espeakup very tedious,
others say that it is unusable and have downgraded to Debian 8.

Yes, the user bug report latency is that long :/ ...

[ Tests ]
One way to trigger this is to run espeakup in qemu, play some audio
in some VT to keep the audio card and the dmix plugin up, and run
espeakup. Using speakup+7 and speakup+9 to switch between lines, one can
notice the mixture of the lines speaks.

[ Risks ]
The code only changes the buffering parameters requested from alsa and
pulseaudio, all other parameters are left unchanged.

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
This patches the alsa and pulseaudio backends. It makes the alsa backend
call snd_pcm_hw_params_set_buffer_size_near with 10ms worth of audio. It
makes the pulseaudio backend pass a non-default buffer attr structure.

-- 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, '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.9.0 (SMP w/8 CPU threads)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- 
Samuel
  bien s?r que ?a convient mieux ? tout le monde
  enfin, dans la mesure o? tout le monde c'est comme moi
 -+- le consensus, c'est facile -+-
diff -Nru pcaudiolib-1.1/debian/changelog pcaudiolib-1.1/debian/changelog
--- pcaudiolib-1.1/debian/changelog	2018-10-23 18:33:37.000000000 +0200
+++ pcaudiolib-1.1/debian/changelog	2020-10-24 11:37:02.000000000 +0200
@@ -1,3 +1,9 @@
+pcaudiolib (1.1-3+deb10u1) buster; urgency=medium
+
+  * patches/cancel: Cap cancellation latency to 10ms.
+
+ -- Samuel Thibault <sthibault@debian.org>  Sat, 24 Oct 2020 11:37:02 +0200
+
 pcaudiolib (1.1-3) unstable; urgency=medium
 
   * control: Bump Standards-Version to 4.2.0 (no changes).
diff -Nru pcaudiolib-1.1/debian/patches/cancel pcaudiolib-1.1/debian/patches/cancel
--- pcaudiolib-1.1/debian/patches/cancel	1970-01-01 01:00:00.000000000 +0100
+++ pcaudiolib-1.1/debian/patches/cancel	2020-10-18 23:06:20.000000000 +0200
@@ -0,0 +1,79 @@
+Submitted: https://github.com/espeak-ng/pcaudiolib/pull/6
+commited
+
+commit a41d46e816d2cbcd93564c42b65a87af547bcb2d
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date:   Sun Oct 11 17:34:57 2020 +0200
+
+    Fix cancellation snappiness
+    
+    Screen reader users report getting late cancellation, or even mixtures
+    of speech. This is because the default buffering parameters of alsa or
+    pulseaudio are relatively large.
+    
+    This change sets alsa and pulseaudio buffer sizes to 10ms worth of audio,
+    which is the human snappiness perception limit.
+
+diff --git a/src/alsa.c b/src/alsa.c
+index 64d5a90..c856788 100644
+--- a/src/alsa.c
++++ b/src/alsa.c
+@@ -99,6 +99,7 @@ alsa_object_open(struct audio_object *object,
+ 
+ 	snd_pcm_hw_params_t *params = NULL;
+ 	snd_pcm_hw_params_malloc(&params);
++	snd_pcm_uframes_t bufsize = (rate * channels * LATENCY) / 1000;
+ 
+ 	int err = 0;
+ 	if ((err = snd_pcm_open(&self->handle, self->device ? self->device : "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0)
+@@ -113,6 +114,8 @@ alsa_object_open(struct audio_object *object,
+ 		goto error;
+ 	if ((err = snd_pcm_hw_params_set_channels(self->handle, params, channels)) < 0)
+ 		goto error;
++	if ((err = snd_pcm_hw_params_set_buffer_size_near(self->handle, params, &bufsize)) < 0)
++		goto error;
+ 	if ((err = snd_pcm_hw_params(self->handle, params)) < 0)
+ 		goto error;
+ 	if ((err = snd_pcm_prepare(self->handle)) < 0)
+diff --git a/src/audio_priv.h b/src/audio_priv.h
+index 9526138..669a037 100644
+--- a/src/audio_priv.h
++++ b/src/audio_priv.h
+@@ -52,6 +52,10 @@ struct audio_object
+ 	                         int error);
+ };
+ 
++/* We try to aim for 10ms cancelation latency, which will be perceived as
++ * "snappy" by users */
++#define LATENCY 10
++
+ #if defined(_WIN32) || defined(_WIN64)
+ 
+ #include <windows.h>
+diff --git a/src/pulseaudio.c b/src/pulseaudio.c
+index d23366d..2f80c62 100644
+--- a/src/pulseaudio.c
++++ b/src/pulseaudio.c
+@@ -74,6 +74,13 @@ pulseaudio_object_open(struct audio_object *object,
+ 	}
+ 
+ 	int error = 0;
++	pa_buffer_attr battr;
++
++	battr.fragsize = (uint32_t) -1;
++	battr.maxlength = (uint32_t) -1;
++	battr.minreq = (uint32_t) -1;
++	battr.prebuf = (uint32_t) -1;
++	battr.tlength = pa_bytes_per_second(&self->ss) * LATENCY / 1000;
+ 	self->s = pa_simple_new(NULL,
+ 	                        self->application_name,
+ 	                        PA_STREAM_PLAYBACK,
+@@ -81,7 +88,7 @@ pulseaudio_object_open(struct audio_object *object,
+ 	                        self->description,
+ 	                        &self->ss,
+ 	                        NULL,
+-	                        NULL,
++	                        &battr,
+ 	                        &error);
+ 	return error;
+ }
diff -Nru pcaudiolib-1.1/debian/patches/series pcaudiolib-1.1/debian/patches/series
--- pcaudiolib-1.1/debian/patches/series	2018-06-17 18:48:40.000000000 +0200
+++ pcaudiolib-1.1/debian/patches/series	2020-10-11 21:15:42.000000000 +0200
@@ -1,2 +1,3 @@
 non-linux
 sample_size_fix
+cancel

--- End Message ---
--- Begin Message ---
Package: release.debian.org
Version: 10.7

Hi,

Each of the updates referenced by these bugs was included in this
morning's buster 10.7 point release.

Regards,

Adam

--- End Message ---

Reply to: