View | Details | Raw Unified | Return to bug 183861
Collapse All | Expand All

(-)UPDATING (-1 / +1 lines)
Lines 2008-2014 you update your ports collection, before attemptin Link Here
2008
2008
2009
  When using Firefox or SeaMonkey compiled with ALSA option ON it may
2009
  When using Firefox or SeaMonkey compiled with ALSA option ON it may
2010
  crash on assert in alsa_refill_stream as described in ports/170473.
2010
  crash on assert in alsa_refill_stream as described in ports/170473.
2011
  To workaround disable ARIFF_OSS in audio/alsa-plugins or use PULSEAUDIO.
2011
  To workaround enable BUFSZ_P2 in audio/alsa-plugins or use PULSEAUDIO.
2012
2012
2013
20121010:
2013
20121010:
2014
  AFFECTS: users of CURRENT (OSVERSION >= 1000017)
2014
  AFFECTS: users of CURRENT (OSVERSION >= 1000017)
(-)audio/alsa-plugins/Makefile (-4 / +25 lines)
Lines 17-33 USE_BZIP2= yes Link Here
17
GNU_CONFIGURE=	yes
17
GNU_CONFIGURE=	yes
18
USES=		pkgconfig
18
USES=		pkgconfig
19
LDFLAGS+=	-L${LOCALBASE}/lib
19
LDFLAGS+=	-L${LOCALBASE}/lib
20
EXTRA_PATCHES+=	${FILESDIR}/alsa-plugins.patch
20
21
21
OPTIONS_DEFINE=	ARIFF_OSS JACK FFMPEG PULSEAUDIO SAMPLERATE SPEEX
22
OPTIONS_DEFAULT=BUFSZ_P2 IO_PTR
23
OPTIONS_DEFINE=	JACK FFMPEG PULSEAUDIO SAMPLERATE SPEEX
22
OPTIONS_SUB=	${OPTIONS_DEFINE}
24
OPTIONS_SUB=	${OPTIONS_DEFINE}
23
ARIFF_OSS_DESC=	FreeBSD-specific OSS plugin
24
25
26
OPTIONS_GROUP=	OSS
27
OPTIONS_GROUP_OSS=IO_PTR BLKCNT_P2 BUFSZ_P2 VERBOSE
28
29
IO_PTR_DESC=	Precise playback/recording pointer
30
BLKCNT_P2_DESC=	Restrict number of fragments to ^2 aligned
31
BUFSZ_P2_DESC=	Restrict buffer size to ^2 aligned (breaks aplay)
32
VERBOSE_DESC=	Print debugging messages
33
25
.include <bsd.port.options.mk>
34
.include <bsd.port.options.mk>
26
35
27
.if ${PORT_OPTIONS:MARIFF_OSS}
36
.if ${PORT_OPTIONS:MIO_PTR}
28
EXTRA_PATCHES+=	${FILESDIR}/alsa-plugins.patch
37
CFLAGS+=	-DFREEBSD_OSS_USE_IO_PTR
29
.endif
38
.endif
30
39
40
.if ${PORT_OPTIONS:MBLKCNT_P2}
41
CFLAGS+=	-DFREEBSD_OSS_BLKCNT_P2
42
.endif
43
44
.if ${PORT_OPTIONS:MBUFSZ_P2}
45
CFLAGS+=	-DFREEBSD_OSS_BUFSZ_P2
46
.endif
47
48
.if ${PORT_OPTIONS:MVERBOSE}
49
CFLAGS+=	-DFREEBSD_OSS_DEBUG_VERBOSE
50
.endif
51
31
.if ${PORT_OPTIONS:MJACK}
52
.if ${PORT_OPTIONS:MJACK}
32
.if empty(PORT_OPTIONS:MSAMPLERATE)
53
.if empty(PORT_OPTIONS:MSAMPLERATE)
33
IGNORE=			JACK audio support requires SAMPLERATE
54
IGNORE=			JACK audio support requires SAMPLERATE
(-)audio/alsa-plugins/files/alsa-plugins.patch (-11 / +22 lines)
Lines 42-48 Link Here
42
 	oss->ext.private_data = oss;
42
 	oss->ext.private_data = oss;
43
--- oss/pcm_oss.c.orig	2009-08-31 21:09:41.000000000 +0800
43
--- oss/pcm_oss.c.orig	2009-08-31 21:09:41.000000000 +0800
44
+++ oss/pcm_oss.c	2009-09-28 14:54:12.000000000 +0800
44
+++ oss/pcm_oss.c	2009-09-28 14:54:12.000000000 +0800
45
@@ -22,17 +22,55 @@
45
@@ -22,17 +22,48 @@
46
 #include <sys/ioctl.h>
46
 #include <sys/ioctl.h>
47
 #include <alsa/asoundlib.h>
47
 #include <alsa/asoundlib.h>
48
 #include <alsa/pcm_external.h>
48
 #include <alsa/pcm_external.h>
