Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: pcaudiolib-1.1
@ 2020-11-15 21:39 joey-commits
  2020-11-16 15:52 ` joey-commits
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: joey-commits @ 2020-11-15 21:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

There is a new pull request by joey-commits against master on the void-packages repository

https://github.com/joey-commits/void-packages pcaudio
https://github.com/void-linux/void-packages/pull/26416

New package: pcaudiolib-1.1


A patch file from https://github.com/void-linux/void-packages/pull/26416.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pcaudio-26416.patch --]
[-- Type: text/x-diff, Size: 1951 bytes --]

From 8ba6c3b67f96b91ea6abe6c14afb9fbfd6aa408c Mon Sep 17 00:00:00 2001
From: Joey <joey@imap.cc>
Date: Sun, 15 Nov 2020 16:21:54 -0500
Subject: [PATCH] New package: pcaudiolib-1.1

---
 common/shlibs               |  1 +
 srcpkgs/pcaudiolib-devel    |  1 +
 srcpkgs/pcaudiolib/template | 28 ++++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 120000 srcpkgs/pcaudiolib-devel
 create mode 100644 srcpkgs/pcaudiolib/template

diff --git a/common/shlibs b/common/shlibs
index a32a8f994e0..ae957d6125e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3990,3 +3990,4 @@ liburing.so.1 liburing-0.7_1
 libbson-1.0.so.0 libbson-1.17.0_1
 libsonic.so.0 libsonic-0.2.0_1
 libtickit.so.3 libtickit-0.4.1_1
+libpcaudio.so.0 pcaudiolib-1.1_1
diff --git a/srcpkgs/pcaudiolib-devel b/srcpkgs/pcaudiolib-devel
new file mode 120000
index 00000000000..e1bc88225c6
--- /dev/null
+++ b/srcpkgs/pcaudiolib-devel
@@ -0,0 +1 @@
+pcaudiolib
\ No newline at end of file
diff --git a/srcpkgs/pcaudiolib/template b/srcpkgs/pcaudiolib/template
new file mode 100644
index 00000000000..d2a2b5e8009
--- /dev/null
+++ b/srcpkgs/pcaudiolib/template
@@ -0,0 +1,28 @@
+# Template file for 'pcaudiolib'
+pkgname=pcaudiolib
+version=1.1
+revision=1
+wrksrc=${pkgname}-${version}
+build_style=gnu-configure
+hostmakedepends="automake libtool which pkg-config"
+makedepends="alsa-lib-devel pulseaudio-devel"
+short_desc="Portable C Audio Library"
+maintainer="Joey <joey@imap.cc>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/espeak-ng/pcaudiolib"
+distfiles="https://github.com/espeak-ng/pcaudiolib/archive/${version}.tar.gz"
+checksum=699a5a347b1e12dc5b122e192e19f4db01621826bf41b9ebefb1cbc63ae2180b
+
+pre_configure() {
+	./autogen.sh
+}
+
+pcaudiolib-devel_package() {
+	depends="pcaudiolib>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.a"
+	}
+}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
@ 2020-11-16 15:52 ` joey-commits
  2020-11-16 15:52 ` [PR PATCH] [Closed]: " joey-commits
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joey-commits @ 2020-11-16 15:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]

New comment by joey-commits on void-packages repository

https://github.com/void-linux/void-packages/pull/26416#issuecomment-728149677

Comment:
Duplicate of 26384

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Closed]: New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
  2020-11-16 15:52 ` joey-commits
@ 2020-11-16 15:52 ` joey-commits
  2020-11-16 15:58 ` joey-commits
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joey-commits @ 2020-11-16 15:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

There's a closed pull request on the void-packages repository

New package: pcaudiolib-1.1
https://github.com/void-linux/void-packages/pull/26416

Description:


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
  2020-11-16 15:52 ` joey-commits
  2020-11-16 15:52 ` [PR PATCH] [Closed]: " joey-commits
