This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
fhandler_dsp.cc (fhandler_dev_dsp::ioctl): add SNDCTL_DSP_GETFMTSsupport
- From: David Huang <hzhr at 21cn dot com>
- To: cygwin-patches at cygwin dot com
- Date: Tue, 14 Jan 2003 09:52:09 +0800
- Subject: fhandler_dsp.cc (fhandler_dev_dsp::ioctl): add SNDCTL_DSP_GETFMTSsupport
Make code like this work:
/* Get a list of supported hardware formats */
if ( ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0 ) {
SDL_SetError("Couldn't get audio format list");
return(-1);
}
(from SDL-1.2.5/src/audio/dsp/SDL_dspaudio.c, yes, seems like *Native* cygwin libSDL works)
I don't know exactly which hardware formats can the /dev/dsp audio device support,
but looks like it supports AFMT_S16_LE, AFMT_U8 and AFMT_S8.
Thanks.
2003-01-14 David Huang <davehzhr@hotmail.com>
* fhandler_dsp.cc (fhandler_dsp::ioctl): Add SNDCTL_DSP_GETFMTS
limited support.
Index: fhandler_dsp.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_dsp.cc,v
retrieving revision 1.23
diff -u -p -r1.23 fhandler_dsp.cc
--- fhandler_dsp.cc 14 Dec 2002 04:01:32 -0000 1.23
+++ fhandler_dsp.cc 14 Jan 2003 01:30:01 -0000
@@ -623,6 +623,14 @@ fhandler_dev_dsp::ioctl (unsigned int cm
}
break;
+ CASE (SNDCTL_DSP_GETFMTS)
+ {
+ *intptr = AFMT_S16_LE | AFMT_U8 | AFMT_S8; // more?
+
+ return 0;
+ }
+ break;
+
default:
debug_printf ("/dev/dsp: ioctl not handled yet! FIXME:");
break;