On Thu, 31 Jul 2003, Zinx Verituse wrote:

> Appologies if this has been answered before, but I have a dsp
> with no capture device (it's the primary(secondary?) on a
> ens1370), and haven't been able to get quake3 based engines to
> open it..
> 
> echo "quake3.x86 0 0 disable" > /proc/asound/card0/pcm1c/oss
> 
> The above can't work, because no capture device exists, and
> it seems to try opening with capture enabled if the capture
> device doesn't exist:  It returns 'No such device' on the open
> of /dev/adsp, though sox will play to /dev/adsp fine.
> 
> I also tried disabling the capture device that does exist
> (via /proc/asound/card0/pcm0c/oss) for the game -- It produced
> no noticable results (i.e., still returns 'No such device')
> 
> I attempted hacking the binary to open /dev/adsp as O_WRONLY,
> but as you can imagine this resulted in the mmap failing..
> 
> So.. Is there any way to make alsa's OSS emulation realize the
> application isn't going to use the capture when there is _no_
> capture device?

The patch bellow will fix your problem.

                                        Jaroslav

Index: pcm_oss.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/oss/pcm_oss.c,v
retrieving revision 1.45
diff -u -r1.45 pcm_oss.c
--- pcm_oss.c   24 Jul 2003 21:02:45 -0000      1.45
+++ pcm_oss.c   31 Jul 2003 12:44:49 -0000
@@ -1614,8 +1614,12 @@
        if ((f_mode & FMODE_READ) && !(csetup && csetup->disable)) {
                if ((err = snd_pcm_open_substream(pcm, SNDRV_PCM_STREAM_CAPTURE, 
                                               &csubstream)) < 0) {
-                       snd_pcm_oss_release_file(pcm_oss_file);
-                       return err;
+                       if (!(f_mode & FMODE_WRITE) || err != -ENODEV) {
+                               snd_pcm_oss_release_file(pcm_oss_file);
+                               return err;
+                       } else {
+                               csubstream = NULL;
+                       }
                }
                pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE] = csubstream;
        }

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to