On Mon, Jan 25, 2010 at 12:07:03AM +0000, Jacob Meuser wrote:
> does this actually work for anyone?  I tried to set an alarm, but the
> audio device is never opened anywhere near the time I chose.  and even
> if it does try to play the sound, I doubt it is working correctly (if
> at all) on most systems, as it never sets the audio parameters.
> 
> also, the patches to use AUDIO_DRAIN are dumb, because the use of
> SNDCTL_DSP_SYNC (AUDIO_DRAIN is the more-or-less audio(4) equivalent)
> is dumb.  from the online opensound.com manual, "This call is
> practically useless and should be avoided in applications.  The sync
> operation will always cause a more or less noticeable pause or click
> in the output."

so this removes AUDIO_DRAIN.  ok?

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/emiclock/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- Makefile    25 Jul 2008 23:32:12 -0000      1.18
+++ Makefile    21 Mar 2010 15:43:55 -0000
@@ -3,7 +3,7 @@
 COMMENT=       hyper-animated face analog clock for X11
 
 DISTNAME=      emiclock-2.0.2
-PKGNAME=       ${DISTNAME}p0
+PKGNAME=       ${DISTNAME}p1
 CATEGORIES=    x11
 
 MASTER_SITES=  http://download.vector.co.jp/pack/unix/personal/tokei/
Index: patches/patch-include_sound_h
===================================================================
RCS file: /cvs/ports/x11/emiclock/patches/patch-include_sound_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-include_sound_h
--- patches/patch-include_sound_h       8 Nov 2009 16:35:22 -0000       1.2
+++ patches/patch-include_sound_h       21 Mar 2010 15:43:55 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-include_sound_h,v 1.2 2009/11/08 16:35:22 jasper Exp $
---- include/sound.h.orig       Thu Sep  2 16:34:10 1999
-+++ include/sound.h    Sun Nov  8 17:35:10 2009
-@@ -212,17 +212,23 @@ struct SoundCacheBufferTag {
+--- include/sound.h.orig       Thu Sep  2 07:34:10 1999
++++ include/sound.h    Sun Mar 21 08:36:43 2010
+@@ -212,17 +212,19 @@ struct SoundCacheBufferTag {
  
  
  /*
@@ -21,14 +21,10 @@ $OpenBSD: patch-include_sound_h,v 1.2 20
 +#if defined(__FreeBSD__)
  #include <machine/soundcard.h>
 +#endif
-+#if defined(__OpenBSD__)
-+#include <sys/ioctl.h>
-+#include <sys/audioio.h>
-+#endif
  
  #undef        O_RDWR
  #define       O_RDWR  O_WRONLY        /* audio 
$B%G%P%$%9$OF1;~%*!<%W%s$G$-$J$$!)(B */
-@@ -235,7 +241,7 @@ struct SoundCacheBufferTag {
+@@ -235,7 +237,7 @@ struct SoundCacheBufferTag {
  #define       SoundCacheBuffer        struct SoundCacheBufferTag
  #define       AUDIO_DEVICE            "/dev/audio"
  
Index: patches/patch-sys_FreeBSD_audio_c
===================================================================
RCS file: /cvs/ports/x11/emiclock/patches/patch-sys_FreeBSD_audio_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-sys_FreeBSD_audio_c
--- patches/patch-sys_FreeBSD_audio_c   26 Oct 2007 20:44:07 -0000      1.1
+++ patches/patch-sys_FreeBSD_audio_c   21 Mar 2010 15:43:55 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-sys_FreeBSD_audio_c,v 1.1 2007/10/26 20:44:07 jasper Exp $
---- sys/FreeBSD/audio.c.orig   Thu Sep  2 16:34:34 1999
-+++ sys/FreeBSD/audio.c        Fri Oct 26 22:33:32 2007
+--- sys/FreeBSD/audio.c.orig   Thu Sep  2 07:34:34 1999
++++ sys/FreeBSD/audio.c        Sun Mar 21 08:35:50 2010
 @@ -90,7 +90,9 @@ S_PlaySound(char *soundfile)
        return (SOUND_DEVICE_ERROR);
      }
@@ -11,19 +11,17 @@ $OpenBSD: patch-sys_FreeBSD_audio_c,v 1.
      
      fstat(sfile, &sstat);
      len = sstat.st_size;
-@@ -100,7 +102,11 @@ S_PlaySound(char *soundfile)
+@@ -100,7 +102,9 @@ S_PlaySound(char *soundfile)
      if ( (l = read(sfile, buffer, len)) > 0)
        write(sdev, buffer, l);
      
 +#ifdef __FreeBSD__
      ioctl(sdev, SNDCTL_DSP_SYNC, 0);
-+#elif defined(__OpenBSD__)
-+    ioctl(sdev, AUDIO_DRAIN, 0);
 +#endif
      XtFree(buffer);
      
      close(sdev); 
-@@ -159,11 +165,17 @@ S_PlayCacheSound(SoundCacheBuffer *cacheBufferPtr)
+@@ -159,11 +163,15 @@ S_PlayCacheSound(SoundCacheBuffer *cacheBufferPtr)
        return(SOUND_DEVICE_ERROR);
      }
      
@@ -35,8 +33,6 @@ $OpenBSD: patch-sys_FreeBSD_audio_c,v 1.
      
 +#ifdef __FreeBSD__
      ioctl(sdev, SNDCTL_DSP_SYNC, 0);
-+#elif defined(__OpenBSD__)
-+    ioctl(sdev, AUDIO_DRAIN, 0);
 +#endif
      close(sdev);
      

Reply via email to