From 84f77b215d6fb532dbfa2bbf76049df808c3bd6c Mon Sep 17 00:00:00 2001 From: Florian Schmidt Date: Fri, 13 Aug 2004 12:26:52 +0000 Subject: [PATCH] Signed-off-by: Florian Schmidt The below patch [also attached] fixes the check for device files in /dev/sound/ [for users of devfs who have configured their apps to use /dev/sound/dsp, etc..] and adds a note to the aoss manpage about the state of mmap support. --- alsa/aoss.1 | 2 ++ alsa/mixer.c | 4 ++++ alsa/pcm.c | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/alsa/aoss.1 b/alsa/aoss.1 index 64ec383..febb789 100644 --- a/alsa/aoss.1 +++ b/alsa/aoss.1 @@ -30,6 +30,8 @@ pcm.dsp0 { In the above configuration examples, the pcm.dsp0 definition is used to wrap calls do /dev/dsp0. You can also wrap usage of /dev/dsp1, /dev/dsp2, etc. by defining pcm.dsp1, pcm.dsp2, etc.. +Note on mmap: aoss mmap support might be buggy. Your results may vary when trying to use an application that uses mmap'ing to access the OSS device files. + .SS Arguments .TP diff --git a/alsa/mixer.c b/alsa/mixer.c index f018362..44198cc 100644 --- a/alsa/mixer.c +++ b/alsa/mixer.c @@ -548,6 +548,10 @@ int lib_oss_mixer_open(const char *file, int oflag, ...) minor = (atoi(file + 10) << 4) | OSS_DEVICE_MIXER; else if (!strncmp(file, "/dev/amixer", 11)) minor = (atoi(file + 11) << 4) | OSS_DEVICE_AMIXER; + else if (!strncmp(file, "/dev/sound/mixer", 16)) + minor = (atoi(file + 16) << 4) | OSS_DEVICE_MIXER; + else if (!strncmp(file, "/dev/sound/amixer", 17)) + minor = (atoi(file + 17) << 4) | OSS_DEVICE_AMIXER; else { errno = ENOENT; return -1; diff --git a/alsa/pcm.c b/alsa/pcm.c index a3b50a0..f01fa34 100644 --- a/alsa/pcm.c +++ b/alsa/pcm.c @@ -1651,6 +1651,14 @@ int lib_oss_pcm_open(const char *file, int oflag, ...) minor = (atoi(file + 9) << 4) | OSS_DEVICE_ADSP; else if (!strncmp(file, "/dev/audio", 10)) minor = (atoi(file + 10) << 4) | OSS_DEVICE_AUDIO; + else if (!strncmp(file, "/dev/sound/dsp", 14)) + minor = (atoi(file + 14) << 4) | OSS_DEVICE_DSP; + else if (!strncmp(file, "/dev/sound/dspW", 15)) + minor = (atoi(file + 15) << 4) | OSS_DEVICE_DSPW; + else if (!strncmp(file, "/dev/sound/adsp", 15)) + minor = (atoi(file + 15) << 4) | OSS_DEVICE_ADSP; + else if (!strncmp(file, "/dev/sound/audio", 16)) + minor = (atoi(file + 16) << 4) | OSS_DEVICE_AUDIO; else { errno = ENOENT; return -1; -- 2.47.1