From owner-freebsd-gecko@FreeBSD.ORG Sun Dec 1 00:59:35 2013 Return-Path: Delivered-To: freebsd-gecko@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A258B75B for ; Sun, 1 Dec 2013 00:59:35 +0000 (UTC) Received: from trillian.chruetertee.ch (trillian.chruetertee.ch [217.150.244.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 00E9A156B for ; Sun, 1 Dec 2013 00:59:34 +0000 (UTC) Received: from trillian.chruetertee.ch (trillian [217.150.244.247]) by trillian.chruetertee.ch (8.14.4/8.14.3) with ESMTP id rB10xXDg011920 for ; Sun, 1 Dec 2013 00:59:33 GMT (envelope-from svn-freebsd-gecko@chruetertee.ch) Received: (from www@localhost) by trillian.chruetertee.ch (8.14.4/8.14.3/Submit) id rB10xRTM005876 for freebsd-gecko@freebsd.org; Sun, 1 Dec 2013 00:59:27 GMT (envelope-from svn-freebsd-gecko@chruetertee.ch) Date: Sun, 1 Dec 2013 00:59:27 GMT Message-Id: <201312010059.rB10xRTM005876@trillian.chruetertee.ch> X-Authentication-Warning: trillian.chruetertee.ch: www set sender to svn-freebsd-gecko@chruetertee.ch using -f From: svn-freebsd-gecko@chruetertee.ch To: freebsd-gecko@freebsd.org Subject: [SVN-Commit] r1411 - in trunk: . audio audio/alsa-lib audio/alsa-lib/files audio/alsa-plugins audio/alsa-plugins/files audio/linux-f10-alsa-lib audio/linux-f10-alsa-plugins-oss audio/linux-f10-alsa-plugins-oss/files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-gecko@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list Reply-To: freebsd-gecko@freebsd.org List-Id: Gecko Rendering Engine issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Dec 2013 00:59:35 -0000 Author: jbeich Date: Sun Dec 1 00:59:27 2013 New Revision: 1411 Log: import alsa ports This should make testing easier $ rsync -a gecko-overlay/ /usr/ports/ $ cd www/firefox; make install Added: trunk/Gecko_UPDATING trunk/audio/ trunk/audio/alsa-lib/ trunk/audio/alsa-lib/Makefile trunk/audio/alsa-lib/distinfo trunk/audio/alsa-lib/files/ trunk/audio/alsa-lib/files/asound.conf.sample trunk/audio/alsa-lib/files/patch-alsa-lib trunk/audio/alsa-lib/pkg-descr trunk/audio/alsa-lib/pkg-plist trunk/audio/alsa-plugins/ trunk/audio/alsa-plugins/Makefile trunk/audio/alsa-plugins/distinfo trunk/audio/alsa-plugins/files/ trunk/audio/alsa-plugins/files/alsa-plugins.patch trunk/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c trunk/audio/alsa-plugins/files/patch-configure trunk/audio/alsa-plugins/files/patch-ffmpeg-version trunk/audio/alsa-plugins/files/patch-jack-pcm_jack.c trunk/audio/alsa-plugins/files/patch-oss-ctl_oss.c trunk/audio/alsa-plugins/files/patch-oss-pcm_oss.c trunk/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c trunk/audio/alsa-plugins/pkg-descr trunk/audio/alsa-plugins/pkg-plist trunk/audio/linux-f10-alsa-lib/ trunk/audio/linux-f10-alsa-lib/Makefile trunk/audio/linux-f10-alsa-lib/distinfo.i386 trunk/audio/linux-f10-alsa-lib/pkg-descr trunk/audio/linux-f10-alsa-lib/pkg-plist trunk/audio/linux-f10-alsa-plugins-oss/ trunk/audio/linux-f10-alsa-plugins-oss/Makefile trunk/audio/linux-f10-alsa-plugins-oss/distinfo.i386 trunk/audio/linux-f10-alsa-plugins-oss/files/ trunk/audio/linux-f10-alsa-plugins-oss/files/patch-pcm-oss.conf trunk/audio/linux-f10-alsa-plugins-oss/pkg-deinstall trunk/audio/linux-f10-alsa-plugins-oss/pkg-descr trunk/audio/linux-f10-alsa-plugins-oss/pkg-install trunk/audio/linux-f10-alsa-plugins-oss/pkg-plist Added: trunk/Gecko_UPDATING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/Gecko_UPDATING Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,7 @@ +20121010: + AFFECTS: users of www/firefox and www/seamonkey + AUTHOR: gecko@FreeBSD.org + + 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. Added: trunk/audio/alsa-lib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-lib/Makefile Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,46 @@ +# Created by: Aragon Gouveia +# $FreeBSD: head/audio/alsa-lib/Makefile 329208 2013-10-03 16:34:28Z flo $ + +PORTNAME= alsa-lib +PORTVERSION= 1.0.27.2 +CATEGORIES= audio +MASTER_SITES= ALSA/lib \ + GENTOO/distfiles + +MAINTAINER= aragon@phat.za.net +COMMENT= ALSA compatibility library + +USE_BZIP2= yes +USE_LDCONFIG= yes +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --with-pkgconfdir="\$${prefix}/libdata/pkgconfig" + +OPTIONS_DEFINE= PYTHON +OPTIONS_SUB= ${OPTIONS_DEFINE} + +.include + +.if ${PORT_OPTIONS:MPYTHON} +USE_PYTHON= -2.7 +.else +CONFIGURE_ARGS+=--disable-python +.endif + +post-patch: .SILENT + ${REINPLACE_CMD} -e '/LIBS/ { s/-ldl//g; s/-lrt//g; }' \ + -e 's/python-config/${PYTHON_CMD:T}-config/g' \ + -e '/-D_GNU_SOURCE/d' \ + -e '/lt_cv_dlopen/s/-ldl//g' ${WRKSRC}/configure + ${REINPLACE_CMD} '/LIBADD/s/-ldl//g' \ + ${WRKSRC}/modules/mixer/simple/Makefile.in + ${REINPLACE_CMD} 's|/etc|${PREFIX}&|g' \ + ${WRKSRC}/src/conf/alsa.conf + +post-install: + ${INSTALL_DATA} ${FILESDIR}/asound.conf.sample ${STAGEDIR}${PREFIX}/etc + @if [ ! -f ${PREFIX}/etc/asound.conf ]; then \ + ${CP} -p ${STAGEDIR}${PREFIX}/etc/asound.conf.sample \ + ${STAGEDIR}${PREFIX}/etc/asound.conf ; \ + fi + +.include Added: trunk/audio/alsa-lib/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-lib/distinfo Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,2 @@ +SHA256 (alsa-lib-1.0.27.2.tar.bz2) = 690ed393e7efd4fc7e3a2d2cda5449298ca0c895197e5914e350882012430d19 +SIZE (alsa-lib-1.0.27.2.tar.bz2) = 906844 Added: trunk/audio/alsa-lib/files/asound.conf.sample ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-lib/files/asound.conf.sample Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,51 @@ +# +# FreeBSD/OSS +# +pcm.!default { + type oss + device /dev/dsp +} + +ctl.!default { + type oss + device /dev/mixer +} + +# +# Remap all possible surround stuffs. +# +pcm.!surround40 { + type oss + device /dev/dsp +} + +pcm.!surround41 { + type oss + device /dev/dsp +} + +pcm.!surround50 { + type oss + device /dev/dsp +} + +pcm.!surround51 { + type oss + device /dev/dsp +} + +pcm.!surround71 { + type oss + device /dev/dsp +} + +# +# Pulseaudio +# +# pcm.!default { +# type pulse +# } +# +# ctl.!default { +# type pulse +# } Added: trunk/audio/alsa-lib/files/patch-alsa-lib ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-lib/files/patch-alsa-lib Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,561 @@ +--- include/asoundlib-head.h.orig 2009-09-09 20:34:54.000000000 +0800 ++++ include/asoundlib-head.h 2009-09-15 00:35:55.000000000 +0800 +@@ -34,7 +34,11 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#else + #include ++#endif + #include + #include + #include +@@ -46,3 +50,31 @@ + #include + #include + #include ++ ++#ifdef __FreeBSD__ ++ ++#define ESTRPIPE 0x7a69 /* Linux PCM suspend errno, fehh?! */ ++#define EBADFD EBADF ++ ++#define bswap_16(x) bswap16(x) ++#define bswap_32(x) bswap32(x) ++#define bswap_64(x) bswap64(x) ++ ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++#define __cpu_to_le32(x) (x) ++#define __cpu_to_be32(x) bswap_32(x) ++#define __cpu_to_le16(x) (x) ++#define __cpu_to_be16(x) bswap_16(x) ++#else ++#define __cpu_to_le32(x) bswap_32(x) ++#define __cpu_to_be32(x) (x) ++#define __cpu_to_le16(x) bswap_16(x) ++#define __cpu_to_be16(x) (x) ++#endif ++ ++#define __le32_to_cpu __cpu_to_le32 ++#define __be32_to_cpu __cpu_to_be32 ++#define __le16_to_cpu __cpu_to_le16 ++#define __be16_to_cpu __cpu_to_be16 ++ ++#endif /* !__FreeBSD__ */ +--- include/global.h.orig 2009-09-09 20:34:54.000000000 +0800 ++++ include/global.h 2009-09-15 00:39:54.000000000 +0800 +@@ -133,7 +133,7 @@ + + int snd_user_file(const char *file, char **result); + +-#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE) ++#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE) && !defined(__FreeBSD__) + struct timeval { + time_t tv_sec; /* seconds */ + long tv_usec; /* microseconds */ +--- include/local.h.orig 2009-09-09 20:34:54.000000000 +0800 ++++ include/local.h 2009-09-15 00:26:08.000000000 +0800 +@@ -28,11 +28,19 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#else + #include ++#endif + #include + #include + #include ++#ifdef __linux__ + #include ++#else ++#include ++#endif + + #include "config.h" + #ifdef SUPPORT_RESMGR +--- include/search.h.orig 2009-09-09 20:34:54.000000000 +0800 ++++ include/search.h 2009-09-15 00:49:10.000000000 +0800 +@@ -20,7 +20,9 @@ + #ifndef _SEARCH_H + #define _SEARCH_H 1 + ++#ifndef __FreeBSD__ + #include ++#endif + + #define __need_size_t + #include +@@ -49,10 +51,18 @@ + #endif + + ++#ifdef __FreeBSD__ ++#define __PMT __P ++#endif ++ + /* For use with hsearch(3). */ + #ifndef __COMPAR_FN_T + # define __COMPAR_FN_T ++#ifdef __FreeBSD__ ++typedef int (*__compar_fn_t) __PMT ((__const void *, __const void *)); ++#else + typedef int (*__compar_fn_t) __PMT ((__const __ptr_t, __const __ptr_t)); ++#endif + + # ifdef __USE_GNU + typedef __compar_fn_t comparison_fn_t; +--- include/sound/asound.h.orig 2009-09-09 20:34:54.000000000 +0800 ++++ include/sound/asound.h 2009-09-15 00:44:37.000000000 +0800 +@@ -23,9 +23,42 @@ + #ifndef _UAPI__SOUND_ASOUND_H + #define _UAPI__SOUND_ASOUND_H + ++#ifdef __linux__ + #include ++#else ++#define __bitwise ++typedef uint32_t __u32; ++typedef int __kernel_pid_t; ++#endif ++ + ++#ifdef __FreeBSD__ ++#define ESTRPIPE 0x7a69 /* Linux PCM suspend errno, fehh?! */ ++#define EBADFD EBADF ++ ++typedef uint64_t __u64; ++ ++#define bswap_16(x) bswap16(x) ++#define bswap_32(x) bswap32(x) ++#define bswap_64(x) bswap64(x) ++ ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++#define __cpu_to_le32(x) (x) ++#define __cpu_to_be32(x) bswap_32(x) ++#define __cpu_to_le16(x) (x) ++#define __cpu_to_be16(x) bswap_16(x) ++#else ++#define __cpu_to_le32(x) bswap_32(x) ++#define __cpu_to_be32(x) (x) ++#define __cpu_to_le16(x) bswap_16(x) ++#define __cpu_to_be16(x) (x) ++#endif + ++#define __le32_to_cpu __cpu_to_le32 ++#define __be32_to_cpu __cpu_to_be32 ++#define __le16_to_cpu __cpu_to_le16 ++#define __be16_to_cpu __cpu_to_be16 ++#endif + /* + * protocol version + */ +--- include/sound/type_compat.h.orig 2009-09-09 20:34:54.000000000 +0800 ++++ include/sound/type_compat.h 2009-09-15 00:36:14.000000000 +0800 +@@ -10,8 +10,15 @@ + typedef int16_t __s16; + typedef int32_t __s32; + ++#ifdef __FreeBSD__ ++#include ++#define bswap_16(x) bswap16(x) ++#define bswap_32(x) bswap32(x) ++#define bswap_64(x) bswap64(x) ++#else + #include + #include ++#endif + #if __BYTE_ORDER == __LITTLE_ENDIAN + #define __cpu_to_le32(x) (x) + #define __cpu_to_be32(x) bswap_32(x) +$NetBSD: patch-bk,v 1.1 2008/12/25 13:18:00 hasso Exp $ + +--- src/async.c.orig 2008-12-25 08:18:22 +0200 ++++ src/async.c 2008-12-25 08:20:39 +0200 +@@ -51,6 +51,15 @@ static LIST_HEAD(snd_async_handlers); + + static void snd_async_handler(int signo ATTRIBUTE_UNUSED, siginfo_t *siginfo, void *context ATTRIBUTE_UNUSED) + { ++#if defined(__DragonFly__) || defined(__FreeBSD__) ++ /* XXX XXX XXX */ ++ struct list_head *i; ++ list_for_each(i, &snd_async_handlers) { ++ snd_async_handler_t *h = list_entry(i, snd_async_handler_t, glist); ++ if (h->callback) ++ h->callback(h); ++ } ++#else + int fd; + struct list_head *i; + //assert(siginfo->si_code == SI_SIGIO); +@@ -60,6 +61,7 @@ + if (h->fd == fd && h->callback) + h->callback(h); + } ++#endif + } + + /** +--- src/compat/hsearch_r.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/compat/hsearch_r.c 2009-09-15 00:22:11.000000000 +0800 +@@ -18,7 +18,11 @@ + Boston, MA 02111-1307, USA. */ + + #include ++#ifdef __GLIBC__ + #include ++#else ++#include ++#endif + #include + + #define __USE_GNU +--- src/conf.c.orig ++++ src/conf.c +@@ -428,7 +428,11 @@ beginning:

+ + #ifdef HAVE_LIBPTHREAD + static pthread_mutex_t snd_config_update_mutex = ++#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; ++#else ++ PTHREAD_MUTEX_INITIALIZER; ++#endif + #endif + + struct _snd_config { +--- src/pcm/pcm.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm.c 2009-09-15 00:19:09.000000000 +0800 +@@ -630,7 +630,9 @@ + + #include + #include ++#ifndef __FreeBSD__ + #include ++#endif + #include + #include + #include +--- src/pcm/pcm_adpcm.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_adpcm.c 2009-09-15 00:19:14.000000000 +0800 +@@ -56,7 +56,9 @@ + come across a good description of XA yet. + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + +--- src/pcm/pcm_alaw.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_alaw.c 2009-09-15 00:19:19.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + +--- src/pcm/pcm_copy.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_copy.c 2009-09-15 00:21:29.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + +--- src/pcm/pcm_direct.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_direct.c 2009-09-15 00:45:34.000000000 +0800 +@@ -44,12 +44,14 @@ + * + */ + ++#ifndef __FreeBSD__ + union semun { + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO (Linux specific) */ + }; ++#endif + + /* + * FIXME: +--- src/pcm/pcm_dmix_generic.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_dmix_generic.c 2009-09-15 00:18:52.000000000 +0800 +@@ -125,7 +125,9 @@ + (1ULL << SND_PCM_FORMAT_S24_3LE) | \ + (1ULL << SND_PCM_FORMAT_U8)) + ++#ifndef __FreeBSD__ + #include ++#endif + + static void generic_mix_areas_16_native(unsigned int size, + volatile signed short *dst, +--- src/pcm/pcm_file.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_file.c 2009-09-15 00:21:10.000000000 +0800 +@@ -26,8 +26,12 @@ + * + */ + ++#ifdef __FreeBSD__ ++#include ++#else + #include + #include ++#endif + #include + #include + #include "pcm_local.h" +--- src/pcm/pcm_iec958.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_iec958.c 2009-09-15 00:19:44.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + +--- src/pcm/pcm_lfloat.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_lfloat.c 2009-09-15 00:21:48.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + +--- src/pcm/pcm_linear.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_linear.c 2009-09-15 00:21:37.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + +--- src/pcm/pcm_meter.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_meter.c 2009-09-15 00:18:38.000000000 +0800 +@@ -27,7 +27,9 @@ + */ + + ++#ifndef __FreeBSD__ + #include ++#endif + #include + #include + #include +--- src/pcm/pcm_misc.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_misc.c 2009-09-15 00:18:31.000000000 +0800 +@@ -23,7 +23,9 @@ + #include + #include + #include ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + + +--- src/pcm/pcm_mmap.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_mmap.c 2009-09-15 00:17:43.000000000 +0800 +@@ -19,7 +19,9 @@ + */ + + #include ++#ifndef __FreeBSD__ + #include ++#endif + #include + #include + #include +--- src/pcm/pcm_mulaw.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_mulaw.c 2009-09-15 00:21:21.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + +--- src/pcm/pcm_null.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_null.c 2009-09-15 00:19:32.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include + #include + #include "pcm_local.h" +--- src/pcm/pcm_rate.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_rate.c 2009-09-15 00:21:43.000000000 +0800 +@@ -28,7 +28,9 @@ + * + */ + #include ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + #include "pcm_rate.h" +--- src/pcm/pcm_rate_linear.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_rate_linear.c 2009-09-15 00:19:26.000000000 +0800 +@@ -21,7 +21,9 @@ + */ + + #include ++#ifndef __FreeBSD__ + #include ++#endif + #include "pcm_local.h" + #include "pcm_plugin.h" + #include "pcm_rate.h" +--- src/pcm/pcm_route.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_route.c 2009-09-15 00:19:38.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include + #include "pcm_local.h" + #include "pcm_plugin.h" +--- src/pcm/pcm_softvol.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/pcm/pcm_softvol.c 2009-09-15 00:19:02.000000000 +0800 +@@ -26,7 +26,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include + #include "pcm_local.h" + #include "pcm_plugin.h" +--- src/seq/seq_midi_event.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/seq/seq_midi_event.c 2009-09-15 00:21:55.000000000 +0800 +@@ -28,7 +28,9 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include "local.h" + + #ifndef DOC_HIDDEN +--- src/shmarea.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/shmarea.c 2009-09-15 00:22:00.000000000 +0800 +@@ -19,7 +19,11 @@ + */ + + #include ++#ifdef __GLIBC__ + #include ++#else ++#include ++#endif + #include + #include + #include +--- src/userfile.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/userfile.c 2009-09-18 00:57:22.000000000 +0800 +@@ -19,9 +19,47 @@ + */ + + #include ++#ifdef __FreeBSD__ ++#include ++#endif + #include + #include + ++/* ++ * XXX Something is definitely wrong, very very wrong, here or there. ++ * Apparently mplayer (so far) is the only app that break, returning ++ * WRDE_SYNTAX. For now, this simple home/path expansion should work. ++ * I'll investigate this further in future. ++ */ ++#ifdef __FreeBSD__ ++int snd_user_file(const char *file, char **result) ++{ ++ ++ if (file == NULL) ++ return -EINVAL; ++ ++ if (strlen(file) > 2 && strncmp(file, "~/", 2) == 0) { ++ char *homedir, *path; ++ ++ homedir = getenv("HOME"); ++ if (homedir == NULL) ++ return -EINVAL; ++ ++ /* offset -1 by removing '~' */ ++ path = malloc(strlen(homedir) + strlen(file)); ++ if (path == NULL) ++ return -ENOMEM; ++ ++ strcpy(path, homedir); /* copy home directory */ ++ strcat(path, file + 1); /* discard '~', start with '/' */ ++ ++ *result = path; ++ } else ++ *result = strdup(file); ++ ++ return 0; ++} ++#else + /** + * \brief Get the full file name + * \param file The file name string to parse +@@ -70,3 +108,4 @@ + return 0; + } + #endif /* HAVE_WORDEXP_H */ ++#endif /* __FreeBSD__ */ +--- src/timer/timer_hw.c.orig 2009-09-09 20:34:54.000000000 +0800 ++++ src/timer/timer_hw.c 2009-09-15 00:46:06.000000000 +0800 +@@ -92,10 +92,12 @@ + } + if (sig < 0) + return 0; ++#ifndef __FreeBSD__ + if (fcntl(fd, F_SETSIG, (long)sig) < 0) { + SYSERR("F_SETSIG failed"); + return -errno; + } ++#endif + if (fcntl(fd, F_SETOWN, (long)pid) < 0) { + SYSERR("F_SETOWN failed"); + return -errno; Added: trunk/audio/alsa-lib/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-lib/pkg-descr Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,3 @@ +The Advanced Linux Sound Architecture (ALSA) library + +WWW: http://www.alsa-project.org/ Added: trunk/audio/alsa-lib/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-lib/pkg-plist Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,172 @@ +bin/aserver +include/alsa/alisp.h +include/alsa/asoundef.h +include/alsa/asoundlib.h +include/alsa/conf.h +include/alsa/control.h +include/alsa/control_external.h +include/alsa/error.h +include/alsa/global.h +include/alsa/hwdep.h +include/alsa/iatomic.h +include/alsa/input.h +include/alsa/mixer.h +include/alsa/mixer_abst.h +include/alsa/output.h +include/alsa/pcm.h +include/alsa/pcm_external.h +include/alsa/pcm_extplug.h +include/alsa/pcm_ioplug.h +include/alsa/pcm_old.h +include/alsa/pcm_plugin.h +include/alsa/pcm_rate.h +include/alsa/rawmidi.h +include/alsa/seq.h +include/alsa/seq_event.h +include/alsa/seq_midi_event.h +include/alsa/seqmid.h +include/alsa/sound/asound_fm.h +include/alsa/sound/emu10k1.h +include/alsa/sound/hdsp.h +include/alsa/sound/hdspm.h +include/alsa/sound/sb16_csp.h +include/alsa/sound/sscape_ioctl.h +include/alsa/sound/type_compat.h +include/alsa/timer.h +include/alsa/use-case.h +include/alsa/version.h +include/sys/asoundlib.h +lib/alsa-lib/smixer/smixer-ac97.la +lib/alsa-lib/smixer/smixer-ac97.so +lib/alsa-lib/smixer/smixer-hda.la +lib/alsa-lib/smixer/smixer-hda.so +%%PYTHON%%lib/alsa-lib/smixer/smixer-python.la +%%PYTHON%%lib/alsa-lib/smixer/smixer-python.so +lib/alsa-lib/smixer/smixer-sbase.la +lib/alsa-lib/smixer/smixer-sbase.so +lib/libasound.la +lib/libasound.so +lib/libasound.so.2 +libdata/pkgconfig/alsa.pc +share/aclocal/alsa.m4 +share/alsa/alsa.conf +share/alsa/alsa.conf.d/README +share/alsa/cards/AACI.conf +share/alsa/cards/ATIIXP-MODEM.conf +share/alsa/cards/ATIIXP-SPDMA.conf +share/alsa/cards/ATIIXP.conf +share/alsa/cards/AU8810.conf +share/alsa/cards/AU8820.conf +share/alsa/cards/AU8830.conf +share/alsa/cards/Audigy.conf +share/alsa/cards/Audigy2.conf +share/alsa/cards/Aureon51.conf +share/alsa/cards/Aureon71.conf +share/alsa/cards/CA0106.conf +share/alsa/cards/CMI8338-SWIEC.conf +share/alsa/cards/CMI8338.conf +share/alsa/cards/CMI8738-MC6.conf +share/alsa/cards/CMI8738-MC8.conf +share/alsa/cards/CMI8788.conf +share/alsa/cards/CS46xx.conf +share/alsa/cards/EMU10K1.conf +share/alsa/cards/EMU10K1X.conf +share/alsa/cards/ENS1370.conf +share/alsa/cards/ENS1371.conf +share/alsa/cards/ES1968.conf +share/alsa/cards/Echo_Echo3G.conf +share/alsa/cards/FM801.conf +share/alsa/cards/FWSpeakers.conf +share/alsa/cards/FireWave.conf +share/alsa/cards/GUS.conf +share/alsa/cards/HDA-Intel.conf +share/alsa/cards/ICE1712.conf +share/alsa/cards/ICE1724.conf +share/alsa/cards/ICH-MODEM.conf +share/alsa/cards/ICH.conf +share/alsa/cards/ICH4.conf +share/alsa/cards/Maestro3.conf +share/alsa/cards/NFORCE.conf +share/alsa/cards/PC-Speaker.conf +share/alsa/cards/PMac.conf +share/alsa/cards/PMacToonie.conf +share/alsa/cards/PS3.conf +share/alsa/cards/RME9636.conf +share/alsa/cards/RME9652.conf +share/alsa/cards/SB-XFi.conf +share/alsa/cards/SI7018.conf +share/alsa/cards/SI7018/sndoc-mixer.alisp +share/alsa/cards/SI7018/sndop-mixer.alisp +share/alsa/cards/TRID4DWAVENX.conf +share/alsa/cards/USB-Audio.conf +share/alsa/cards/VIA686A.conf +share/alsa/cards/VIA8233.conf +share/alsa/cards/VIA8233A.conf +share/alsa/cards/VIA8237.conf +share/alsa/cards/VX222.conf +share/alsa/cards/VXPocket.conf +share/alsa/cards/VXPocket440.conf +share/alsa/cards/YMF744.conf +share/alsa/cards/aliases.alisp +share/alsa/cards/aliases.conf +share/alsa/pcm/center_lfe.conf +share/alsa/pcm/default.conf +share/alsa/pcm/dmix.conf +share/alsa/pcm/dpl.conf +share/alsa/pcm/dsnoop.conf +share/alsa/pcm/front.conf +share/alsa/pcm/hdmi.conf +share/alsa/pcm/iec958.conf +share/alsa/pcm/modem.conf +share/alsa/pcm/rear.conf +share/alsa/pcm/side.conf +share/alsa/pcm/surround40.conf +share/alsa/pcm/surround41.conf +share/alsa/pcm/surround50.conf +share/alsa/pcm/surround51.conf +share/alsa/pcm/surround71.conf +share/alsa/smixer.conf +share/alsa/sndo-mixer.alisp +share/alsa/ucm/DAISY-I2S/DAISY-I2S.conf +share/alsa/ucm/DAISY-I2S/HiFi.conf +share/alsa/ucm/PandaBoard/FMAnalog +share/alsa/ucm/PandaBoard/PandaBoard.conf +share/alsa/ucm/PandaBoard/hifi +share/alsa/ucm/PandaBoard/hifiLP +share/alsa/ucm/PandaBoard/record +share/alsa/ucm/PandaBoard/voice +share/alsa/ucm/PandaBoard/voiceCall +share/alsa/ucm/PandaBoardES/FMAnalog +share/alsa/ucm/PandaBoardES/PandaBoardES.conf +share/alsa/ucm/PandaBoardES/hifi +share/alsa/ucm/PandaBoardES/hifiLP +share/alsa/ucm/PandaBoardES/record +share/alsa/ucm/PandaBoardES/voice +share/alsa/ucm/PandaBoardES/voiceCall +share/alsa/ucm/SDP4430/FMAnalog +share/alsa/ucm/SDP4430/SDP4430.conf +share/alsa/ucm/SDP4430/hifi +share/alsa/ucm/SDP4430/hifiLP +share/alsa/ucm/SDP4430/record +share/alsa/ucm/SDP4430/voice +share/alsa/ucm/SDP4430/voiceCall +share/alsa/ucm/tegraalc5632/tegraalc5632.conf +@unexec if cmp -s %D/etc/asound.conf.sample %D/etc/asound.conf; then rm -f %D/etc/asound.conf; else echo "If permanently deleting this package, %D/etc/asound.conf must be removed manually."; fi +etc/asound.conf.sample +@exec [ -f %B/asound.conf ] || cp -p %B/%f %B/asound.conf +@dirrm share/alsa/ucm/PandaBoardES +@dirrm share/alsa/ucm/SDP4430 +@dirrm share/alsa/ucm/DAISY-I2S +@dirrm share/alsa/ucm/tegraalc5632 +@dirrm share/alsa/ucm/PandaBoard +@dirrm share/alsa/ucm +@dirrm share/alsa/pcm +@dirrm share/alsa/cards/SI7018 +@dirrm share/alsa/cards +@dirrm share/alsa/alsa.conf.d +@dirrm share/alsa +@dirrm lib/alsa-lib/smixer +@dirrm lib/alsa-lib +@dirrm include/sys +@dirrm include/alsa/sound +@dirrm include/alsa Added: trunk/audio/alsa-plugins/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/Makefile Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,72 @@ +# Created by: Aragon Gouveia +# $FreeBSD: head/audio/alsa-plugins/Makefile 331341 2013-10-23 00:30:15Z wg $ + +PORTNAME= alsa-plugins +PORTVERSION= 1.0.27 +PORTREVISION= 1 +CATEGORIES= audio +MASTER_SITES= ALSA/plugins \ + GENTOO/distfiles + +MAINTAINER= aragon@phat.za.net +COMMENT= ALSA compatibility library plugins + +LIB_DEPENDS= libasound.so:${PORTSDIR}/audio/alsa-lib + +USE_BZIP2= yes +GNU_CONFIGURE= yes +USES= pkgconfig +LDFLAGS+= -L${LOCALBASE}/lib + +OPTIONS_DEFINE= ARIFF_OSS JACK FFMPEG PULSEAUDIO SAMPLERATE SPEEX +OPTIONS_SUB= ${OPTIONS_DEFINE} +ARIFF_OSS_DESC= FreeBSD-specific OSS plugin + +.include + +.if ${PORT_OPTIONS:MARIFF_OSS} +EXTRA_PATCHES+= ${FILESDIR}/alsa-plugins.patch +.endif + +.if ${PORT_OPTIONS:MJACK} +.if empty(PORT_OPTIONS:MSAMPLERATE) +IGNORE= JACK audio support requires SAMPLERATE +.endif +LIB_DEPENDS+= libjack.so:${PORTSDIR}/audio/jack +.else +CONFIGURE_ARGS+= --disable-jack +.endif + +.if ${PORT_OPTIONS:MFFMPEG} +CONFIGURE_ARGS+= --enable-avcodec +CFLAGS+= -I${LOCALBASE}/include +LIB_DEPENDS+= libavcodec.so:${PORTSDIR}/multimedia/ffmpeg +.else +CONFIGURE_ARGS+= --disable-avcodec +.endif + +.if ${PORT_OPTIONS:MPULSEAUDIO} +LIB_DEPENDS+= libpulse.so:${PORTSDIR}/audio/pulseaudio +.else +CONFIGURE_ARGS+= --disable-pulseaudio +.endif + +.if ${PORT_OPTIONS:MSAMPLERATE} +LIB_DEPENDS+= libsamplerate.so:${PORTSDIR}/audio/libsamplerate +.else +CONFIGURE_ARGS+= --disable-samplerate +.endif + +.if ${PORT_OPTIONS:MSPEEX} +CONFIGURE_ARGS+= --with-speex=lib +LIB_DEPENDS+= libspeex.so:${PORTSDIR}/audio/speex +.else +CONFIGURE_ARGS+= --without-speex +.endif + +post-patch: .SILENT + ${REINPLACE_CMD} -e '/LIBS/s/-ldl//g' \ + -e '/lt_cv_dlopen/s/-ldl//g' \ + ${WRKSRC}/configure + +.include Added: trunk/audio/alsa-plugins/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/distinfo Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,2 @@ +SHA256 (alsa-plugins-1.0.27.tar.bz2) = 0bbd0c37c2dd7baf16363afb2e58169ffb0f9c0a70031b3b6235594630f3ab35 +SIZE (alsa-plugins-1.0.27.tar.bz2) = 363593 Added: trunk/audio/alsa-plugins/files/alsa-plugins.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/files/alsa-plugins.patch Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,644 @@ +--- oss/ctl_oss.c.orig 2009-08-31 21:09:41.000000000 +0800 ++++ oss/ctl_oss.c 2009-09-15 01:07:51.000000000 +0800 +@@ -362,7 +366,9 @@ + { + snd_config_iterator_t it, next; + const char *device = "/dev/mixer"; ++#ifndef __FreeBSD__ + struct mixer_info mixinfo; ++#endif + int i, err, val; + snd_ctl_oss_t *oss; + +@@ -399,19 +405,29 @@ + goto error; + } + ++#ifndef __FreeBSD__ + if (ioctl(oss->fd, SOUND_MIXER_INFO, &mixinfo) < 0) { + err = -errno; + SNDERR("Cannot get mixer info for device %s", device); + goto error; + } ++#endif + + oss->ext.version = SND_CTL_EXT_VERSION; + oss->ext.card_idx = 0; /* FIXME */ ++#ifdef __FreeBSD__ ++ strncpy(oss->ext.id, "fbsd", sizeof(oss->ext.id) - 1); ++ strcpy(oss->ext.driver, "FreeBSD/OSS plugin"); ++ strncpy(oss->ext.name, "FreeBSD/OSS", sizeof(oss->ext.name) - 1); ++ strncpy(oss->ext.longname, "FreeBSD/OSS", sizeof(oss->ext.longname) - 1); ++ strncpy(oss->ext.mixername, "FreeBSD/OSS", sizeof(oss->ext.mixername) - 1); ++#else + strncpy(oss->ext.id, mixinfo.id, sizeof(oss->ext.id) - 1); + strcpy(oss->ext.driver, "OSS-Emulation"); + strncpy(oss->ext.name, mixinfo.name, sizeof(oss->ext.name) - 1); + strncpy(oss->ext.longname, mixinfo.name, sizeof(oss->ext.longname) - 1); + strncpy(oss->ext.mixername, mixinfo.name, sizeof(oss->ext.mixername) - 1); ++#endif + oss->ext.poll_fd = -1; + oss->ext.callback = &oss_ext_callback; + 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 @@ + #include + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif ++ ++#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 ++#define FREEBSD_OSS_CHANNELS_MAX 8 ++#else ++#define FREEBSD_OSS_CHANNELS_MAX 2 ++#endif ++ ++#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_BUFSZ_MIN (FREEBSD_OSS_BLKCNT_MIN * FREEBSD_OSS_BLKSZ_MIN) ++#define FREEBSD_OSS_BLKCNT_MAX (FREEBSD_OSS_BUFSZ_MAX / FREEBSD_OSS_BUFSZ_MIN) ++#define FREEBSD_OSS_BLKSZ_MAX (FREEBSD_OSS_BUFSZ_MAX / FREEBSD_OSS_BLKCNT_MIN) ++#endif + + typedef struct snd_pcm_oss { + snd_pcm_ioplug_t io; + char *device; + int fd; ++#ifdef __FreeBSD__ ++ int bufsz, ptr, ptr_align, last_bytes; ++#else + int fragment_set; + int caps; ++#endif + int format; ++#ifndef __FreeBSD__ + unsigned int period_shift; + unsigned int periods; ++#endif + unsigned int frame_bytes; + } snd_pcm_oss_t; + +@@ -49,8 +89,13 @@ + buf = (char *)areas->addr + (areas->first + areas->step * offset) / 8; + size *= oss->frame_bytes; + result = write(oss->fd, buf, size); ++#ifdef __FreeBSD__ ++ if (result == -1) ++ return -errno; ++#else + if (result <= 0) + return result; ++#endif + return result / oss->frame_bytes; + } + +@@ -67,13 +112,79 @@ + buf = (char *)areas->addr + (areas->first + areas->step * offset) / 8; + size *= oss->frame_bytes; + result = read(oss->fd, buf, size); ++#ifdef __FreeBSD__ ++ if (result == -1) ++ return -errno; ++#else + if (result <= 0) + return result; ++#endif + return result / oss->frame_bytes; + } + + static snd_pcm_sframes_t oss_pointer(snd_pcm_ioplug_t *io) + { ++#ifdef __FreeBSD__ ++ snd_pcm_oss_t *oss = io->private_data; ++#ifdef FREEBSD_OSS_USE_IO_PTR ++ struct count_info ci; ++#endif ++ audio_buf_info bi; ++ ++ if (io->state != SND_PCM_STATE_RUNNING) ++ return 0; ++ ++ if (io->state == SND_PCM_STATE_XRUN) ++ return -EPIPE; ++ ++#ifdef FREEBSD_OSS_USE_IO_PTR ++ if (ioctl(oss->fd, (io->stream == SND_PCM_STREAM_PLAYBACK) ? ++ SNDCTL_DSP_GETOPTR : SNDCTL_DSP_GETIPTR, &ci) < 0) ++ return -EINVAL; ++ ++ if (ci.ptr == oss->last_bytes && ++ ((ioctl(oss->fd, (io->stream == SND_PCM_STREAM_PLAYBACK) ? ++ SNDCTL_DSP_GETOSPACE : SNDCTL_DSP_GETISPACE, &bi) < 0) || ++ bi.bytes == oss->bufsz)) ++ return -EPIPE; ++ ++ if (ci.ptr < oss->last_bytes) ++ oss->ptr += oss->bufsz; ++ ++ oss->ptr += ci.ptr; ++ oss->ptr -= oss->last_bytes; ++ oss->ptr %= oss->ptr_align; ++ ++ oss->last_bytes = ci.ptr; ++#else /* !FREEBSD_OSS_USE_IO_PTR */ ++ if (ioctl(oss->fd, (io->stream == SND_PCM_STREAM_PLAYBACK) ? ++ SNDCTL_DSP_GETOSPACE : SNDCTL_DSP_GETISPACE, &bi) < 0) ++ return -EINVAL; ++ ++ if (bi.bytes == oss->bufsz && bi.bytes == oss->last_bytes) { ++#if 0 ++#ifdef SNDCTL_DSP_GETERROR ++ audio_errinfo ei; ++ if (ioctl(oss->fd, SNDCTL_DSP_GETERROR, &ei) < 0 || ++ (io->stream == SND_PCM_STREAM_PLAYBACK && ++ ei.play_underruns != 0) || ++ (io->stream == SND_PCM_STREAM_CAPTURE && ++ ei.rec_overruns != 0)) ++#endif ++#endif ++ return -EPIPE; ++ } ++ ++ if (bi.bytes > oss->last_bytes) { ++ oss->ptr += bi.bytes - oss->last_bytes; ++ oss->ptr %= oss->ptr_align; ++ } ++ ++ oss->last_bytes = bi.bytes; ++#endif /* FREEBSD_OSS_USE_IO_PTR */ ++ ++ return snd_pcm_bytes_to_frames(io->pcm, oss->ptr); ++#else + snd_pcm_oss_t *oss = io->private_data; + struct count_info info; + int ptr; +@@ -85,20 +196,59 @@ + } + ptr = snd_pcm_bytes_to_frames(io->pcm, info.ptr); + return ptr; ++#endif + } + + static int oss_start(snd_pcm_ioplug_t *io) + { + snd_pcm_oss_t *oss = io->private_data; ++#ifdef __FreeBSD__ ++ audio_buf_info bi; ++#ifdef FREEBSD_OSS_USE_IO_PTR ++ struct count_info ci; ++#endif ++#endif + int tmp = io->stream == SND_PCM_STREAM_PLAYBACK ? + PCM_ENABLE_OUTPUT : PCM_ENABLE_INPUT; + ++#if defined(__FreeBSD__) && defined(FREEBSD_OSS_DEBUG_VERBOSE) ++ fprintf(stderr, "%s()\n", __func__); ++#endif ++ + if (ioctl(oss->fd, SNDCTL_DSP_SETTRIGGER, &tmp) < 0) { + fprintf(stderr, "*** OSS: trigger failed\n"); ++#ifdef __FreeBSD__ ++ return -EINVAL; ++#else + if (io->stream == SND_PCM_STREAM_CAPTURE) + /* fake read to trigger */ + read(oss->fd, &tmp, 0); ++#endif + } ++ ++#ifdef __FreeBSD__ ++ if (ioctl(oss->fd, (io->stream == SND_PCM_STREAM_PLAYBACK) ? ++ SNDCTL_DSP_GETOSPACE : SNDCTL_DSP_GETISPACE, &bi) < 0) ++ return -EINVAL; ++ ++ if (oss->bufsz != (bi.fragsize * bi.fragstotal)) { ++ fprintf(stderr, "%s(): WARNING - bufsz changed! %d -> %d\n", ++ __func__, oss->bufsz, bi.fragsize * bi.fragstotal); ++ oss->bufsz = bi.fragsize * bi.fragstotal; ++ } ++ ++#ifdef FREEBSD_OSS_USE_IO_PTR ++ if (ioctl(oss->fd, (io->stream == SND_PCM_STREAM_PLAYBACK) ? ++ SNDCTL_DSP_GETOPTR : SNDCTL_DSP_GETIPTR, &ci) < 0) ++ return -EINVAL; ++ ++ oss->last_bytes = ci.ptr; ++#else ++ oss->last_bytes = bi.bytes; ++#endif ++ oss->ptr = 0; ++#endif ++ + return 0; + } + +@@ -107,6 +257,10 @@ + snd_pcm_oss_t *oss = io->private_data; + int tmp = 0; + ++#if defined(__FreeBSD__) && defined(FREEBSD_OSS_DEBUG_VERBOSE) ++ fprintf(stderr, "%s()\n", __func__); ++#endif ++ + ioctl(oss->fd, SNDCTL_DSP_SETTRIGGER, &tmp); + return 0; + } +@@ -115,16 +269,25 @@ + { + snd_pcm_oss_t *oss = io->private_data; + ++#if defined(__FreeBSD__) && defined(FREEBSD_OSS_DEBUG_VERBOSE) ++ fprintf(stderr, "%s()\n", __func__); ++#endif ++ + if (io->stream == SND_PCM_STREAM_PLAYBACK) + ioctl(oss->fd, SNDCTL_DSP_SYNC); + return 0; + } + ++#ifndef __FreeBSD__ + static int oss_prepare(snd_pcm_ioplug_t *io) + { + snd_pcm_oss_t *oss = io->private_data; + int tmp; + ++#if defined(__FreeBSD__) && defined(FREEBSD_OSS_DEBUG_VERBOSE) ++ fprintf(stderr, "%s()\n", __func__); ++#endif ++ + ioctl(oss->fd, SNDCTL_DSP_RESET); + + tmp = io->channels; +@@ -145,16 +308,75 @@ + } + return 0; + } ++#endif ++ ++#ifdef __FreeBSD__ ++static const struct { ++ int oss_format; ++ snd_pcm_format_t alsa_format; ++} oss_formats_tab[] = { ++ { AFMT_U8, SND_PCM_FORMAT_U8 }, ++ { AFMT_S8, SND_PCM_FORMAT_S8 }, ++ { AFMT_MU_LAW, SND_PCM_FORMAT_MU_LAW }, ++ { AFMT_A_LAW, SND_PCM_FORMAT_A_LAW }, ++ { AFMT_S16_LE, SND_PCM_FORMAT_S16_LE }, ++ { AFMT_S16_BE, SND_PCM_FORMAT_S16_BE }, ++ { AFMT_U16_LE, SND_PCM_FORMAT_U16_LE }, ++ { AFMT_U16_BE, SND_PCM_FORMAT_U16_BE }, ++ { AFMT_S24_LE, SND_PCM_FORMAT_S24_3LE }, ++ { AFMT_S24_BE, SND_PCM_FORMAT_S24_3BE }, ++ { AFMT_U24_LE, SND_PCM_FORMAT_U24_3LE }, ++ { AFMT_U24_BE, SND_PCM_FORMAT_U24_3BE }, ++ { AFMT_S32_LE, SND_PCM_FORMAT_S32_LE }, ++ { AFMT_S32_BE, SND_PCM_FORMAT_S32_BE }, ++ { AFMT_U32_LE, SND_PCM_FORMAT_U32_LE }, ++ { AFMT_U32_BE, SND_PCM_FORMAT_U32_BE }, ++ /* Special */ ++ { AFMT_S24_LE, SND_PCM_FORMAT_S20_3LE }, ++ { AFMT_S24_BE, SND_PCM_FORMAT_S20_3BE }, ++ { AFMT_U24_LE, SND_PCM_FORMAT_U20_3LE }, ++ { AFMT_U24_BE, SND_PCM_FORMAT_U20_3BE }, ++ { AFMT_S24_LE, SND_PCM_FORMAT_S18_3LE }, ++ { AFMT_S24_BE, SND_PCM_FORMAT_S18_3BE }, ++ { AFMT_U24_LE, SND_PCM_FORMAT_U18_3LE }, ++ { AFMT_U24_BE, SND_PCM_FORMAT_U18_3BE }, ++ { AFMT_S32_LE, SND_PCM_FORMAT_S24_LE }, ++ { AFMT_S32_BE, SND_PCM_FORMAT_S24_BE }, ++ { AFMT_U32_LE, SND_PCM_FORMAT_U24_LE }, ++ { AFMT_U32_BE, SND_PCM_FORMAT_U24_BE }, ++}; ++#endif + + static int oss_hw_params(snd_pcm_ioplug_t *io, + snd_pcm_hw_params_t *params ATTRIBUTE_UNUSED) + { + snd_pcm_oss_t *oss = io->private_data; + int i, tmp, err; ++#ifdef __FreeBSD__ ++ int blksz_shift, blkcnt; ++ audio_buf_info bi; ++#else + unsigned int period_bytes; ++#endif + long oflags, flags; + ++#if defined(__FreeBSD__) && defined(FREEBSD_OSS_DEBUG_VERBOSE) ++ fprintf(stderr, "%s()\n", __func__); ++#endif ++ + oss->frame_bytes = (snd_pcm_format_physical_width(io->format) * io->channels) / 8; ++#ifdef __FreeBSD__ ++ oss->ptr_align = io->buffer_size * oss->frame_bytes; ++ ++ oss->format = 0; ++ for (i = 0; i < ARRAY_SIZE(oss_formats_tab); i++) { ++ if (oss_formats_tab[i].alsa_format == io->format) { ++ oss->format = oss_formats_tab[i].oss_format; ++ break; ++ } ++ } ++ if (oss->format == 0) { ++#else + switch (io->format) { + case SND_PCM_FORMAT_U8: + oss->format = AFMT_U8; +@@ -166,9 +388,87 @@ + oss->format = AFMT_S16_BE; + break; + default: ++#endif + fprintf(stderr, "*** OSS: unsupported format %s\n", snd_pcm_format_name(io->format)); + return -EINVAL; + } ++#ifdef __FreeBSD__ ++ ++ ioctl(oss->fd, SNDCTL_DSP_RESET); ++ ++#define blksz_aligned() ((1 << blksz_shift) - \ ++ ((1 << blksz_shift) % oss->frame_bytes)) ++ blksz_shift = 16; ++ tmp = io->period_size * oss->frame_bytes; ++ ++ while (blksz_shift > 4 && blksz_aligned() > tmp) ++ blksz_shift--; ++ ++ blkcnt = 2; ++ tmp = io->buffer_size * oss->frame_bytes; ++ ++ while (blkcnt < 4096 && (blksz_aligned() * blkcnt) < tmp && ++ ((1 << blksz_shift) * blkcnt) < 131072) ++ blkcnt <<= 1; ++ ++ tmp = blksz_shift | (blkcnt << 16); ++ if (ioctl(oss->fd, SNDCTL_DSP_SETFRAGMENT, &tmp) < 0) { ++ perror("SNDCTL_DSP_SETFRAGMENTS"); ++ return -EINVAL; ++ } ++ ++ tmp = oss->format; ++ if (ioctl(oss->fd, SNDCTL_DSP_SETFMT, &tmp) < 0 || ++ tmp != oss->format) { ++ perror("SNDCTL_DSP_SETFMT"); ++ return -EINVAL; ++ } ++ ++ tmp = io->channels; ++ if (ioctl(oss->fd, SNDCTL_DSP_CHANNELS, &tmp) < 0 || ++ tmp != io->channels) { ++ perror("SNDCTL_DSP_CHANNELS"); ++ return -EINVAL; ++ } ++ ++ tmp = io->rate; ++ if (ioctl(oss->fd, SNDCTL_DSP_SPEED, &tmp) < 0 || ++ tmp > io->rate * 1.01 || tmp < io->rate * 0.99) { ++ perror("SNDCTL_DSP_SPEED"); ++ return -EINVAL; ++ } ++ ++ if (ioctl(oss->fd, (io->stream == SND_PCM_STREAM_PLAYBACK) ? ++ SNDCTL_DSP_GETOSPACE : SNDCTL_DSP_GETISPACE, &bi) < 0) { ++ perror("SNDCTL_DSP_GET[I/O]SPACE"); ++ return -EINVAL; ++ } ++ ++ oss->bufsz = bi.fragsize * bi.fragstotal; ++ ++#ifdef SNDCTL_DSP_LOW_WATER ++ tmp = ((io->period_size * oss->frame_bytes) * 3) / 4; ++ tmp -= tmp % oss->frame_bytes; ++ if (tmp < oss->frame_bytes) ++ tmp = oss->frame_bytes; ++ if (tmp > bi.fragsize) ++ tmp = bi.fragsize; ++ if (ioctl(oss->fd, SNDCTL_DSP_LOW_WATER, &tmp) < 0) ++ perror("SNDCTL_DSP_LOW_WATER"); ++#endif ++ ++#ifdef FREEBSD_OSS_DEBUG_VERBOSE ++ fprintf(stderr, ++ "\n\n[%lu -> %d] %lu ~ %d -> %d, %lu ~ %d -> %d [d:%ld lw:%d]\n\n", ++ io->buffer_size / io->period_size, bi.fragstotal, ++ io->buffer_size * oss->frame_bytes, ++ (1 << blksz_shift) * blkcnt, oss->bufsz, ++ io->period_size * oss->frame_bytes, 1 << blksz_shift, ++ bi.fragsize, ++ (long)(io->buffer_size * oss->frame_bytes) - ++ oss->bufsz, tmp); ++#endif ++#else + period_bytes = io->period_size * oss->frame_bytes; + oss->period_shift = 0; + for (i = 31; i >= 4; i--) { +@@ -209,6 +509,7 @@ + goto _retry; + } + oss->fragment_set = 1; ++#endif + + if ((flags = fcntl(oss->fd, F_GETFL)) < 0) { + err = -errno; +@@ -229,10 +530,128 @@ + return 0; + } + +-#define ARRAY_SIZE(ary) (sizeof(ary)/sizeof(ary[0])) +- + static int oss_hw_constraint(snd_pcm_oss_t *oss) + { ++#ifdef __FreeBSD__ ++ snd_pcm_ioplug_t *io = &oss->io; ++ static const snd_pcm_access_t access_list[] = { ++ SND_PCM_ACCESS_RW_INTERLEAVED, ++ SND_PCM_ACCESS_MMAP_INTERLEAVED ++ }; ++#ifdef FREEBSD_OSS_BLKCNT_P2 ++ unsigned int period_list[30]; ++#endif ++ unsigned int nformats; ++ unsigned int format[ARRAY_SIZE(oss_formats_tab)]; ++#if 0 ++ unsigned int nchannels; ++ unsigned int channel[FREEBSD_OSS_CHANNELS_MAX]; ++#endif ++ int i, err, tmp; ++ ++#ifdef FREEBSD_OSS_DEBUG_VERBOSE ++ fprintf(stderr, "%s()\n", __func__); ++#endif ++ ++ /* check trigger */ ++ tmp = 0; ++ if (ioctl(oss->fd, SNDCTL_DSP_GETCAPS, &tmp) >= 0) { ++ if (!(tmp & DSP_CAP_TRIGGER)) ++ fprintf(stderr, "*** OSS: trigger is not supported!\n"); ++ } ++ ++ /* access type - interleaved only */ ++ if ((err = snd_pcm_ioplug_set_param_list(io, SND_PCM_IOPLUG_HW_ACCESS, ++ ARRAY_SIZE(access_list), access_list)) < 0) ++ return err; ++ ++ /* supported formats. */ ++ tmp = 0; ++ ioctl(oss->fd, SNDCTL_DSP_GETFMTS, &tmp); ++ nformats = 0; ++ for (i = 0; i < ARRAY_SIZE(oss_formats_tab); i++) { ++ if (tmp & oss_formats_tab[i].oss_format) ++ format[nformats++] = oss_formats_tab[i].alsa_format; ++ } ++ if (! nformats) ++ format[nformats++] = SND_PCM_FORMAT_S16; ++ if ((err = snd_pcm_ioplug_set_param_list(io, SND_PCM_IOPLUG_HW_FORMAT, ++ nformats, format)) < 0) ++ return err; ++ ++#if 0 ++ /* supported channels */ ++ nchannels = 0; ++ for (i = 0; i < ARRAY_SIZE(channel); i++) { ++ tmp = i + 1; ++ if (ioctl(oss->fd, SNDCTL_DSP_CHANNELS, &tmp) >= 0 && ++ 1 + i == tmp) ++ channel[nchannels++] = tmp; ++ } ++ if (! nchannels) /* assume 2ch stereo */ ++ err = snd_pcm_ioplug_set_param_minmax(io, ++ SND_PCM_IOPLUG_HW_CHANNELS, 2, 2); ++ else ++ err = snd_pcm_ioplug_set_param_list(io, ++ SND_PCM_IOPLUG_HW_CHANNELS, nchannels, channel); ++ if (err < 0) ++ return err; ++#endif ++ err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_CHANNELS, ++ FREEBSD_OSS_CHANNELS_MIN, FREEBSD_OSS_CHANNELS_MAX); ++ if (err < 0) ++ return err; ++ ++ /* supported rates */ ++ err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_RATE, ++ FREEBSD_OSS_RATE_MIN, FREEBSD_OSS_RATE_MAX); ++ if (err < 0) ++ return err; ++ ++ /* ++ * Maximum buffer size on FreeBSD can go up to 131072 bytes without ++ * strict ^2 alignment so that s24le in 3bytes packing can be fed ++ * directly. ++ */ ++ ++#ifdef FREEBSD_OSS_BLKCNT_P2 ++ tmp = 0; ++ for (i = 1; i < 31 && tmp < ARRAY_SIZE(period_list); i++) { ++ if ((1 << i) > FREEBSD_OSS_BLKCNT_MAX) ++ break; ++ if ((1 << i) < FREEBSD_OSS_BLKCNT_MIN) ++ continue; ++ period_list[tmp++] = 1 << i; ++ } ++ ++ if (tmp > 0) ++ err = snd_pcm_ioplug_set_param_list(io, ++ SND_PCM_IOPLUG_HW_PERIODS, tmp, period_list); ++ else ++#endif ++ /* periods , not strictly ^2 but later on will be refined */ ++ err = snd_pcm_ioplug_set_param_minmax(io, ++ SND_PCM_IOPLUG_HW_PERIODS, FREEBSD_OSS_BLKCNT_MIN, ++ FREEBSD_OSS_BLKCNT_MAX); ++ if (err < 0) ++ return err; ++ ++ /* period size , not strictly ^2 */ ++ err = snd_pcm_ioplug_set_param_minmax(io, ++ SND_PCM_IOPLUG_HW_PERIOD_BYTES, FREEBSD_OSS_BLKSZ_MIN, ++ FREEBSD_OSS_BLKSZ_MAX); ++ if (err < 0) ++ return err; ++ ++ /* buffer size , not strictly ^2 */ ++ err = snd_pcm_ioplug_set_param_minmax(io, ++ SND_PCM_IOPLUG_HW_BUFFER_BYTES, FREEBSD_OSS_BUFSZ_MIN, ++ FREEBSD_OSS_BUFSZ_MAX); ++ if (err < 0) ++ return err; ++ ++ return 0; ++#else + snd_pcm_ioplug_t *io = &oss->io; + static const snd_pcm_access_t access_list[] = { + SND_PCM_ACCESS_RW_INTERLEAVED, +@@ -317,6 +736,7 @@ + return err; + + return 0; ++#endif + } + + +@@ -324,6 +744,10 @@ + { + snd_pcm_oss_t *oss = io->private_data; + ++#if defined(__FreeBSD__) && defined(FREEBSD_OSS_DEBUG_VERBOSE) ++ fprintf(stderr, "%s()\n", __func__); ++#endif ++ + close(oss->fd); + free(oss->device); + free(oss); +@@ -337,7 +761,9 @@ + .pointer = oss_pointer, + .close = oss_close, + .hw_params = oss_hw_params, ++#ifndef __FreeBSD__ + .prepare = oss_prepare, ++#endif + .drain = oss_drain, + }; + +@@ -348,7 +774,9 @@ + .pointer = oss_pointer, + .close = oss_close, + .hw_params = oss_hw_params, ++#ifndef __FreeBSD__ + .prepare = oss_prepare, ++#endif + .drain = oss_drain, + }; + +@@ -360,6 +788,10 @@ + int err; + snd_pcm_oss_t *oss; + ++#if defined(__FreeBSD__) && defined(FREEBSD_OSS_DEBUG_VERBOSE) ++ fprintf(stderr, "%s()\n", __func__); ++#endif ++ + snd_config_for_each(i, next, conf) { + snd_config_t *n = snd_config_iterator_entry(i); + const char *id; Added: trunk/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,19 @@ +--- arcam-av/arcam_av.c.orig ++++ arcam-av/arcam_av.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -37,6 +38,8 @@ + #include + #include + ++#define AF_FILE AF_UNIX ++ + #define MIN(a, b) ((a) < (b) ? (a) : (b)) + #define MAX(a, b) ((a) > (b) ? (a) : (b)) + Added: trunk/audio/alsa-plugins/files/patch-configure ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/files/patch-configure Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,33 @@ +--- configure.orig 2010-04-16 13:18:56.000000000 +0200 ++++ configure 2010-05-11 00:08:29.000000000 +0200 +@@ -19608,14 +19608,6 @@ else + $as_echo "yes" >&6; } + HAVE_SPEEXDSP="yes" + fi +- if test "$HAVE_SPEEXDSP" = "yes"; then +- HAVE_SPEEXDSP_TRUE= +- HAVE_SPEEXDSP_FALSE='#' +-else +- HAVE_SPEEXDSP_TRUE='#' +- HAVE_SPEEXDSP_FALSE= +-fi +- + + + # Check whether --with-speex was given. +@@ -19626,6 +19618,15 @@ else + fi + + ++ if test "$HAVE_SPEEXDSP" = "yes" -a "$PPH" != "no"; then ++ HAVE_SPEEXDSP_TRUE= ++ HAVE_SPEEXDSP_FALSE='#' ++else ++ HAVE_SPEEXDSP_TRUE='#' ++ HAVE_SPEEXDSP_FALSE= ++fi ++ ++ + USE_LIBSPEEX="" + if test "$PPH" = "lib"; then + if test "$HAVE_SPEEXDSP" = "yes"; then Added: trunk/audio/alsa-plugins/files/patch-ffmpeg-version ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/files/patch-ffmpeg-version Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,13 @@ +Index: a52/pcm_a52.c +=================================================================== +--- a52/pcm_a52.c ++++ a52/pcm_a52.c +@@ -27,7 +27,7 @@ + #include + #include AVCODEC_HEADER + +-#if LIBAVCODEC_VERSION_MAJOR >= 53 && LIBAVCODEC_VERSION_MINOR >= 34 ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,34,0) + #include + #include + #define USE_AVCODEC_FRAME Added: trunk/audio/alsa-plugins/files/patch-jack-pcm_jack.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/files/patch-jack-pcm_jack.c Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,12 @@ +--- jack/pcm_jack.c.orig 2009-09-16 04:33:36.000000000 +0800 ++++ jack/pcm_jack.c 2009-09-16 04:33:55.000000000 +0800 +@@ -20,7 +20,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include ++#endif + #include + #include + #include Added: trunk/audio/alsa-plugins/files/patch-oss-ctl_oss.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/files/patch-oss-ctl_oss.c Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,14 @@ +--- oss/ctl_oss.c.orig 2008-10-29 08:42:13.000000000 -0400 ++++ oss/ctl_oss.c +@@ -26,7 +26,11 @@ + #include + #include + #include ++#ifdef __linux__ + #include ++#else ++#include ++#endif + + typedef struct snd_ctl_oss { + snd_ctl_ext_t ext; Added: trunk/audio/alsa-plugins/files/patch-oss-pcm_oss.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/files/patch-oss-pcm_oss.c Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,29 @@ +--- oss/pcm_oss.c.orig 2008-10-29 08:42:13.000000000 -0400 ++++ oss/pcm_oss.c +@@ -22,4 +22,8 @@ + #include + #include + #include ++#ifdef __linux__ + #include ++#else ++#include ++#endif +@@ -116,7 +120,7 @@ static int oss_drain(snd_pcm_ioplug_t *i + snd_pcm_oss_t *oss = io->private_data; + + if (io->stream == SND_PCM_STREAM_PLAYBACK) +- ioctl(oss->fd, SNDCTL_DSP_SYNC); ++ ioctl(oss->fd, SNDCTL_DSP_SYNC, NULL); + return 0; + } + +@@ -125,7 +129,7 @@ static int oss_prepare(snd_pcm_ioplug_t + snd_pcm_oss_t *oss = io->private_data; + int tmp; + +- ioctl(oss->fd, SNDCTL_DSP_RESET); ++ ioctl(oss->fd, SNDCTL_DSP_RESET, NULL); + + tmp = io->channels; + if (ioctl(oss->fd, SNDCTL_DSP_CHANNELS, &tmp) < 0) { Added: trunk/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,96 @@ +based on https://github.com/dankamongmen/libdank/blob/master/libdank/compat-FreeBSD.c + +--- usb_stream/pcm_usb_stream.c.orig ++++ usb_stream/pcm_usb_stream.c +@@ -19,7 +19,9 @@ + */ + + #define _GNU_SOURCE ++#ifndef __FreeBSD__ + #include ++#endif + #include + #include + #include +@@ -79,6 +81,69 @@ typedef struct { + static struct user_usb_stream *uus; + static pthread_mutex_t uus_mutex = PTHREAD_MUTEX_INITIALIZER; + ++#ifdef __FreeBSD__ ++/* ++ * Copyright (c) 2000-2011, Nick Black et al ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions are met: ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * * Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * * Neither the name of Nick Black nor the names of other contributors may ++ * be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, ++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ++ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, ++ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++ * POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++// This is suitable really only for use with libdank's mremap_and_ftruncate(), ++// due to assumptions it makes about the flags to pass to mmap(2). The only ++// mremap(2) use case addressed is that of MREMAP_MAYMOVE. oldaddr must be a ++// valid previous return from mmap(); NULL is not acceptable (ala Linux's ++// mremap(2)), resulting in undefined behavior, despite realloc(3) semantics. ++// Similarly, oldlen and newlen must be non-zero (and page-aligned). ++void *mremap_compat(int fd,void *oldaddr,size_t oldlen, ++ size_t newlen,int prot,int flags){ ++ void *ret; ++ ++ // From mmap(2) on freebsd 6.3: A successful FIXED mmap deletes any ++ // previous mapping in the allocated address range. This means: ++ // remapping over a current map will blow it away (unless FIXED isn't ++ // provided, in which case it can't overlap an old mapping. See bug ++ // 733 for extensive discussion of this issue for Linux and FreeBSD). ++ if((ret = mmap((char *)oldaddr + oldlen,newlen - oldlen,prot,flags,fd,oldlen)) == MAP_FAILED){ ++ // We couldn't get the memory whatsoever (or we were a fresh ++ // allocation that succeeded). Return the immediate result... ++ return ret; ++ } // ret != MAP_FAILED. Did we squash? ++ if(ret != (char *)oldaddr + oldlen){ ++ // We got the memory, but not where we wanted it. Copy over the ++ // old map, and then free it up... ++ munmap(ret,newlen - oldlen); ++ if((ret = mmap(NULL,newlen,prot,flags,fd,0)) == MAP_FAILED){ ++ return ret; ++ } ++ memcpy(ret,oldaddr,oldlen); ++ munmap(oldaddr,oldlen); // Free the old mapping ++ return ret; ++ } // We successfully squashed. Return a pointer to the first buf. ++ return oldaddr; ++} ++#endif ++ + static struct user_usb_stream *get_uus(const char *card) + { + pthread_mutex_lock(&uus_mutex); +@@ -219,7 +284,11 @@ static int snd_pcm_us_prepare(snd_pcm_io + } + + ++#ifndef __FreeBSD__ + uus->s = mremap(uus->s, sizeof(struct usb_stream), uus->s->read_size, MREMAP_MAYMOVE); ++#else ++ uus->s = mremap_compat(us->pfd.fd, uus->s, sizeof(struct usb_stream), uus->s->read_size, PROT_READ, MAP_SHARED); ++#endif + if (MAP_FAILED == uus->s) { + perror("ALSA/USX2Y: mmap"); + return -EPERM; Added: trunk/audio/alsa-plugins/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/pkg-descr Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,3 @@ +The Advanced Linux Sound Architecture (ALSA) plugins + +WWW: http://www.alsa-project.org/ Added: trunk/audio/alsa-plugins/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/alsa-plugins/pkg-plist Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,42 @@ +%%PULSEAUDIO%%lib/alsa-lib/libasound_module_conf_pulse.la +%%PULSEAUDIO%%lib/alsa-lib/libasound_module_conf_pulse.so +lib/alsa-lib/libasound_module_ctl_arcam_av.la +lib/alsa-lib/libasound_module_ctl_arcam_av.so +lib/alsa-lib/libasound_module_ctl_oss.la +lib/alsa-lib/libasound_module_ctl_oss.so +%%PULSEAUDIO%%lib/alsa-lib/libasound_module_ctl_pulse.la +%%PULSEAUDIO%%lib/alsa-lib/libasound_module_ctl_pulse.so +%%FFMPEG%%lib/alsa-lib/libasound_module_pcm_a52.la +%%FFMPEG%%lib/alsa-lib/libasound_module_pcm_a52.so +%%JACK%%lib/alsa-lib/libasound_module_pcm_jack.la +%%JACK%%lib/alsa-lib/libasound_module_pcm_jack.so +lib/alsa-lib/libasound_module_pcm_oss.la +lib/alsa-lib/libasound_module_pcm_oss.so +%%PULSEAUDIO%%lib/alsa-lib/libasound_module_pcm_pulse.la +%%PULSEAUDIO%%lib/alsa-lib/libasound_module_pcm_pulse.so +%%SPEEX%%lib/alsa-lib/libasound_module_pcm_speex.la +%%SPEEX%%lib/alsa-lib/libasound_module_pcm_speex.so +lib/alsa-lib/libasound_module_pcm_upmix.la +lib/alsa-lib/libasound_module_pcm_upmix.so +lib/alsa-lib/libasound_module_pcm_usb_stream.la +lib/alsa-lib/libasound_module_pcm_usb_stream.so +lib/alsa-lib/libasound_module_pcm_vdownmix.la +lib/alsa-lib/libasound_module_pcm_vdownmix.so +%%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavcrate.la +%%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavcrate.so +%%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavcrate_fast.so +%%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavcrate_faster.so +%%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavcrate_high.so +%%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavcrate_higher.so +%%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_samplerate.la +%%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_samplerate.so +%%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_samplerate_best.so +%%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_samplerate_linear.so +%%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_samplerate_medium.so +%%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_samplerate_order.so +%%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate.la +%%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate.so +%%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate_best.so +%%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate_medium.so +%%PULSEAUDIO%%share/alsa/alsa.conf.d/50-pulseaudio.conf +%%PULSEAUDIO%%share/alsa/alsa.conf.d/99-pulseaudio-default.conf.example Added: trunk/audio/linux-f10-alsa-lib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-lib/Makefile Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,24 @@ +# Created by: Boris Samorodov +# $FreeBSD: head/audio/linux-f10-alsa-lib/Makefile 329390 2013-10-04 21:35:35Z rene $ + +PORTNAME= alsa-lib +PORTVERSION= 1.0.21 +PORTREVISION= 3 +CATEGORIES= audio linux +MASTER_SITES= CRITICAL/rpm/${LINUX_RPM_ARCH}/fedora/${LINUX_DIST_VER} +PKGNAMEPREFIX= linux-f10- +DISTNAME= ${PORTNAME}-${PORTVERSION}-${RPMVERSION} + +MAINTAINER= emulation@FreeBSD.org +COMMENT= Advanced Linux Sound Architecture libraries (Linux Fedora 10) + +CONFLICTS= linux-alsa-lib-[0-9]* linux-f8-alsa-lib-[0-9]* + +ONLY_FOR_ARCHS= i386 amd64 +USE_LINUX_RPM= yes +LINUX_DIST_VER= 10 +RPMVERSION= 2.fc10 +BRANDELF_FILES= usr/bin/aserver +USE_LDCONFIG= yes + +.include Added: trunk/audio/linux-f10-alsa-lib/distinfo.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-lib/distinfo.i386 Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,4 @@ +SHA256 (rpm/i386/fedora/10/alsa-lib-1.0.21-2.fc10.i386.rpm) = 149d6084bf0bfd8d99a6d43a7f5488f5435e4a8928f48fa48ccc4d4536b2b959 +SIZE (rpm/i386/fedora/10/alsa-lib-1.0.21-2.fc10.i386.rpm) = 423673 +SHA256 (rpm/i386/fedora/10/alsa-lib-1.0.21-2.fc10.src.rpm) = 4cabdb017e0d176aaedfcfe91fb526a3505c6141d7ae6b404eb8c30c536f2ab0 +SIZE (rpm/i386/fedora/10/alsa-lib-1.0.21-2.fc10.src.rpm) = 826581 Added: trunk/audio/linux-f10-alsa-lib/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-lib/pkg-descr Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,4 @@ +The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI +functionality to the Linux operating system. + +WWW: http://www.alsa-project.org/ Added: trunk/audio/linux-f10-alsa-lib/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-lib/pkg-plist Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,97 @@ +@comment file listing +etc/asound.conf +lib/libasound.so.2 +lib/libasound.so.2.0.0 +usr/bin/aserver +usr/lib/alsa-lib/smixer/smixer-ac97.la +usr/lib/alsa-lib/smixer/smixer-ac97.so +usr/lib/alsa-lib/smixer/smixer-hda.la +usr/lib/alsa-lib/smixer/smixer-hda.so +usr/lib/alsa-lib/smixer/smixer-sbase.la +usr/lib/alsa-lib/smixer/smixer-sbase.so +usr/share/alsa/alsa.conf +usr/share/alsa/cards/AACI.conf +usr/share/alsa/cards/ATIIXP-MODEM.conf +usr/share/alsa/cards/ATIIXP-SPDMA.conf +usr/share/alsa/cards/ATIIXP.conf +usr/share/alsa/cards/AU8810.conf +usr/share/alsa/cards/AU8820.conf +usr/share/alsa/cards/AU8830.conf +usr/share/alsa/cards/Audigy.conf +usr/share/alsa/cards/Audigy2.conf +usr/share/alsa/cards/Aureon51.conf +usr/share/alsa/cards/Aureon71.conf +usr/share/alsa/cards/CA0106.conf +usr/share/alsa/cards/CMI8338-SWIEC.conf +usr/share/alsa/cards/CMI8338.conf +usr/share/alsa/cards/CMI8738-MC6.conf +usr/share/alsa/cards/CMI8738-MC8.conf +usr/share/alsa/cards/CMI8788.conf +usr/share/alsa/cards/CS46xx.conf +usr/share/alsa/cards/EMU10K1.conf +usr/share/alsa/cards/EMU10K1X.conf +usr/share/alsa/cards/ENS1370.conf +usr/share/alsa/cards/ENS1371.conf +usr/share/alsa/cards/ES1968.conf +usr/share/alsa/cards/FM801.conf +usr/share/alsa/cards/GUS.conf +usr/share/alsa/cards/HDA-Intel.conf +usr/share/alsa/cards/ICE1712.conf +usr/share/alsa/cards/ICE1724.conf +usr/share/alsa/cards/ICH-MODEM.conf +usr/share/alsa/cards/ICH.conf +usr/share/alsa/cards/ICH4.conf +usr/share/alsa/cards/Maestro3.conf +usr/share/alsa/cards/NFORCE.conf +usr/share/alsa/cards/PC-Speaker.conf +usr/share/alsa/cards/PMac.conf +usr/share/alsa/cards/PMacToonie.conf +usr/share/alsa/cards/PS3.conf +usr/share/alsa/cards/RME9636.conf +usr/share/alsa/cards/RME9652.conf +usr/share/alsa/cards/SB-XFi.conf +usr/share/alsa/cards/SI7018.conf +usr/share/alsa/cards/SI7018/sndoc-mixer.alisp +usr/share/alsa/cards/SI7018/sndop-mixer.alisp +usr/share/alsa/cards/TRID4DWAVENX.conf +usr/share/alsa/cards/USB-Audio.conf +usr/share/alsa/cards/VIA686A.conf +usr/share/alsa/cards/VIA8233.conf +usr/share/alsa/cards/VIA8233A.conf +usr/share/alsa/cards/VIA8237.conf +usr/share/alsa/cards/VX222.conf +usr/share/alsa/cards/VXPocket.conf +usr/share/alsa/cards/VXPocket440.conf +usr/share/alsa/cards/YMF744.conf +usr/share/alsa/cards/aliases.alisp +usr/share/alsa/cards/aliases.conf +usr/share/alsa/pcm/center_lfe.conf +usr/share/alsa/pcm/default.conf +usr/share/alsa/pcm/dmix.conf +usr/share/alsa/pcm/dpl.conf +usr/share/alsa/pcm/dsnoop.conf +usr/share/alsa/pcm/front.conf +usr/share/alsa/pcm/hdmi.conf +usr/share/alsa/pcm/iec958.conf +usr/share/alsa/pcm/modem.conf +usr/share/alsa/pcm/rear.conf +usr/share/alsa/pcm/side.conf +usr/share/alsa/pcm/surround40.conf +usr/share/alsa/pcm/surround41.conf +usr/share/alsa/pcm/surround50.conf +usr/share/alsa/pcm/surround51.conf +usr/share/alsa/pcm/surround71.conf +usr/share/alsa/smixer.conf +usr/share/alsa/sndo-mixer.alisp +usr/share/doc/alsa-lib-1.0.21/COPYING +usr/share/doc/alsa-lib-1.0.21/ChangeLog +usr/share/doc/alsa-lib-1.0.21/TODO +usr/share/doc/alsa-lib-1.0.21/asoundrc.txt +@comment non-empty directory listing in revers order +@dirrm usr/share/doc/alsa-lib-1.0.21 +@dirrm usr/share/alsa/pcm +@dirrm usr/share/alsa/cards/SI7018 +@dirrm usr/share/alsa/cards +@dirrm usr/share/alsa +@dirrm usr/lib/alsa-lib/smixer +@dirrm usr/lib/alsa-lib Added: trunk/audio/linux-f10-alsa-plugins-oss/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-plugins-oss/Makefile Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,35 @@ +# Created by: hashiz +# $FreeBSD: head/audio/linux-f10-alsa-plugins-oss/Makefile 327706 2013-09-20 14:36:35Z bapt $ + +PORTNAME= alsa-plugins-oss +PORTVERSION= 1.0.21 +PORTREVISION= 3 +CATEGORIES= audio linux +PKGNAMEPREFIX= linux-f10- +DISTNAME= ${PORTNAME}-${PORTVERSION}-${RPMVERSION} + +MAINTAINER= hashiz@meridiani.jp +COMMENT= OSS plugin for ALSA (Linux Fedora 10) + +ONLY_FOR_ARCHS= i386 amd64 +USE_LINUX_RPM= yes +NO_STAGE= yes +USE_LINUX_APPS= alsalib +LINUX_DIST_VER= 10 +RPMVERSION= 3.fc10 +SRC_DISTFILES= ${PORTNAME:S/-oss//}-${PORTVERSION}-${RPMVERSION}${SRC_SUFX} +USE_LDCONFIG= yes + +CONF_FILE= etc/alsa/pcm/pcm-oss.conf + +post-patch: + @${RM} ${WRKSRC}/${CONF_FILE}.orig + @${MV} ${WRKSRC}/${CONF_FILE} ${WRKSRC}/${CONF_FILE}-dist + +post-install: + @if [ ! -f ${PREFIX}/${CONF_FILE} ]; then \ + ${CP} -p ${PREFIX}/${CONF_FILE}-dist ${PREFIX}/${CONF_FILE} ; \ + fi + PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + +.include Added: trunk/audio/linux-f10-alsa-plugins-oss/distinfo.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-plugins-oss/distinfo.i386 Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,4 @@ +SHA256 (rpm/i386/fedora/10/alsa-plugins-oss-1.0.21-3.fc10.i386.rpm) = 60f61d38f02e9463b4f8b98f0fe2320e36207e740f72ee6b7d6b56553729638a +SIZE (rpm/i386/fedora/10/alsa-plugins-oss-1.0.21-3.fc10.i386.rpm) = 29350 +SHA256 (rpm/i386/fedora/10/alsa-plugins-1.0.21-3.fc10.src.rpm) = 3a6d04b23d326e375f14dba73daf2c0d9e54ba149df8b431238b184dc4607467 +SIZE (rpm/i386/fedora/10/alsa-plugins-1.0.21-3.fc10.src.rpm) = 338350 Added: trunk/audio/linux-f10-alsa-plugins-oss/files/patch-pcm-oss.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-plugins-oss/files/patch-pcm-oss.conf Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,14 @@ +--- etc/alsa/pcm/pcm-oss.conf.orig 2010-03-23 10:56:41.000000000 +0900 ++++ etc/alsa/pcm/pcm-oss.conf 2010-03-23 10:57:30.000000000 +0900 +@@ -7,3 +7,11 @@ + description "Open Sound System" + } + } ++ ++ctl.oss { ++ type oss ++ device /dev/mixer ++ hint { ++ description "Open Sound System" ++ } ++} Added: trunk/audio/linux-f10-alsa-plugins-oss/pkg-deinstall ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-plugins-oss/pkg-deinstall Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,16 @@ +#!/bin/sh + +case "$2" in + POST-DEINSTALL) + conf=${PKG_PREFIX}/etc/asound.conf + if [ ! -f "$conf" ]; then + exit 1 + fi + grep -v '/etc/alsa/pcm/pcm-oss\.conf' <$conf >/tmp/asound.conf.new + ;; + *) + exit 0 + ;; +esac + +exit 0 Added: trunk/audio/linux-f10-alsa-plugins-oss/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-plugins-oss/pkg-descr Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,4 @@ +The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI +functionality to the Linux operating system. + +WWW: http://www.alsa-project.org/ Added: trunk/audio/linux-f10-alsa-plugins-oss/pkg-install ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-plugins-oss/pkg-install Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,18 @@ +#!/bin/sh + +case "$2" in + POST-INSTALL) + conf=${PKG_PREFIX}/etc/asound.conf + if [ ! -f "$conf" ]; then + exit 1 + fi + awk '{print $0}; /files/ { print "\t\t\t\"/etc/alsa/pcm/pcm-oss.conf\""}' <$conf >/tmp/asound.conf.new + mv /tmp/asound.conf.new $conf + exit 0 + ;; + *) + exit 0 + ;; +esac + +exit 0 Added: trunk/audio/linux-f10-alsa-plugins-oss/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/audio/linux-f10-alsa-plugins-oss/pkg-plist Sun Dec 1 00:59:27 2013 (r1411) @@ -0,0 +1,13 @@ +@unexec if cmp -s %D/etc/alsa/pcm/pcm-oss.conf-dist %D/etc/alsa/pcm/pcm-oss.conf; then rm -f %D/etc/alsa/pcm/pcm-oss.conf; fi +etc/alsa/pcm/pcm-oss.conf-dist +@exec if [ ! -f %D/etc/alsa/pcm/pcm-oss.conf ] ; then cp -p %D/%F %B/pcm-oss.conf; fi +usr/lib/alsa-lib/libasound_module_ctl_oss.so +usr/lib/alsa-lib/libasound_module_pcm_oss.so +usr/share/doc/alsa-plugins-oss-1.0.21/COPYING +usr/share/doc/alsa-plugins-oss-1.0.21/COPYING.GPL +usr/share/doc/alsa-plugins-oss-1.0.21/README-pcm-oss +@dirrm usr/share/doc/alsa-plugins-oss-1.0.21 +@dirrmtry etc/alsa/pcm +@dirrmtry etc/alsa +@dirrmtry usr/lib/alsa-lib +@unexec if [ -f %D/etc/asound.conf ]; then fgrep -v '/etc/alsa/pcm/pcm-oss.conf' <%D/etc/asound.conf >/tmp/asound.conf.new; mv /tmp/asound.conf.new %D/etc/asound.conf; fi