pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/SDL



Module Name:    pkgsrc
Committed By:   nat
Date:           Fri Oct 27 01:28:53 UTC 2017

Modified Files:
        pkgsrc/devel/SDL: Makefile distinfo
Added Files:
        pkgsrc/devel/SDL: MESSAGE
        pkgsrc/devel/SDL/patches: patch-src_audio_dma_SDL__dmaaudio.c

Log Message:
Enable oss dma backend for NetBSD-8.

Bump PKG_REVISION.

OK wiz@.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/SDL/MESSAGE
cvs rdiff -u -r1.126 -r1.127 pkgsrc/devel/SDL/Makefile
cvs rdiff -u -r1.78 -r1.79 pkgsrc/devel/SDL/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/SDL/patches/patch-src_audio_dma_SDL__dmaaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/SDL/Makefile
diff -u pkgsrc/devel/SDL/Makefile:1.126 pkgsrc/devel/SDL/Makefile:1.127
--- pkgsrc/devel/SDL/Makefile:1.126     Fri Sep  8 02:38:38 2017
+++ pkgsrc/devel/SDL/Makefile   Fri Oct 27 01:28:53 2017
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.126 2017/09/08 02:38:38 ryoon Exp $
+# $NetBSD: Makefile,v 1.127 2017/10/27 01:28:53 nat Exp $
 
 DISTNAME=      SDL-1.2.15
-PKGREVISION=   21
+PKGREVISION=   22
 CATEGORIES=    devel games
 MASTER_SITES=  http://www.libsdl.org/release/
 

Index: pkgsrc/devel/SDL/distinfo
diff -u pkgsrc/devel/SDL/distinfo:1.78 pkgsrc/devel/SDL/distinfo:1.79
--- pkgsrc/devel/SDL/distinfo:1.78      Tue Nov  3 03:27:12 2015
+++ pkgsrc/devel/SDL/distinfo   Fri Oct 27 01:28:53 2017
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.78 2015/11/03 03:27:12 agc Exp $
+$NetBSD: distinfo,v 1.79 2017/10/27 01:28:53 nat Exp $
 
 SHA1 (SDL-1.2.15.tar.gz) = 0c5f193ced810b0d7ce3ab06d808cbb5eef03a2c
 RMD160 (SDL-1.2.15.tar.gz) = d4802a090cb4a24eeb0c8ce5690802f596d394c3
@@ -7,6 +7,7 @@ Size (SDL-1.2.15.tar.gz) = 3920622 bytes
 SHA1 (patch-aa) = 00fb7a85caf8fc9f08298d0a07a4587757fdffb0
 SHA1 (patch-ac) = 8b2dddff9ad449b19b35ef364e2d960e46284563
 SHA1 (patch-src_audio_bsd_SDL__bsdaudio.c) = 7f5fbf4d839e52fce028810dc807b404fcd51442
+SHA1 (patch-src_audio_dma_SDL__dmaaudio.c) = cede64d04e8872b11851bfcacbc99059df973881
 SHA1 (patch-src_audio_sun_SDL__sunaudio.c) = 4b492b40d39e6444037dfda55766e4a149cc6c30
 SHA1 (patch-src_joystick_bsd_SDL__sysjoystick.c) = 46029dda8975dcb891a5b14b718c27b034ce5b06
 SHA1 (patch-src_video_quartz_SDL__QuartzVideo.h) = 19d952bade06dbd646e94f42139c38436969b1a8

Added files:

Index: pkgsrc/devel/SDL/MESSAGE
diff -u /dev/null pkgsrc/devel/SDL/MESSAGE:1.1
--- /dev/null   Fri Oct 27 01:28:53 2017
+++ pkgsrc/devel/SDL/MESSAGE    Fri Oct 27 01:28:53 2017
@@ -0,0 +1,16 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2017/10/27 01:28:53 nat Exp $
+
+To enable dma for use with NetBSD-8 or above.
+
+Set the following environment variables:
+       SDL_DSP_DMA_PRECISION
+       SDL_DSP_DMA_FREQ
+       SDL_DSP_DMA_CHANNELS
+
+       SDL_DSP_NOSELECT=1
+
+DMA parameters must match the hw virtual channel format for playback to
+work with dma.
+
+===========================================================================

