Discussion:
Sound fix Linux
qudos
2005-10-18 18:29:16 UTC
Permalink
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;
Nick Warne
2005-10-18 18:32:08 UTC
Permalink
Post by qudos
Anyone with quake2 sound problems can try this, works for me
Without reading the diff, what exactly are 'sound problems'?

You could be a bit more specific.

Nick
--
http://sourceforge.net/projects/quake2plus

"Person who say it cannot be done should not interrupt person doing it."
-Chinese Proverb
qudos
2005-10-18 18:34:51 UTC
Permalink
The quake2 binary is useless for me, i must to use sdlquake2 for get sound
Post by Nick Warne
Post by qudos
Anyone with quake2 sound problems can try this, works for me
Without reading the diff, what exactly are 'sound problems'?
You could be a bit more specific.
Nick
--
http://sourceforge.net/projects/quake2plus
"Person who say it cannot be done should not interrupt person doing it."
-Chinese Proverb
Nick Warne
2005-10-18 18:42:35 UTC
Permalink
Post by qudos
The quake2 binary is useless for me, i must to use sdlquake2 for get sound
Well I use SDL too, but I meant what does the patch address?

Nick
--
http://sourceforge.net/projects/quake2plus

"Person who say it cannot be done should not interrupt person doing it."
-Chinese Proverb
qudos
2005-10-18 19:06:39 UTC
Permalink
When you run the quake2 binary, how is the sound?

I have no errors, but the sound is all broke, every 1 second is stopped.

Since i have no problems with quake3 and sound i was taking alook how
quake3 did, If you take a look to the quake3 linux_snd.c you can
notice where the "GETOSPACE" is.

Cheers
Post by Nick Warne
Post by qudos
The quake2 binary is useless for me, i must to use sdlquake2 for get sound
Well I use SDL too, but I meant what does the patch address?
Nick
--
http://sourceforge.net/projects/quake2plus
"Person who say it cannot be done should not interrupt person doing it."
-Chinese Proverb
Loading...