@ 2020-11-16 15:58 ` joey-commits
  2020-11-16 21:09 ` [PR PATCH] [Updated] " joey-commits
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joey-commits @ 2020-11-16 15:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New comment by joey-commits on void-packages repository

https://github.com/void-linux/void-packages/pull/26416#issuecomment-728153446

Comment:
Original committer @skmpz asked me to reopen my pull request and closed theirs.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (2 preceding siblings ...)
  2020-11-16 15:58 ` joey-commits
@ 2020-11-16 21:09 ` joey-commits
  2020-11-16 21:30 ` joey-commits
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joey-commits @ 2020-11-16 21:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

There is an updated pull request by joey-commits against master on the void-packages repository

https://github.com/joey-commits/void-packages pcaudio
https://github.com/void-linux/void-packages/pull/26416

New package: pcaudiolib-1.1


A patch file from https://github.com/void-linux/void-packages/pull/26416.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pcaudio-26416.patch --]
[-- Type: text/x-diff, Size: 6258 bytes --]

From 5842603ba8a4b06b32a3a2a251ee5c64cab0e9e6 Mon Sep 17 00:00:00 2001
From: Joey <joey@imap.cc>
Date: Sun, 15 Nov 2020 16:21:54 -0500
Subject: [PATCH] New package: pcaudiolib-1.1

---
 common/shlibs                                 |  1 +
 srcpkgs/pcaudiolib-devel                      |  1 +
 .../upstream-fix-alsa-sample-size.patch       | 19 +++++
 .../patches/upstream-fix-snappiness.patch     | 76 +++++++++++++++++++
 srcpkgs/pcaudiolib/template                   | 28 +++++++
 5 files changed, 125 insertions(+)
 create mode 120000 srcpkgs/pcaudiolib-devel
 create mode 100644 srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch
 create mode 100644 srcpkgs/pcaudiolib/patches/upstream-fix-snappiness.patch
 create mode 100644 srcpkgs/pcaudiolib/template

diff --git a/common/shlibs b/common/shlibs
index a32a8f994e0..ae957d6125e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3990,3 +3990,4 @@ liburing.so.1 liburing-0.7_1
 libbson-1.0.so.0 libbson-1.17.0_1
 libsonic.so.0 libsonic-0.2.0_1
 libtickit.so.3 libtickit-0.4.1_1
+libpcaudio.so.0 pcaudiolib-1.1_1
diff --git a/srcpkgs/pcaudiolib-devel b/srcpkgs/pcaudiolib-devel
new file mode 120000
index 00000000000..e1bc88225c6
--- /dev/null
+++ b/srcpkgs/pcaudiolib-devel
@@ -0,0 +1 @@
+pcaudiolib
\ No newline at end of file
diff --git a/srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch b/srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch
new file mode 100644
index 00000000000..8fe68794577
--- /dev/null
+++ b/srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch
@@ -0,0 +1,19 @@
+commit d6a6b00aa4334b461c1a09c27b6c681eaac8da8a
+Author: Martin Schreiber <mse00000@gmail.com>
+Date:   Sat Mar 10 06:55:58 2018 +0100
+
+    * Alsa: fixed sample_size calculation, multiply with channel count.
+
+diff --git src/alsa.c src/alsa.c
+index 34e39be..6af1941 100644
+--- src/alsa.c
++++ src/alsa.c
+@@ -53,7 +53,7 @@ alsa_object_open(struct audio_object *object,
+ 		return -EEXIST;
+ 
+ 	snd_pcm_format_t pcm_format;
+-#define FORMAT(srcfmt, dstfmt, size) case srcfmt: pcm_format = dstfmt; self->sample_size = size; break;
++#define FORMAT(srcfmt, dstfmt, size) case srcfmt: pcm_format = dstfmt; self->sample_size = size*channels; break;
+ 	switch (format)
+ 	{
+ 	FORMAT(AUDIO_OBJECT_FORMAT_ALAW,      SND_PCM_FORMAT_A_LAW, 1)
diff --git a/srcpkgs/pcaudiolib/patches/upstream-fix-snappiness.patch b/srcpkgs/pcaudiolib/patches/upstream-fix-snappiness.patch
new file mode 100644
index 00000000000..4ea1a613b38
--- /dev/null
+++ b/srcpkgs/pcaudiolib/patches/upstream-fix-snappiness.patch
@@ -0,0 +1,76 @@
+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 src/alsa.c src/alsa.c
+index 64d5a90..c856788 100644
+--- src/alsa.c
++++ 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 src/audio_priv.h src/audio_priv.h
+index 9526138..669a037 100644
+--- src/audio_priv.h
++++ 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 src/pulseaudio.c src/pulseaudio.c
+index d23366d..2f80c62 100644
+--- src/pulseaudio.c
++++ 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 --git a/srcpkgs/pcaudiolib/template b/srcpkgs/pcaudiolib/template
new file mode 100644
index 00000000000..d2a2b5e8009
--- /dev/null
+++ b/srcpkgs/pcaudiolib/template
@@ -0,0 +1,28 @@
+# Template file for 'pcaudiolib'
+pkgname=pcaudiolib
+version=1.1
+revision=1
+wrksrc=${pkgname}-${version}
+build_style=gnu-configure
+hostmakedepends="automake libtool which pkg-config"
+makedepends="alsa-lib-devel pulseaudio-devel"
+short_desc="Portable C Audio Library"
+maintainer="Joey <joey@imap.cc>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/espeak-ng/pcaudiolib"
+distfiles="https://github.com/espeak-ng/pcaudiolib/archive/${version}.tar.gz"
+checksum=699a5a347b1e12dc5b122e192e19f4db01621826bf41b9ebefb1cbc63ae2180b
+
+pre_configure() {
+	./autogen.sh
+}
+
+pcaudiolib-devel_package() {
+	depends="pcaudiolib>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.a"
+	}
+}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (3 preceding siblings ...)
  2020-11-16 21:09 ` [PR PATCH] [Updated] " joey-commits