Index: pkgsrc/devel/SDL/patches/patch-src_audio_dma_SDL__dmaaudio.c
diff -u /dev/null pkgsrc/devel/SDL/patches/patch-src_audio_dma_SDL__dmaaudio.c:1.1
--- /dev/null   Fri Oct 27 01:28:53 2017
+++ pkgsrc/devel/SDL/patches/patch-src_audio_dma_SDL__dmaaudio.c        Fri Oct 27 01:28:53 2017
@@ -0,0 +1,124 @@
+$NetBSD: patch-src_audio_dma_SDL__dmaaudio.c,v 1.1 2017/10/27 01:28:53 nat Exp $
+
+Enable dma for use with netbsd-8.
+
+DMA parameters must match the hw virtual channel format.
+These parameters are controlled by environment variables:
+       SDL_DSP_DMA_PRECISION, SDL_DSP_DMA_FREQ and SDL_DSP_DMA_CHANNELS.
+I found it also necessary to set SDL_DSP_NOSELECT=1 for playback to work with
+dma.
+--- src/audio/dma/SDL_dmaaudio.c.orig  2012-01-19 06:30:06.000000000 +0000
++++ src/audio/dma/SDL_dmaaudio.c
+@@ -24,6 +24,7 @@
+ /* Allow access to a raw mixing buffer */
+ 
+ #include <stdio.h>
++#include <stdbool.h>
+ #include <string.h>   /* For strerror() */
+ #include <errno.h>
+ #include <unistd.h>
+@@ -29,6 +31,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/ioctl.h>
+@@ -311,7 +313,9 @@ static int DMA_OpenAudio(_THIS, SDL_Audi
+       int format;
+       int stereo;
+       int value;
++#if !defined(__NetBSD__) || (__NetBSD_Version__ < 800000000)
+       Uint16 test_format;
++#endif
+       struct audio_buf_info info;
+ 
+       /* Reset the timer synchronization flag */
+@@ -333,6 +337,7 @@ static int DMA_OpenAudio(_THIS, SDL_Audi
+       }
+ 
+       /* Try for a closest match on audio format */
++#if !defined(__NetBSD__) || (__NetBSD_Version__ < 800000000)
+       format = 0;
+       for ( test_format = SDL_FirstAudioFormat(spec->format);
+                                               ! format && test_format; ) {
+@@ -383,6 +388,78 @@ static int DMA_OpenAudio(_THIS, SDL_Audi
+               return(-1);
+       }
+       spec->format = test_format;
++#else
++      char *tmpenv;
++      int prec;
++      bool be = false;
++
++      if (_BYTE_ORDER == _BIG_ENDIAN)
++              be = true;
++      tmpenv = getenv("SDL_DSP_DMA_PRECISION");
++      if (tmpenv == NULL)
++              prec = 0;
++      else
++              prec = atoi(tmpenv);
++      tmpenv = getenv("SDL_DSP_DMA_FREQ");
++      if (tmpenv == NULL)
++              spec->freq = 0;
++      else
++              spec->freq = atoi(tmpenv);
++      tmpenv = getenv("SDL_DSP_DMA_CHANNELS");
++      if (tmpenv == NULL)
++              spec->channels = 0;
++      else
++              spec->channels = atoi(tmpenv);
++      if (prec == 0) {
++              fprintf(stderr, "SDL_DSP_DMA_PRECISION must be set to virtual "
++                  "format precision");
++              return -1;
++      }
++      if (spec->channels == 0) {
++              fprintf(stderr, "SDL_DSP_DMA_CHANNELS must be set to virtual "
++                  "format number of harware channels");
++              return -1;
++      }
++      if (spec->freq == 0) {
++              fprintf(stderr, "SDL_DSP_DMA_FREQ must be set to virtual "
++                  "format frequency");
++              return -1;
++      }
++      switch(prec) {
++      case 8:
++              spec->format = AUDIO_S8;
++              format = AFMT_S8;
++              break;
++#ifdef notyet
++      case 24:
++              if (be) {
++                      spec->format = AUDIO_S24MSB;
++                      format = AFMT_S24_BE;
++              } else {
++                      spec->format = AUDIO_S24LSB;
++                      format = AFMT_S24_LE;
++              }
++              break;
++      case 32:
++              if (be) {
++                      spec->format = AUDIO_S32MSB;
++                      format = AFMT_S32_BE;
++              } else {
++                      spec->format = AUDIO_S32LSB;
++                      format = AFMT_S32_LE;
++              }
++              break;
++#endif
++      default:
++              if (be) {
++                      spec->format = AUDIO_S16MSB;
++                      format = AFMT_S16_BE;
++              } else {
++                      spec->format = AUDIO_S16LSB;
++                      format = AFMT_S16_LE;
++              }
++      }
++#endif
+ 
+       /* Set the audio format */
+       value = format;



Home | Main Index | Thread Index | Old Index