pkgsrc-Changes archive

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

CVS commit: pkgsrc/audio/pulseaudio



Module Name:    pkgsrc
Committed By:   tsutsui
Date:           Sun Sep  6 14:11:05 UTC 2026

Modified Files:
        pkgsrc/audio/pulseaudio: Makefile distinfo
        pkgsrc/audio/pulseaudio/patches: patch-src_modules_oss_module-oss.c

Log Message:
pulseaudio: fix excessive OSS playback latency on NetBSD

NetBSD audio(4) recalculates the track buffer geometry when
the sample format is changed. The module-oss currently sets
the requested fragment configuration before negotiating the
sample format, so the requested high-water mark is lost and
reset to the full track buffer.

With the 48 kHz 16-bit stereo format, this resulted in 65280-byte
output buffer (34 x 1920 byte fragments), corresponding to
~340 ms of playback latency (should be ~40 ms) on my environment.

Reapply the requested OSS fragment configuration after sample format
negotiation on NetBSD, both when initially opening and when resuming
the device.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 pkgsrc/audio/pulseaudio/Makefile
cvs rdiff -u -r1.89 -r1.90 pkgsrc/audio/pulseaudio/distinfo
cvs rdiff -u -r1.4 -r1.5 \
    pkgsrc/audio/pulseaudio/patches/patch-src_modules_oss_module-oss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/audio/pulseaudio/Makefile
diff -u pkgsrc/audio/pulseaudio/Makefile:1.190 pkgsrc/audio/pulseaudio/Makefile:1.191
--- pkgsrc/audio/pulseaudio/Makefile:1.190      Wed Sep  2 19:00:58 2026
+++ pkgsrc/audio/pulseaudio/Makefile    Sun Sep  6 14:11:05 2026
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.190 2026/09/02 19:00:58 wiz Exp $
+# $NetBSD: Makefile,v 1.191 2026/09/06 14:11:05 tsutsui Exp $
 
 DISTNAME=      pulseaudio-17.0
-PKGREVISION=   6
+PKGREVISION=   7
 CATEGORIES=    audio
 MASTER_SITES=  https://freedesktop.org/software/pulseaudio/releases/
 EXTRACT_SUFX=  .tar.xz

Index: pkgsrc/audio/pulseaudio/distinfo
diff -u pkgsrc/audio/pulseaudio/distinfo:1.89 pkgsrc/audio/pulseaudio/distinfo:1.90
--- pkgsrc/audio/pulseaudio/distinfo:1.89       Tue Dec 23 10:47:19 2025
+++ pkgsrc/audio/pulseaudio/distinfo    Sun Sep  6 14:11:05 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.89 2025/12/23 10:47:19 adam Exp $
+$NetBSD: distinfo,v 1.90 2026/09/06 14:11:05 tsutsui Exp $
 
 BLAKE2s (pulseaudio-17.0.tar.xz) = c024be2b80dac3f720d4245255578bc354096a94e47304a83efd31a7283e841d
 SHA512 (pulseaudio-17.0.tar.xz) = be0aec46204d9c9188a796fbe41b4cf6f0f5e6b16fa08ce359b8f0f51253f0ade364b89448bbf5faa2af7e59deb6c72194734c3233944250dcfd4f31968a5e97
@@ -7,7 +7,7 @@ SHA1 (patch-meson.build) = de85c2fd487db
 SHA1 (patch-src_daemon_meson.build) = 1747435b458d575abce44e21e39b4edeca2d4729
 SHA1 (patch-src_modules_gsettings_module-gsettings.c) = efd79599d8c165737fdb2caac5d38a13192ce553
 SHA1 (patch-src_modules_module-detect.c) = 72605c7d9392be7217dab2fbd9ecc85ed02021aa
-SHA1 (patch-src_modules_oss_module-oss.c) = d373b855138a931640be7bf5271a33b402b549e5
+SHA1 (patch-src_modules_oss_module-oss.c) = 5ab641baed21150a6f51c2487747bd20532de758
 SHA1 (patch-src_modules_raop_raop-client.h) = 9fb7ae86a6852022f53aee3765777bd136250ffb
 SHA1 (patch-src_pulse_meson.build) = 24e2ab191d2dd1ada879aa23caef8988ce654559
 SHA1 (patch-src_pulsecore_core-rtclock.c) = fddb3e56d3cce8e5f0220312fe15f67cd8897135

Index: pkgsrc/audio/pulseaudio/patches/patch-src_modules_oss_module-oss.c
diff -u pkgsrc/audio/pulseaudio/patches/patch-src_modules_oss_module-oss.c:1.4 pkgsrc/audio/pulseaudio/patches/patch-src_modules_oss_module-oss.c:1.5
--- pkgsrc/audio/pulseaudio/patches/patch-src_modules_oss_module-oss.c:1.4      Fri Jul 30 12:21:06 2021
+++ pkgsrc/audio/pulseaudio/patches/patch-src_modules_oss_module-oss.c  Sun Sep  6 14:11:05 2026
@@ -1,7 +1,10 @@
-$NetBSD: patch-src_modules_oss_module-oss.c,v 1.4 2021/07/30 12:21:06 ryoon Exp $
+$NetBSD: patch-src_modules_oss_module-oss.c,v 1.5 2026/09/06 14:11:05 tsutsui Exp $
 
 Set DEVOSSAUDIO value to fix default device on NetBSD at least.
 
+Fix excessive OSS playback latency on NetBSD by reapplying the
+requested OSS fragment after sample format negotiation.
+
 --- src/modules/oss/module-oss.c.orig  2021-07-27 20:02:27.777868700 +0000
 +++ src/modules/oss/module-oss.c
 @@ -95,7 +95,7 @@ PA_MODULE_USAGE(
@@ -13,3 +16,31 @@ Set DEVOSSAUDIO value to fix default dev
  
  struct userdata {
      pa_core *core;
+@@ -573,6 +573,14 @@ static int unsuspend(struct userdata *u)
+         goto fail;
+     }
+ 
++#ifdef __NetBSD__
++    if (u->nfrags >= 2 && u->frag_size >= 1)
++        if (pa_oss_set_fragments(u->fd, u->nfrags, u->orig_frag_size) < 0) {
++            pa_log_warn("Resume failed, couldn't restore fragment settings after format setup.");
++            goto fail;
++        }
++#endif
++
+     if (ioctl(u->fd, SNDCTL_DSP_GETBLKSIZE, &frag_size) < 0) {
+         pa_log_warn("SNDCTL_DSP_GETBLKSIZE: %s", pa_cstrerror(errno));
+         goto fail;
+@@ -1266,6 +1274,12 @@ int pa__init(pa_module*m) {
+     if (pa_oss_auto_format(fd, &ss) < 0)
+         goto fail;
+ 
++#ifdef __NetBSD__
++    if (nfrags >= 2 && frag_size >= 1)
++        if (pa_oss_set_fragments(fd, nfrags, frag_size) < 0)
++            goto fail;
++#endif
++
+     if (ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &frag_size) < 0) {
+         pa_log("SNDCTL_DSP_GETBLKSIZE: %s", pa_cstrerror(errno));
+         goto fail;



Home | Main Index | Thread Index | Old Index