ports/183861: [patch] audio/alsa-plugins: always use ARIFF_OSS by default, again

Jan Beich jbeich at tormail.org
Mon Nov 11 14:40:01 UTC 2013


>Number:         183861
>Category:       ports
>Synopsis:       [patch] audio/alsa-plugins: always use ARIFF_OSS by default, again
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 11 14:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Jan Beich
>Release:        
>Organization:
>Environment:
mplayer
firefox
chromium

>Description:
Restore behavior from r296140 while adding alignment options in case
of issues. This should make things slightly less broken and add more
sample formats.

>How-To-Repeat:

>Fix:
--- oss_options.diff begins here ---
Index: UPDATING
===================================================================
--- UPDATING	(revision 333423)
+++ UPDATING	(working copy)
@@ -2008,7 +2008,7 @@ you update your ports collection, before attemptin
 
   When using Firefox or SeaMonkey compiled with ALSA option ON it may
   crash on assert in alsa_refill_stream as described in ports/170473.
-  To workaround disable ARIFF_OSS in audio/alsa-plugins or use PULSEAUDIO.
+  To workaround enable BUFSZ_P2 in audio/alsa-plugins or use PULSEAUDIO.
 
 20121010:
   AFFECTS: users of CURRENT (OSVERSION >= 1000017)
Index: audio/alsa-plugins/Makefile
===================================================================
--- audio/alsa-plugins/Makefile	(revision 333423)
+++ audio/alsa-plugins/Makefile	(working copy)
@@ -17,17 +17,38 @@ USE_BZIP2=	yes
 GNU_CONFIGURE=	yes
 USES=		pkgconfig
 LDFLAGS+=	-L${LOCALBASE}/lib
+EXTRA_PATCHES+=	${FILESDIR}/alsa-plugins.patch
 
-OPTIONS_DEFINE=	ARIFF_OSS JACK FFMPEG PULSEAUDIO SAMPLERATE SPEEX
+OPTIONS_DEFAULT=BUFSZ_P2 IO_PTR
+OPTIONS_DEFINE=	JACK FFMPEG PULSEAUDIO SAMPLERATE SPEEX
 OPTIONS_SUB=	${OPTIONS_DEFINE}
-ARIFF_OSS_DESC=	FreeBSD-specific OSS plugin
 
+OPTIONS_GROUP=	OSS
+OPTIONS_GROUP_OSS=IO_PTR BLKCNT_P2 BUFSZ_P2 VERBOSE
+
+IO_PTR_DESC=	Precise playback/recording pointer
+BLKCNT_P2_DESC=	Restrict number of fragments to ^2 aligned
+BUFSZ_P2_DESC=	Restrict buffer size to ^2 aligned (breaks aplay)
+VERBOSE_DESC=	Print debugging messages
+
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MARIFF_OSS}
-EXTRA_PATCHES+=	${FILESDIR}/alsa-plugins.patch
+.if ${PORT_OPTIONS:MIO_PTR}
+CFLAGS+=	-DFREEBSD_OSS_USE_IO_PTR
 .endif
 
+.if ${PORT_OPTIONS:MBLKCNT_P2}
+CFLAGS+=	-DFREEBSD_OSS_BLKCNT_P2
+.endif
+
+.if ${PORT_OPTIONS:MBUFSZ_P2}
+CFLAGS+=	-DFREEBSD_OSS_BUFSZ_P2
+.endif
+
+.if ${PORT_OPTIONS:MVERBOSE}
+CFLAGS+=	-DFREEBSD_OSS_DEBUG_VERBOSE
+.endif
+
 .if ${PORT_OPTIONS:MJACK}
 .if empty(PORT_OPTIONS:MSAMPLERATE)
 IGNORE=			JACK audio support requires SAMPLERATE
Index: audio/alsa-plugins/files/alsa-plugins.patch
===================================================================
--- audio/alsa-plugins/files/alsa-plugins.patch	(revision 333423)
+++ audio/alsa-plugins/files/alsa-plugins.patch	(working copy)
@@ -42,7 +42,7 @@
  	oss->ext.private_data = oss;
 --- oss/pcm_oss.c.orig	2009-08-31 21:09:41.000000000 +0800
 +++ oss/pcm_oss.c	2009-09-28 14:54:12.000000000 +0800