@ 2020-11-16 21:30 ` joey-commits
  2020-12-13 10:39 ` joey-commits
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joey-commits @ 2020-11-16 21:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

New comment by joey-commits on void-packages repository

https://github.com/void-linux/void-packages/pull/26416#issuecomment-728340465

Comment:
I would appreciate feedback on whether I formatted the patches correctly. These fix some issues when espeakup is used with espeak-ng.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (4 preceding siblings ...)
  2020-11-16 21:30 ` joey-commits
@ 2020-12-13 10:39 ` joey-commits
  2020-12-13 12:53 ` [PR REVIEW] " Duncaen
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joey-commits @ 2020-12-13 10:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

New comment by joey-commits on void-packages repository

https://github.com/void-linux/void-packages/pull/26416#issuecomment-743986161

Comment:
Is there any chance that someone may have time to comment on this one? I desire to get this into the repos because then I can add espeak-ng which works better with the Orca and espeakup assistive technologies which I use frequently. Espeak-ng is also recently having a new Klatt synthesis functionality which is easier on some folks ears. If someone clears this, I will immediately resolve the conflicts in common/shlibs so the merge can take place.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (5 preceding siblings ...)
  2020-12-13 10:39 ` joey-commits
@ 2020-12-13 12:53 ` Duncaen
  2020-12-13 12:53 ` Duncaen
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Duncaen @ 2020-12-13 12:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

New review comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/26416#discussion_r541919652

Comment:
This is the default value for `wrksrc`.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (6 preceding siblings ...)
  2020-12-13 12:53 ` [PR REVIEW] " Duncaen
@ 2020-12-13 12:53 ` Duncaen
  2020-12-13 20:52 ` [PR PATCH] [Updated] " joey-commits
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Duncaen @ 2020-12-13 12:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

New review comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/26416#discussion_r541919156

Comment:
```suggestion
	depends="${sourcepkg}>=${version}_${revision}"
