pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/audio/jack jack: Fix Sun driver on NetBSD and default ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4fbf421dbd52
branches:  trunk
changeset: 345071:4fbf421dbd52
user:      nia <nia%pkgsrc.org@localhost>
date:      Mon Dec 02 11:46:08 2019 +0000

description:
jack: Fix Sun driver on NetBSD and default to it over OSS.

Update usage instructions.

Bump PKGREVISION

diffstat:

 audio/jack/MESSAGE                                 |  24 ------
 audio/jack/MESSAGE.NetBSD                          |  20 +++++
 audio/jack/Makefile                                |  14 +--
 audio/jack/distinfo                                |   3 +-
 audio/jack/patches/patch-drivers_sun_sun__driver.c |  80 ++++++++++++++++++++++
 5 files changed, 108 insertions(+), 33 deletions(-)

diffs (190 lines):

diff -r 36abb224f567 -r 4fbf421dbd52 audio/jack/MESSAGE
--- a/audio/jack/MESSAGE        Mon Dec 02 11:45:46 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-===========================================================================
-$NetBSD: MESSAGE,v 1.1 2008/07/31 03:58:05 bjs Exp $
-
-NOTE:  Unfortunately, JACK wants to use a linux /proc filesystem to
-perform shared memory housekeeping tasks.  Therefore, if your platform
-supports a "Linux-compliant" proc filesystem, we recommend mounting one
-prior to using jack.  On NetBSD, this can be accomplished with the
-following command:
-
-               mount_procfs -orw,linux /proc <mount point>
-
-Conventionally, the mount point is /proc.  If you wish to use a different
-pathname for this filesystem, you may define the JACKD_PROCFS_PATH
-variable in your build environment or mk.conf as shown below.
-
-               JACKD_PROCFS_PATH= /emul/linux/proc
-
-ATTENTION:  NetBSD-current users who wish to run jackd with real-time
-           scheduling will likely find that the loader fails to mmap
-           the driver module(s) when using -R.  Until this issue is re-
-           solved, one may work around this problem by using the -m
-           (--no-mlock) option.
-
-===========================================================================
diff -r 36abb224f567 -r 4fbf421dbd52 audio/jack/MESSAGE.NetBSD
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/jack/MESSAGE.NetBSD Mon Dec 02 11:46:08 2019 +0000
@@ -0,0 +1,20 @@
+===========================================================================
+$NetBSD: MESSAGE.NetBSD,v 1.1 2019/12/02 11:46:08 nia Exp $
+
+Realtime support is currently problematic. When running jackd as non-root,
+you need to pass -r to disable it, e.g:
+
+`jackd -r -d sun`
+
+If you have an external mic:
+
+`jackd -r -d sun -P /dev/audio -C /dev/audio1`
+
+When running jackd as root you need to use the no-mlock option instead:
+
+`jackd -m -d sun`
+
+Note that to use JACK on NetBSD you need procfs mounted.
+This should be done by default.
+
+===========================================================================
diff -r 36abb224f567 -r 4fbf421dbd52 audio/jack/Makefile
--- a/audio/jack/Makefile       Mon Dec 02 11:45:46 2019 +0000
+++ b/audio/jack/Makefile       Mon Dec 02 11:46:08 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.38 2019/11/02 21:09:14 rillig Exp $
+# $NetBSD: Makefile,v 1.39 2019/12/02 11:46:08 nia Exp $
 
 DISTNAME=      jack-audio-connection-kit-0.125.0
