1 --- ../../snack2.2.10.ori/unix/jkAudIO_alsa.c 2005-12-14 12:29:38.000000000 +0100
2 +++ jkAudIO_alsa.c 2008-09-01 22:51:20.000000000 +0200
5 static int minNumChan = 1;
7 +static snd_pcm_uframes_t hw_bufsize = 0;
10 SnackAudioOpen(ADesc *A, Tcl_Interp *interp, char *device, int mode, int freq,
11 int nchannels, int encoding)
13 Tcl_AppendResult(interp, "Failed setting HW params.", NULL);
17 + snd_pcm_hw_params_get_buffer_size (hw_params, &hw_bufsize);
19 snd_pcm_hw_params_free(hw_params);
20 snd_pcm_prepare(A->handle);
21 if (A->mode == RECORD) {
28 if (A->debug > 1) Snack_WriteLog(" Enter SnackAudioPost\n");
30 for (i = 0; i < 1000; i++) {
33 SnackAudioPlayed(ADesc *A)
35 - long avail = _snd_pcm_mmap_hw_ptr(A->handle);
36 + // FIX Here, _snd_pcm_mmap_hw_ptr is deprecated in new alsalib
37 + long played = A->nWritten - (hw_bufsize - SnackAudioWriteable(A));
38 + // long avail = _snd_pcm_mmap_hw_ptr(A->handle);
45 - return (avail+A->nPlayed);