Lines 54-71 Link Here
54
+#define ARRAY_SIZE(x)	(sizeof(x) / sizeof(*(x)))
54
+#define ARRAY_SIZE(x)	(sizeof(x) / sizeof(*(x)))
55
+
55
+
56
+#ifdef __FreeBSD__
56
+#ifdef __FreeBSD__
57
+/* #define FREEBSD_OSS_USE_IO_PTR	1 */
58
+/* #define FREEBSD_OSS_BLKCNT_P2	1 */
59
+/* #define FREEBSD_OSS_DEBUG_VERBOSE	1 */
60
+#undef FREEBSD_OSS_USE_IO_PTR	/* _IPTR is buggy ... Grr... */
61
+#undef FREEBSD_OSS_BLKCNT_P2
62
+#undef FREEBSD_OSS_DEBUG_VERBOSE
63
+
64
+#define FREEBSD_OSS_RATE_MIN	1
57
+#define FREEBSD_OSS_RATE_MIN	1
65
+#define FREEBSD_OSS_RATE_MAX	384000
58
+#define FREEBSD_OSS_RATE_MAX	384000
66
+
59
+
67
+#define FREEBSD_OSS_CHANNELS_MIN	1
60
+#define FREEBSD_OSS_CHANNELS_MIN	1
68
+#if __FreeBSD_version >= 800096
61
+#ifndef __DragonFly__
69
+#define FREEBSD_OSS_CHANNELS_MAX	8
62
+#define FREEBSD_OSS_CHANNELS_MAX	8
70
+#else
63
+#else
71
+#define FREEBSD_OSS_CHANNELS_MAX	2
64
+#define FREEBSD_OSS_CHANNELS_MAX	2
Lines 73-79 Link Here
73
+
66
+
74
+#define FREEBSD_OSS_BUFSZ_MAX	131072
67
+#define FREEBSD_OSS_BUFSZ_MAX	131072
75
+#define FREEBSD_OSS_BLKCNT_MIN	2
68
+#define FREEBSD_OSS_BLKCNT_MIN	2
76
+#define FREEBSD_OSS_BLKSZ_MIN	16 /* (FREEBSD_OSS_CHANNEL_MAX * 4) */
69
+#define FREEBSD_OSS_BLKSZ_MIN	16 /* (FREEBSD_OSS_CHANNELS_MAX * 4) */
77
+
70
+
78
+#define FREEBSD_OSS_BUFSZ_MIN	(FREEBSD_OSS_BLKCNT_MIN * FREEBSD_OSS_BLKSZ_MIN)
71
+#define FREEBSD_OSS_BUFSZ_MIN	(FREEBSD_OSS_BLKCNT_MIN * FREEBSD_OSS_BLKSZ_MIN)
79
+#define FREEBSD_OSS_BLKCNT_MAX	(FREEBSD_OSS_BUFSZ_MAX / FREEBSD_OSS_BUFSZ_MIN)
72
+#define FREEBSD_OSS_BLKCNT_MAX	(FREEBSD_OSS_BUFSZ_MAX / FREEBSD_OSS_BUFSZ_MIN)
Lines 461-467 Link Here
461
 
454
 
462
 	if ((flags = fcntl(oss->fd, F_GETFL)) < 0) {
455
 	if ((flags = fcntl(oss->fd, F_GETFL)) < 0) {
463
 		err = -errno;
456
 		err = -errno;
464
@@ -229,10 +530,128 @@
457
@@ -229,10 +530,146 @@
465
 	return 0;
458
 	return 0;
466
 }
459
 }
467
 
460
 
Lines 478-483 Link Here
478
+#ifdef FREEBSD_OSS_BLKCNT_P2
471
+#ifdef FREEBSD_OSS_BLKCNT_P2
479
+	unsigned int period_list[30];
472
+	unsigned int period_list[30];
480
+#endif
473
+#endif
474
+#ifdef FREEBSD_OSS_BUFSZ_P2
475
+	unsigned int bufsz_list[30];
476
+#endif
481
+	unsigned int nformats;
477
+	unsigned int nformats;
482
+	unsigned int format[ARRAY_SIZE(oss_formats_tab)];
478
+	unsigned int format[ARRAY_SIZE(oss_formats_tab)];
483
+#if 0
479
+#if 0
Lines 580-585 Link Here
580
+	if (err < 0)
576
+	if (err < 0)
581
+		return err;
577
+		return err;
582
+
578
+
579
+#ifdef FREEBSD_OSS_BUFSZ_P2
580
+	tmp = 0;
581
+	for (i = 1; i < 31 && tmp < ARRAY_SIZE(bufsz_list); i++) {
582
+		if ((1 << i) > FREEBSD_OSS_BUFSZ_MAX)
583
+			break;
584
+		if ((1 << i) < FREEBSD_OSS_BUFSZ_MIN)
585
+			continue;
586
+		bufsz_list[tmp++] = 1 << i;
587
+	}
588
+
589
+	if (tmp > 0)
590
+		err = snd_pcm_ioplug_set_param_list(io,
591
+		    SND_PCM_IOPLUG_HW_BUFFER_BYTES, tmp, bufsz_list);
592
+	else
593
+#endif
583
+	/* buffer size , not strictly ^2 */
594
+	/* buffer size , not strictly ^2 */
584
+	err = snd_pcm_ioplug_set_param_minmax(io,
595
+	err = snd_pcm_ioplug_set_param_minmax(io,
585
+	    SND_PCM_IOPLUG_HW_BUFFER_BYTES, FREEBSD_OSS_BUFSZ_MIN,
596
+	    SND_PCM_IOPLUG_HW_BUFFER_BYTES, FREEBSD_OSS_BUFSZ_MIN,

Return to bug 183861