From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: alsa-devel@lists.sourceforge.net
Subject: OSS support in Linux specifically for ID Software games.
Date: Sat, 19 Nov 2005 14:52:20 +0000 [thread overview]
Message-ID: <437F3C24.5040402@superbug.demon.co.uk> (raw)
[-- 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
reply other threads:[~2005-11-19 14:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=437F3C24.5040402@superbug.demon.co.uk \
--to=james@superbug.demon.co.uk \
--cc=alsa-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox