qudos
2005-10-18 18:29:16 UTC
Anyone with quake2 sound problems can try this, works for me
snd_linux.c
move this call, line ~118
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;
}
............
..........
to... line ~213
............
............
close(audio_fd);
audio_fd = -1;
return 0;
}
#put the code here
dma.samples = info.fragstotal * info.fragsize / (dma.samplebits/8);
dma.submission_chunk = 1;
// memory map the dma buffer
.......
diffs
--- snd_linux.c 2005-10-18 20:23:44.448855168 +0200
+++ snd_linux-fix.c 2005-10-18 20:27:42.554657584 +0200
@@ -114,7 +114,7 @@
audio_fd = -1;
return 0;
}
-
+/* // moved below line 214 QuDos
if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1)
{
perror("GETOSPACE");
@@ -123,7 +123,7 @@
audio_fd = -1;
return 0;
}
-
+*/
// set sample bits & speed
dma.samplebits = (int)sndbits->value;
@@ -210,6 +210,15 @@
audio_fd = -1;
return 0;
}
+//sound fix QuDos
+ 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;
snd_linux.c
move this call, line ~118
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;
}
............
..........
to... line ~213
............
............
close(audio_fd);
audio_fd = -1;
return 0;
}
#put the code here
dma.samples = info.fragstotal * info.fragsize / (dma.samplebits/8);
dma.submission_chunk = 1;
// memory map the dma buffer
.......
diffs
--- snd_linux.c 2005-10-18 20:23:44.448855168 +0200
+++ snd_linux-fix.c 2005-10-18 20:27:42.554657584 +0200
@@ -114,7 +114,7 @@
audio_fd = -1;
return 0;
}
-
+/* // moved below line 214 QuDos
if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1)
{
perror("GETOSPACE");
@@ -123,7 +123,7 @@
audio_fd = -1;
return 0;
}
-
+*/
// set sample bits & speed
dma.samplebits = (int)sndbits->value;
@@ -210,6 +210,15 @@
audio_fd = -1;
return 0;
}
+//sound fix QuDos
+ 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;