From owner-svn-ports-head@FreeBSD.ORG Sat Dec 14 14:41:18 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90C336F9; Sat, 14 Dec 2013 14:41:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 716CA16E5; Sat, 14 Dec 2013 14:41:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEEfIns016083; Sat, 14 Dec 2013 14:41:18 GMT (envelope-from flo@svn.freebsd.org) Received: (from flo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEEfHXd016078; Sat, 14 Dec 2013 14:41:17 GMT (envelope-from flo@svn.freebsd.org) Message-Id: <201312141441.rBEEfHXd016078@svn.freebsd.org> From: Florian Smeets Date: Sat, 14 Dec 2013 14:41:17 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r336451 - in head/audio: alsa-lib alsa-lib/files alsa-plugins alsa-plugins/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 14:41:18 -0000 Author: flo Date: Sat Dec 14 14:41:17 2013 New Revision: 336451 URL: http://svnweb.freebsd.org/changeset/ports/336451 Log: - ALSA now supports playing HTML5 audio with 32-bit sample format [1] after being converted from float as passed by firefox/libcubeb [2] - Restore behavior from r296140 while adding alignment options in case of issues. This should make things slightly less broken and add more sample formats. [1] - Some apps (e.g. linux-firefox with ports/169896) don't check with ALSA which sample formats are supported and just feed whatever they like, assuming the underlying device supports it. While here also fix mixer device for OSS plugin. It should be /dev/dsp according to 4Front OSS wiki. The only works with ARIFF_OSS enabled but the volume is reset on close(). audio/oss doesn't work either way: the new (OSSv4) way to control mixer is via SNDCTL_MIX_* ioctls. [2] PR: ports/183861 [1] PR: ports/184006 [2] Submitted by: Jan Beich Approved by: maintainer timeout Modified: head/audio/alsa-lib/Makefile head/audio/alsa-lib/files/asound.conf.sample (contents, props changed) head/audio/alsa-plugins/Makefile head/audio/alsa-plugins/files/alsa-plugins.patch (contents, props changed) head/audio/alsa-plugins/files/patch-oss-ctl_oss.c (contents, props changed) Modified: head/audio/alsa-lib/Makefile ============================================================================== --- head/audio/alsa-lib/Makefile Sat Dec 14 14:35:11 2013 (r336450) +++ head/audio/alsa-lib/Makefile Sat Dec 14 14:41:17 2013 (r336451) @@ -3,6 +3,7 @@ PORTNAME= alsa-lib PORTVERSION= 1.0.27.2 +PORTREVISION= 1 CATEGORIES= audio MASTER_SITES= ALSA/lib \ GENTOO/distfiles Modified: head/audio/alsa-lib/files/asound.conf.sample ============================================================================== --- head/audio/alsa-lib/files/asound.conf.sample Sat Dec 14 14:35:11 2013 (r336450) +++ head/audio/alsa-lib/files/asound.conf.sample Sat Dec 14 14:41:17 2013 (r336451) @@ -1,42 +1,65 @@ # # FreeBSD/OSS # +pcm_slave.oss { + pcm.type oss +} + pcm.!default { - type oss - device /dev/dsp + type plug + slave oss } ctl.!default { type oss - device /dev/mixer } # # Remap all possible surround stuffs. # +pcm.!front { + type plug + slave oss +} + +pcm.!rear { + type plug + slave oss +} + +pcm.!center_lfe { + type plug + slave oss +} + +pcm.!side { + type plug + slave oss +} + pcm.!surround40 { - type oss - device /dev/dsp + type plug + slave oss } pcm.!surround41 { - type oss - device /dev/dsp + type plug + slave oss } pcm.!surround50 { - type oss - device /dev/dsp + type plug + slave oss } pcm.!surround51 { - type oss - device /dev/dsp + type plug + slave oss } pcm.!surround71 { - type oss - device /dev/dsp + type plug + slave oss } # Modified: head/audio/alsa-plugins/Makefile ============================================================================== --- head/audio/alsa-plugins/Makefile Sat Dec 14 14:35:11 2013 (r336450) +++ head/audio/alsa-plugins/Makefile Sat Dec 14 14:41:17 2013 (r336451) @@ -3,7 +3,7 @@ PORTNAME= alsa-plugins PORTVERSION= 1.0.27 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= audio MASTER_SITES= ALSA/plugins \ GENTOO/distfiles @@ -17,15 +17,36 @@ 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 -.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} Modified: head/audio/alsa-plugins/files/alsa-plugins.patch ============================================================================== --- head/audio/alsa-plugins/files/alsa-plugins.patch Sat Dec 14 14:35:11 2013 (r336450) +++ head/audio/alsa-plugins/files/alsa-plugins.patch Sat Dec 14 14:41:17 2013 (r336451) @@ -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 #include #include @@ -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, Modified: head/audio/alsa-plugins/files/patch-oss-ctl_oss.c ============================================================================== --- head/audio/alsa-plugins/files/patch-oss-ctl_oss.c Sat Dec 14 14:35:11 2013 (r336450) +++ head/audio/alsa-plugins/files/patch-oss-ctl_oss.c Sat Dec 14 14:41:17 2013 (r336451) @@ -12,3 +12,12 @@ typedef struct snd_ctl_oss { snd_ctl_ext_t ext; +@@ -52,7 +56,7 @@ static const char *const vol_devices[SOU + [SOUND_MIXER_CD] = "CD Playback Volume", + [SOUND_MIXER_IMIX] = "Monitor Mix Playback Volume", + [SOUND_MIXER_ALTPCM] = "Headphone Playback Volume", +- [SOUND_MIXER_RECLEV] = "Capture Volume", ++ [SOUND_MIXER_RECLEV] = "Master Capture Volume", + [SOUND_MIXER_IGAIN] = "Capture Volume", + [SOUND_MIXER_OGAIN] = "Playback Volume", + [SOUND_MIXER_LINE1] = "Aux Playback Volume",