-@@ -22,17 +22,55 @@
+@@ -22,17 +22,48 @@
  #include <sys/ioctl.h>
  #include <alsa/asoundlib.h>
  #include <alsa/pcm_external.h>
@@ -54,18 +54,11 @@
 +#define ARRAY_SIZE(x)	(sizeof(x) / sizeof(*(x)))
 +
 +#ifdef __FreeBSD__
-+/* #define FREEBSD_OSS_USE_IO_PTR	1 */
-+/* #define FREEBSD_OSS_BLKCNT_P2	1 */
-+/* #define FREEBSD_OSS_DEBUG_VERBOSE	1 */
-+#undef FREEBSD_OSS_USE_IO_PTR	/* _IPTR is buggy ... Grr... */
-+#undef FREEBSD_OSS_BLKCNT_P2
-+#undef FREEBSD_OSS_DEBUG_VERBOSE
-+
 +#define FREEBSD_OSS_RATE_MIN	1
 +#define FREEBSD_OSS_RATE_MAX	384000
 +
 +#define FREEBSD_OSS_CHANNELS_MIN	1
-+#if __FreeBSD_version >= 800096
++#ifndef __DragonFly__
 +#define FREEBSD_OSS_CHANNELS_MAX	8
 +#else
 +#define FREEBSD_OSS_CHANNELS_MAX	2
@@ -73,7 +66,7 @@
 +
 +#define FREEBSD_OSS_BUFSZ_MAX	131072
 +#define FREEBSD_OSS_BLKCNT_MIN	2
-+#define FREEBSD_OSS_BLKSZ_MIN	16 /* (FREEBSD_OSS_CHANNEL_MAX * 4) */
++#define FREEBSD_OSS_BLKSZ_MIN	16 /* (FREEBSD_OSS_CHANNELS_MAX * 4) */
 +
 +#define FREEBSD_OSS_BUFSZ_MIN	(FREEBSD_OSS_BLKCNT_MIN * FREEBSD_OSS_BLKSZ_MIN)
 +#define FREEBSD_OSS_BLKCNT_MAX	(FREEBSD_OSS_BUFSZ_MAX / FREEBSD_OSS_BUFSZ_MIN)
@@ -461,7 +454,7 @@
  
  	if ((flags = fcntl(oss->fd, F_GETFL)) < 0) {
  		err = -errno;
-@@ -229,10 +530,128 @@
+@@ -229,10 +530,146 @@
  	return 0;
  }
  
@@ -478,6 +471,9 @@
 +#ifdef FREEBSD_OSS_BLKCNT_P2
 +	unsigned int period_list[30];
 +#endif
++#ifdef FREEBSD_OSS_BUFSZ_P2
++	unsigned int bufsz_list[30];
++#endif
 +	unsigned int nformats;
 +	unsigned int format[ARRAY_SIZE(oss_formats_tab)];
 +#if 0
@@ -580,6 +576,21 @@
 +	if (err < 0)
 +		return err;
 +
++#ifdef FREEBSD_OSS_BUFSZ_P2
++	tmp = 0;
++	for (i = 1; i < 31 && tmp < ARRAY_SIZE(bufsz_list); i++) {
++		if ((1 << i) > FREEBSD_OSS_BUFSZ_MAX)
++			break;
++		if ((1 << i) < FREEBSD_OSS_BUFSZ_MIN)
++			continue;
++		bufsz_list[tmp++] = 1 << i;
++	}
++
++	if (tmp > 0)
++		err = snd_pcm_ioplug_set_param_list(io,
++		    SND_PCM_IOPLUG_HW_BUFFER_BYTES, tmp, bufsz_list);
++	else
++#endif
 +	/* buffer size , not strictly ^2 */
 +	err = snd_pcm_ioplug_set_param_minmax(io,
 +	    SND_PCM_IOPLUG_HW_BUFFER_BYTES, FREEBSD_OSS_BUFSZ_MIN,
--- oss_options.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list