diff options
Diffstat (limited to 'audio/alsa-plugins/files')
-rw-r--r-- | audio/alsa-plugins/files/alsa-plugins.patch | 30 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-arcam-av-arcam_av.c | 19 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-configure | 59 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-jack-pcm_jack.c | 12 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-oss-ctl_oss.c | 14 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-oss-pcm_oss.c | 29 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c | 96 |
7 files changed, 186 insertions, 73 deletions
diff --git a/audio/alsa-plugins/files/alsa-plugins.patch b/audio/alsa-plugins/files/alsa-plugins.patch index b285aa3accf4..c7ebabd0f3ad 100644 --- a/audio/alsa-plugins/files/alsa-plugins.patch +++ b/audio/alsa-plugins/files/alsa-plugins.patch @@ -1,29 +1,5 @@ ---- 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 <byteswap.h> -+#endif - #include <sys/shm.h> - #include <sys/types.h> - #include <sys/socket.h> --- 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 -@@ -26,7 +26,11 @@ - #include <sys/ioctl.h> - #include <alsa/asoundlib.h> - #include <alsa/control_external.h> -+#ifdef __FreeBSD__ -+#include <sys/soundcard.h> -+#else - #include <linux/soundcard.h> -+#endif - - typedef struct snd_ctl_oss { - snd_ctl_ext_t ext; @@ -362,7 +366,9 @@ { snd_config_iterator_t it, next; @@ -66,15 +42,13 @@ 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,57 @@ +@@ -22,17 +22,55 @@ #include <sys/ioctl.h> #include <alsa/asoundlib.h> #include <alsa/pcm_external.h> + #include <linux/soundcard.h> +#ifdef __FreeBSD__ +#include <sys/param.h> -+#include <sys/soundcard.h> -+#else - #include <linux/soundcard.h> +#endif + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) diff --git a/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c b/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c new file mode 100644 index 000000000000..2826201f10a5 --- /dev/null +++ b/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c @@ -0,0 +1,19 @@ +--- arcam-av/arcam_av.c.orig ++++ arcam-av/arcam_av.c +@@ -27,6 +27,7 @@ + #include <signal.h> + #include <stddef.h> + #include <stdio.h> ++#include <string.h> + #include <termios.h> + #include <unistd.h> + +@@ -37,6 +38,8 @@ + #include <sys/socket.h> + #include <sys/un.h> + ++#define AF_FILE AF_UNIX ++ + #define MIN(a, b) ((a) < (b) ? (a) : (b)) + #define MAX(a, b) ((a) > (b) ? (a) : (b)) + diff --git a/audio/alsa-plugins/files/patch-configure b/audio/alsa-plugins/files/patch-configure index 3580160d1b36..a0da753a0c6d 100644 --- a/audio/alsa-plugins/files/patch-configure +++ b/audio/alsa-plugins/files/patch-configure @@ -1,31 +1,10 @@ --- configure.orig 2010-04-16 13:18:56.000000000 +0200 +++ configure 2010-05-11 00:08:29.000000000 +0200 -@@ -21249,6 +21249,20 @@ - - - -+ -+ -+ -+# Check whether --with-speex was given. -+if test "${with_speex+set}" = set; then -+ withval=$with_speex; PPH=$withval -+else -+ PPH="lib" -+fi -+ -+ -+USE_LIBSPEEX="" -+HAVE_SPEEXDSP="" -+if test "$PPH" = "lib"; then - pkg_failed=no - { echo "$as_me:$LINENO: checking for speexdsp" >&5 - echo $ECHO_N "checking for speexdsp... $ECHO_C" >&6; } -@@ -21319,26 +21333,6 @@ +@@ -19608,14 +19608,6 @@ else + $as_echo "yes" >&6; } + HAVE_SPEEXDSP="yes" fi - - --if test "$HAVE_SPEEXDSP" = "yes"; then +- if test "$HAVE_SPEEXDSP" = "yes"; then - HAVE_SPEEXDSP_TRUE= - HAVE_SPEEXDSP_FALSE='#' -else @@ -33,32 +12,22 @@ - HAVE_SPEEXDSP_FALSE= -fi - -- -- --# Check whether --with-speex was given. --if test "${with_speex+set}" = set; then -- withval=$with_speex; PPH=$withval --else -- PPH="lib" --fi -- -- --USE_LIBSPEEX="" --if test "$PPH" = "lib"; then - if test "$HAVE_SPEEXDSP" = "yes"; then - { echo "$as_me:$LINENO: checking for speex_resampler_init in -lspeexdsp" >&5 - echo $ECHO_N "checking for speex_resampler_init in -lspeexdsp... $ECHO_C" >&6; } -@@ -21437,6 +21431,13 @@ + + + # Check whether --with-speex was given. +@@ -19626,6 +19618,15 @@ else fi -+if test "$HAVE_SPEEXDSP" = "yes"; then ++ if test "$HAVE_SPEEXDSP" = "yes" -a "$PPH" != "no"; then + HAVE_SPEEXDSP_TRUE= + HAVE_SPEEXDSP_FALSE='#' +else + HAVE_SPEEXDSP_TRUE='#' + HAVE_SPEEXDSP_FALSE= +fi - - if test "$PPH" = "builtin" -o "$PPH" = "lib"; then - HAVE_PPH_TRUE= ++ ++ + USE_LIBSPEEX="" + if test "$PPH" = "lib"; then + if test "$HAVE_SPEEXDSP" = "yes"; then diff --git a/audio/alsa-plugins/files/patch-jack-pcm_jack.c b/audio/alsa-plugins/files/patch-jack-pcm_jack.c new file mode 100644 index 000000000000..643954784152 --- /dev/null +++ b/audio/alsa-plugins/files/patch-jack-pcm_jack.c @@ -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 <byteswap.h> ++#endif + #include <sys/shm.h> + #include <sys/types.h> + #include <sys/socket.h> diff --git a/audio/alsa-plugins/files/patch-oss-ctl_oss.c b/audio/alsa-plugins/files/patch-oss-ctl_oss.c new file mode 100644 index 000000000000..09b9b308f038 --- /dev/null +++ b/audio/alsa-plugins/files/patch-oss-ctl_oss.c @@ -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 <sys/ioctl.h> + #include <alsa/asoundlib.h> + #include <alsa/control_external.h> ++#ifdef __linux__ + #include <linux/soundcard.h> ++#else ++#include <sys/soundcard.h> ++#endif + + typedef struct snd_ctl_oss { + snd_ctl_ext_t ext; diff --git a/audio/alsa-plugins/files/patch-oss-pcm_oss.c b/audio/alsa-plugins/files/patch-oss-pcm_oss.c new file mode 100644 index 000000000000..98de34bb8d74 --- /dev/null +++ b/audio/alsa-plugins/files/patch-oss-pcm_oss.c @@ -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 <sys/ioctl.h> + #include <alsa/asoundlib.h> + #include <alsa/pcm_external.h> ++#ifdef __linux__ + #include <linux/soundcard.h> ++#else ++#include <sys/soundcard.h> ++#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) { diff --git a/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c b/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c new file mode 100644 index 000000000000..ebb3d7dc0cc2 --- /dev/null +++ b/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c @@ -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 +@@ -18,7 +18,9 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + ++#ifndef __FreeBSD__ + #include <byteswap.h> ++#endif + #define _GNU_SOURCE + #include <sys/mman.h> + #include <sys/shm.h> +@@ -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 <copyright ++ * holder> 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; |