From 0aaa720d431428773584a5b985e6815b2a2ce712 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sat, 3 May 2003 19:01:49 +0000 Subject: - make it -Wall clean - add SNDCTL_DSP_SETDUPLEX emulation (netbsd) - SNDCTL_DSP_POST is a noop to prevent some apps blocking (netbsd) - some man pages fixes (from me and netbsd) - add some more missing #defines for SOUND_MIXER_* (netbsd) --- lib/libossaudio/ossaudio.3 | 10 +++++----- lib/libossaudio/ossaudio.c | 15 +++++++++++---- lib/libossaudio/soundcard.h | 10 +++++++++- 3 files changed, 25 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/libossaudio/ossaudio.3 b/lib/libossaudio/ossaudio.3 index a0326ba903b..97ae880b97c 100644 --- a/lib/libossaudio/ossaudio.3 +++ b/lib/libossaudio/ossaudio.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ossaudio.3,v 1.6 2002/05/01 08:03:30 mpech Exp $ +.\" $OpenBSD: ossaudio.3,v 1.7 2003/05/03 19:01:47 avsm Exp $ .\" $NetBSD: ossaudio.3,v 1.12 2001/05/19 17:23:39 jdolecek Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -56,20 +56,20 @@ library only for porting programs. .Sh SEE ALSO .Xr audio 4 .Sh BUGS -The emulation uses an #define for -.Va ioctl() +The emulation uses a #define for +.Fn ioctl so some obscure programs can fail to compile. .Pp The emulation is incomplete. .Pp The emulation only covers -.Va ioctl() , +.Fn ioctl , there are other differences as well. E.g., on a write that would block in non-blocking mode Linux returns .Dv EINTR whereas -.Ox 2.3 +.Ox returns .Dv EAGAIN . .Sh HISTORY diff --git a/lib/libossaudio/ossaudio.c b/lib/libossaudio/ossaudio.c index 76877f02ec3..34e8f861f1b 100644 --- a/lib/libossaudio/ossaudio.c +++ b/lib/libossaudio/ossaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ossaudio.c,v 1.5 2002/04/24 21:59:53 espie Exp $ */ +/* $OpenBSD: ossaudio.c,v 1.6 2003/05/03 19:01:48 avsm Exp $ */ /* $NetBSD: ossaudio.c,v 1.14 2001/05/10 01:53:48 augustss Exp $ */ /*- @@ -108,11 +108,13 @@ audio_ioctl(int fd, unsigned long com, void *argp) return retval; break; case SNDCTL_DSP_SYNC: - case SNDCTL_DSP_POST: retval = ioctl(fd, AUDIO_DRAIN, 0); if (retval < 0) return retval; break; + case SNDCTL_DSP_POST: + /* This call is merely advisory, and may be a nop. */ + break; case SNDCTL_DSP_SPEED: AUDIO_INITINFO(&tmpinfo); tmpinfo.play.sample_rate = @@ -429,10 +431,15 @@ audio_ioctl(int fd, unsigned long com, void *argp) cntinfo.ptr = tmpoffs.offset; *(struct count_info *)argp = cntinfo; break; + case SNDCTL_DSP_SETDUPLEX: + idat = 1; + retval = ioctl(fd, AUDIO_SETFD, &idat); + if (retval < 0) + return retval; + break; case SNDCTL_DSP_MAPINBUF: case SNDCTL_DSP_MAPOUTBUF: case SNDCTL_DSP_SETSYNCRO: - case SNDCTL_DSP_SETDUPLEX: case SNDCTL_DSP_PROFILE: errno = EINVAL; return -1; /* XXX unimplemented */ @@ -627,7 +634,7 @@ mixer_ioctl(int fd, unsigned long com, void *argp) struct mixer_info *omi; struct audio_device adev; mixer_ctrl_t mc; - int idat; + int idat = 0; int i; int retval; int l, r, n, error, e; diff --git a/lib/libossaudio/soundcard.h b/lib/libossaudio/soundcard.h index 20fbccc4408..abfd228d999 100644 --- a/lib/libossaudio/soundcard.h +++ b/lib/libossaudio/soundcard.h @@ -1,4 +1,4 @@ -/* $OpenBSD: soundcard.h,v 1.9 2002/04/24 21:59:53 espie Exp $ */ +/* $OpenBSD: soundcard.h,v 1.10 2003/05/03 19:01:48 avsm Exp $ */ /* $NetBSD: soundcard.h,v 1.11 2001/05/09 21:49:58 augustss Exp $ */ /*- @@ -268,6 +268,14 @@ #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) +#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) +#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) +#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) +#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN) +#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT) +#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) +#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) +#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR) typedef struct mixer_info { char id[16]; -- cgit v1.2.3