```

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (7 preceding siblings ...)
  2020-12-13 12:53 ` Duncaen
@ 2020-12-13 20:52 ` joey-commits
  2020-12-13 23:52 ` joey-commits
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joey-commits @ 2020-12-13 20:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

There is an updated pull request by joey-commits against master on the void-packages repository

https://github.com/joey-commits/void-packages pcaudio
https://github.com/void-linux/void-packages/pull/26416

New package: pcaudiolib-1.1


A patch file from https://github.com/void-linux/void-packages/pull/26416.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pcaudio-26416.patch --]
[-- Type: text/x-diff, Size: 6230 bytes --]

From 6b7b2cd1d5c2eaac57d3139d725ec6515c71ec7c Mon Sep 17 00:00:00 2001
From: Joey <joey@imap.cc>
Date: Sun, 15 Nov 2020 16:21:54 -0500
Subject: [PATCH] New package: pcaudiolib-1.1

---
 common/shlibs                                 |  1 +
 srcpkgs/pcaudiolib-devel                      |  1 +
 .../upstream-fix-alsa-sample-size.patch       | 19 +++++
 .../patches/upstream-fix-snappiness.patch     | 76 +++++++++++++++++++
 srcpkgs/pcaudiolib/template                   | 27 +++++++
 5 files changed, 124 insertions(+)
 create mode 120000 srcpkgs/pcaudiolib-devel
 create mode 100644 srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch
 create mode 100644 srcpkgs/pcaudiolib/patches/upstream-fix-snappiness.patch
 create mode 100644 srcpkgs/pcaudiolib/template

diff --git a/common/shlibs b/common/shlibs
index 4b30e6dbd23..c5d81789d66 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4001,3 +4001,4 @@ libnotcurses++.so.2 notcurses-2.0.4_1
 libevemu.so.3 evemu-2.7.0_1
 libantilib.so.1 libantimicrox-3.1.2_1
 libinih.so.0 inih-52_1
+libpcaudio.so.0 pcaudiolib-1.1_1
diff --git a/srcpkgs/pcaudiolib-devel b/srcpkgs/pcaudiolib-devel
new file mode 120000
index 00000000000..e1bc88225c6
--- /dev/null
+++ b/srcpkgs/pcaudiolib-devel
@@ -0,0 +1 @@
+pcaudiolib
\ No newline at end of file
diff --git a/srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch b/srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch
new file mode 100644
index 00000000000..8fe68794577
--- /dev/null
+++ b/srcpkgs/pcaudiolib/patches/upstream-fix-alsa-sample-size.patch
@@ -0,0 +1,19 @@
+commit d6a6b00aa4334b461c1a09c27b6c681eaac8da8a
+Author: Martin Schreiber <mse00000@gmail.com>
+Date:   Sat Mar 10 06:55:58 2018 +0100
+
+    * Alsa: fixed sample_size calculation, multiply with channel count.
+
+diff --git src/alsa.c src/alsa.c
+index 34e39be..6af1941 100644
+--- src/alsa.c
++++ src/alsa.c
+@@ -53,7 +53,7 @@ alsa_object_open(struct audio_object *object,
+ 		return -EEXIST;
+ 
+ 	snd_pcm_format_t pcm_format;
+-#define FORMAT(srcfmt, dstfmt, size) case srcfmt: pcm_format = dstfmt; self->sample_size = size; break;
++#define FORMAT(srcfmt, dstfmt, size) case srcfmt: pcm_format = dstfmt; self->sample_size = size*channels; break;
+ 	switch (format)
+ 	{
+ 	FORMAT(AUDIO_OBJECT_FORMAT_ALAW,      SND_PCM_FORMAT_A_LAW, 1)
diff --git a/srcpkgs/pcaudiolib/patches/upstream-fix-snappiness.patch b/srcpkgs/pcaudiolib/patches/upstream-fix-snappiness.patch
new file mode 100644
index 00000000000..4ea1a613b38
--- /dev/null
+++ b/srcpkgs/pcaudiolib/patches/upstream-fix-snappiness.patch
@@ -0,0 +1,76 @@
+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 src/alsa.c src/alsa.c
+index 64d5a90..c856788 100644
+--- src/alsa.c
++++ 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 src/audio_priv.h src/audio_priv.h
+index 9526138..669a037 100644
+--- src/audio_priv.h
++++ 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 src/pulseaudio.c src/pulseaudio.c
+index d23366d..2f80c62 100644
+--- src/pulseaudio.c
++++ 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 --git a/srcpkgs/pcaudiolib/template b/srcpkgs/pcaudiolib/template
new file mode 100644
index 00000000000..7f40e0388e1
--- /dev/null
+++ b/srcpkgs/pcaudiolib/template
@@ -0,0 +1,27 @@
+# Template file for 'pcaudiolib'
+pkgname=pcaudiolib
+version=1.1
+revision=1
+build_style=gnu-configure
+hostmakedepends="automake libtool which pkg-config"
+makedepends="alsa-lib-devel pulseaudio-devel"
+short_desc="Portable C Audio Library"
+maintainer="Joey <joey@imap.cc>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/espeak-ng/pcaudiolib"
+distfiles="https://github.com/espeak-ng/pcaudiolib/archive/${version}.tar.gz"
+checksum=699a5a347b1e12dc5b122e192e19f4db01621826bf41b9ebefb1cbc63ae2180b
+
+pre_configure() {
+	./autogen.sh
+}
+
+pcaudiolib-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.a"
+	}
+}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (8 preceding siblings ...)
  2020-12-13 20:52 ` [PR PATCH] [Updated] " joey-commits
@ 2020-12-13 23:52 ` joey-commits
  2020-12-14 13:36 ` [PR PATCH] [Merged]: " ericonr
  2020-12-14 13:36 ` ericonr
  11 siblings, 0 replies; 13+ messages in thread
