Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* OSS support in Linux specifically for ID Software games.
@ 2005-11-19 14:52 James Courtier-Dutton
  0 siblings, 0 replies; only message in thread
From: James Courtier-Dutton @ 2005-11-19 14:52 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

Hi,

I have done an strace on enemy-territory in an effort to try and see 
what it is doing, and think of a way for Linux to work better with it.

As you can see from my extracts from the strace, ET is basically opening 
the sound device, doing a mmap, and then polling the hw_ptr of the 
buffer. It is not using a callback method or a specific snd_pcm_write 
method.

So, if we could write a module that simply diverted all IOCTL calls to 
/dev/dsp to a user land deamon, we might be able to achieve a good 
working model.

The user daemon would contain the mmaped memory, and ET would write to it.
The user daemon would have a resampler in it, and use standard alsa 
callback methods. Each time the callback happens, the user daemon would 
consume samples from the mmapped memory, resample them suitably for the 
output and use the normal alsa api to write them.

So, I am suggesting that for all OSS emulation, we use this user land 
double buffer. That will result in all OSS applications working, and not 
just a select few.

This double buffer is specifically needed so that the buffer the 
application sees can be bigger than the one the hardware has.

Any comments?

James

[-- Attachment #2: sound.txt --]
[-- Type: text/plain, Size: 1263 bytes --]

open("/dev/dsp", O_RDWR)                = 27
getuid32()                              = 1000
setresuid32(-1, 1000, -1)               = 0
ioctl(27, SNDCTL_DSP_GETCAPS, 0xbffd2bbc) = 0
ioctl(27, SNDCTL_DSP_STEREO, 0xbffd2bb4) = 0
ioctl(27, SNDCTL_DSP_SPEED or SOUND_PCM_READ_RATE, 0x925c2f4) = 0
ioctl(27, SNDCTL_DSP_SETFMT or SOUND_PCM_READ_BITS, 0xbffd2bb0) = 0
ioctl(27, SNDCTL_DSP_GETOSPACE, 0xbffd2bc0) = 0
mmap2(NULL, 65536, PROT_WRITE, MAP_SHARED, 27, 0) = 0xaf9c1000
ioctl(27, SNDCTL_DSP_GETTRIGGER, 0xbffd2bb4) = 0
ioctl(27, SNDCTL_DSP_GETTRIGGER, 0xbffd2bb4) = 0
...
gettimeofday({1132410255, 66560}, NULL) = 0
gettimeofday({1132410255, 66618}, NULL) = 0
ioctl(27, SNDCTL_DSP_GETOPTR, 0xbffc2690) = 0
gettimeofday({1132410255, 67928}, NULL) = 0
gettimeofday({1132410255, 67985}, NULL) = 0 
gettimeofday({1132410255, 68039}, NULL) = 0
...
gettimeofday({1132410255, 113937}, NULL) = 0
gettimeofday({1132410255, 113994}, NULL) = 0
ioctl(27, SNDCTL_DSP_GETOPTR, 0xbffd2bb0) = 0
...
gettimeofday({1132410255, 118952}, NULL) = 0
gettimeofday({1132410255, 119008}, NULL) = 0
ioctl(27, SNDCTL_DSP_GETOPTR, 0xbffd2bb0) = 0
...
gettimeofday({1132410255, 129800}, NULL) = 0
gettimeofday({1132410255, 129856}, NULL) = 0
ioctl(27, SNDCTL_DSP_GETOPTR, 0xbffd2bb0) = 0



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-19 14:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-19 14:52 OSS support in Linux specifically for ID Software games James Courtier-Dutton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox