--- src/linux/snd_linux.c.orig Tue Jan 9 17:28:56 2007 +++ src/linux/snd_linux.c Tue Jan 9 17:29:28 2007 @@ -115,15 +115,6 @@ return 0; } - if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1) - { - perror("GETOSPACE"); - Com_Printf("SNDDMA_Init: GETOSPACE ioctl failed.\n"); - close(audio_fd); - audio_fd = -1; - return 0; - } - // set sample bits & speed dma.samplebits = (int)sndbits->value; @@ -211,6 +202,15 @@ return 0; } + if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1) + { + perror("GETOSPACE"); + Com_Printf("SNDDMA_Init: GETOSPACE ioctl failed.\n"); + close(audio_fd); + audio_fd = -1; + return 0; + } + dma.samples = info.fragstotal * info.fragsize / (dma.samplebits/8); dma.submission_chunk = 1;