Google didn't show any hits for this issue with respect to SCID in
particular so I thought I'd report it. SCID relies on snack for
announcing moves. Snack has been maintained to varying degrees on
different distributions, there is a catch {} around the actual move
announcement call so it was silently failing for me on ubuntu.
Apparently snack now needs to be compiled with ALSA support enabled
(which Ubuntu doesn't do) or it will complain about the absence of
/dev/sound/dsp. To add insult to injury snack's alsa code relies on a
private symbol in the PCM library which is no longer exported and thus
now requires the patch below which I found here:
http://forum.myah.org/viewtopic.php?p=7274&sid=3fd8e925b927c1ee06dabcdbf9a6238e

The "speak" script from crafty was initially a quick workaround but it
doesn't make blocking calls to esdplay so sounds aren't always clear.

I tried out the move announcement feature in SCID today because I like
to walk through master's games on a physical board and I find it
distracting to move my eyes back and forth from the board to a sheet
with the list of moves. Grandmasters frequently resign many moves
before checkmate and it is a bit unsettling to simply have it stop
announcing moves so after having familiarized myself with SCID a
little bit to diagnose the aforementioned problem I added a "black
resigns", "white resigns", "draw" feature. I didn't add the
localization field for quite every language because I wasn't convinced
that a patch would be accepted. The patch for this can be found here:
http://pastebin.com/GTLFby3c  One will obviously need additional .wav
files - I just recorded it myself.


Keep up the good work.

Thanks



--- unix/jkAudIO_alsa.c   2005-12-14 12:29:38.000000000 +0100
+++ unix/jkAudIO_alsa.c   2008-09-01 22:51:20.000000000 +0200
@@ -49,6 +49,8 @@

static int minNumChan = 1;

+static snd_pcm_uframes_t hw_bufsize = 0;
+
int
SnackAudioOpen(ADesc *A, Tcl_Interp *interp, char *device, int mode, int freq,
          int nchannels, int encoding)
@@ -135,6 +137,9 @@
     Tcl_AppendResult(interp, "Failed setting HW params.", NULL);
     return TCL_ERROR;
   }
+
+  snd_pcm_hw_params_get_buffer_size (hw_params, &hw_bufsize);
+
   snd_pcm_hw_params_free(hw_params);
   snd_pcm_prepare(A->handle);
   if (A->mode == RECORD) {
@@ -202,6 +207,8 @@
   int i;
   static char buf[64];

+  return;
+
   if (A->debug > 1) Snack_WriteLog("  Enter SnackAudioPost\n");

   for (i = 0; i < 1000; i++) {
@@ -267,12 +274,14 @@
long
SnackAudioPlayed(ADesc *A)
{
-  long avail = _snd_pcm_mmap_hw_ptr(A->handle);
+  // FIX Here, _snd_pcm_mmap_hw_ptr is deprecated in new alsalib
+  long played = A->nWritten - (hw_bufsize - SnackAudioWriteable(A));
+  // long avail = _snd_pcm_mmap_hw_ptr(A->handle);

-  if (avail < 0)
-    avail = 0;
+  if (played < 0)
+   return 0;

-  return (avail+A->nPlayed);
+  return (played);
}

void

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Scid-users mailing list
Scid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scid-users

Reply via email to