-PKGREVISION=   1
+PKGREVISION=   2
 PKGNAME=       ${DISTNAME:S/audio-connection-kit-//}
 CATEGORIES=    audio
 MASTER_SITES=  http://jackaudio.org/downloads/
@@ -68,11 +68,9 @@
 .else
 CONFIGURE_ARGS+=       --disable-coreaudio
 .endif
-###
-### XXX The sun driver is buggy on NetBSD right now.  I hope to remedy
-###    this shortly.
-###
-.if ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD" || ${OPSYS} == "SunOS"
+
+.if ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD" || ${OPSYS} == "SunOS" || \
+    exists(/usr/include/sys/audioio.h)
 CONFIGURE_ARGS+=       --enable-sun
 PLIST.sunaudio=                yes
 .else
@@ -81,7 +79,7 @@
 
 .include "../../mk/oss.buildlink3.mk"
 
-.if ${OSS_TYPE} != "none"
+.if ${OSS_TYPE} != "none" && ${OPSYS} != "NetBSD" && ${OPSYS} != "SunOS"
 CONFIGURE_ARGS+=       --enable-oss
 PLIST.oss=             yes
 MAKE_ENV+=             LIBOSSAUDIO=${LIBOSSAUDIO}
diff -r 36abb224f567 -r 4fbf421dbd52 audio/jack/distinfo
--- a/audio/jack/distinfo       Mon Dec 02 11:45:46 2019 +0000
+++ b/audio/jack/distinfo       Mon Dec 02 11:46:08 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.21 2019/06/19 11:43:04 jperkin Exp $
+$NetBSD: distinfo,v 1.22 2019/12/02 11:46:08 nia Exp $
 
 SHA1 (jack-audio-connection-kit-0.125.0.tar.gz) = 6b7516b442878ffd1ca875310084b33d0edee400
 RMD160 (jack-audio-connection-kit-0.125.0.tar.gz) = 25f1baa1d8f03f0bbfc0b48c300b63d89d4e881b
@@ -11,6 +11,7 @@
 SHA1 (patch-drivers_netjack_netjack__packet.c) = eb70ec5644e960e0cf0258a15d763be31c11bb02
 SHA1 (patch-drivers_oss_oss__driver.c) = 302f20e82abde4a5b1678d2c3e9cbc8a63fad5ad
 SHA1 (patch-drivers_oss_oss__driver.h) = f23595db3fe80cae36ce222d89cdfbc37916e325
+SHA1 (patch-drivers_sun_sun__driver.c) = 0842e34e6190b8877ab7ac3d4d764a0de4cbfca8
 SHA1 (patch-include_engine.h) = c58651bccc910131ffc9b263a75fa732a7a2b168
 SHA1 (patch-jack_control.h) = 8d6f07fd226b68cacf170501f557503cd674249a
 SHA1 (patch-jack_types.h) = a58fcdafab7e014760287d763c944c8a77281f7f
diff -r 36abb224f567 -r 4fbf421dbd52 audio/jack/patches/patch-drivers_sun_sun__driver.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/jack/patches/patch-drivers_sun_sun__driver.c        Mon Dec 02 11:46:08 2019 +0000
@@ -0,0 +1,80 @@
+$NetBSD: patch-drivers_sun_sun__driver.c,v 1.1 2019/12/02 11:46:08 nia Exp $
+
+NetBSD support changes:
+
+- Don't try to poll() /dev/audio
+- Don't write silence to "prime" the driver
+- Block size does not relate to period
+- AUDIO_SETFD is deprecated
+
+--- drivers/sun/sun_driver.c.orig      2016-02-23 15:13:53.000000000 +0000
++++ drivers/sun/sun_driver.c
+@@ -383,7 +383,12 @@ sun_driver_run_cycle (sun_driver_t *driv
+       int wait_status;
+       float iodelay;
+ 
++#ifdef __NetBSD__
++      wait_status = 0;
++      nframes = driver->period_size;
++#else
+       nframes = sun_driver_wait (driver, &wait_status, &iodelay);
++#endif
+ 
+       if (wait_status < 0) {
+               switch (wait_status) {
+@@ -650,8 +655,10 @@ sun_driver_start (sun_driver_t *driver)
+                * be available to read before we can write.  also helps to
+                * keep constant latency from the beginning.
+                */
++#ifndef __NetBSD__
+               sun_driver_write_silence (driver,
+                                         driver->nperiods * driver->period_size);
++#endif
+       }
+ 
+       if (driver->infd >= 0) {
+@@ -732,7 +739,7 @@ sun_driver_set_parameters (sun_driver_t 
+                                   __FILE__, __LINE__);
+                       return -1;
+               }
+-#if defined(AUDIO_SETFD)
++#if defined(AUDIO_SETFD) && !defined(__NetBSD__)
+               if (ioctl (infd, AUDIO_SETFD, &s) < 0) {
+                       jack_error ("sun_driver: failed to enable full duplex: "
+                                   "%s: %s@%i", strerror (errno),
+@@ -797,15 +804,6 @@ sun_driver_set_parameters (sun_driver_t 
+               audio_if_out.play.block_size = driver->playback_channels *
+                                              driver->period_size * driver->sample_bytes;
+       }
+-#else
+-      if (driver->infd >= 0) {
+-              audio_if_in.blocksize = driver->capture_channels *
+-                                      driver->period_size * driver->sample_bytes;
+-      }
+-      if (driver->outfd >= 0) {
+-              audio_if_out.blocksize =  driver->playback_channels *
+-                                       driver->period_size * driver->sample_bytes;
+-      }
+ #endif
+       if (infd == outfd) {
+               audio_if_in.play = audio_if_out.play;
+@@ -871,9 +869,6 @@ sun_driver_set_parameters (sun_driver_t 
+ #if defined(__OpenBSD__)
+               cap_period = audio_if_in.record.block_size /
+                            driver->capture_channels / driver->sample_bytes;
+-#elif defined(__NetBSD__)
+-              cap_period = audio_if_in.blocksize /
+-                           driver->capture_channels / driver->sample_bytes;
+ #else
+               /* how is this done on Solaris? */
+               cap_period = driver->period_size;
+@@ -903,9 +898,6 @@ sun_driver_set_parameters (sun_driver_t 
+ #if defined(__OpenBSD__)
+               play_period = audio_if_out.play.block_size /
+                             driver->playback_channels / driver->sample_bytes;
+-#elif defined(__NetBSD__)
+-              play_period = audio_if_out.blocksize /
+-                            driver->playback_channels / driver->sample_bytes;
+ #else
+               /* how is this done on Solaris? */
+               play_period = driver->period_size;



Home | Main Index | Thread Index | Old Index