From: joey-commits @ 2020-12-13 23:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

New comment by joey-commits on void-packages repository

https://github.com/void-linux/void-packages/pull/26416#issuecomment-744091387

Comment:
Thank you very much for the feedback. I have performed the suggested fixes.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Merged]: New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (9 preceding siblings ...)
  2020-12-13 23:52 ` joey-commits
@ 2020-12-14 13:36 ` ericonr
  2020-12-14 13:36 ` ericonr
  11 siblings, 0 replies; 13+ messages in thread
From: ericonr @ 2020-12-14 13:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

There's a merged pull request on the void-packages repository

New package: pcaudiolib-1.1
https://github.com/void-linux/void-packages/pull/26416

Description:


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: New package: pcaudiolib-1.1
  2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
                   ` (10 preceding siblings ...)
  2020-12-14 13:36 ` [PR PATCH] [Merged]: " ericonr
@ 2020-12-14 13:36 ` ericonr
  11 siblings, 0 replies; 13+ messages in thread
From: ericonr @ 2020-12-14 13:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26416#issuecomment-744444695

Comment:
This will have to wait a while to appear on all systems, since chromium is currently being built.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-12-14 13:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 21:39 [PR PATCH] New package: pcaudiolib-1.1 joey-commits
2020-11-16 15:52 ` joey-commits
2020-11-16 15:52 ` [PR PATCH] [Closed]: " joey-commits
2020-11-16 15:58 ` joey-commits
2020-11-16 21:09 ` [PR PATCH] [Updated] " joey-commits
2020-11-16 21:30 ` joey-commits
2020-12-13 10:39 ` joey-commits
2020-12-13 12:53 ` [PR REVIEW] " Duncaen
2020-12-13 12:53 ` Duncaen
2020-12-13 20:52 ` [PR PATCH] [Updated] " joey-commits
2020-12-13 23:52 ` joey-commits
2020-12-14 13:36 ` [PR PATCH] [Merged]: " ericonr
2020-12-14 13:36 ` ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).