Re: remove dsp bits from libossaudio

2015-04-18 Thread Philip Guenther
On Fri, Apr 17, 2015 at 3:34 AM, Alexandre Ratchov a...@caoua.org wrote:
 No code uses the SNDCLT_DSP_* ioctls anymore (the last port using
 them was removed few months ago), so they could be removed now. As
 there's no ABI change, no shlib_version crank is necessary.

 The motivation of removing these ioctls is to ease
 simplifications and development of the audio(4) driver.

 OK?

Perhaps delete the #defines in soundcard.h too?

Arguably, this should go with a bump to the major version as calls
that worked before no longer work, but since no public symbols were
removed and nothing apparently uses the removed values I think it's
fine.

ok guenther@



Re: remove dsp bits from libossaudio

2015-04-18 Thread Jonathan Armani
On Fri, Apr 17, 2015 at 12:34:00PM +0200, Alexandre Ratchov wrote:
 No code uses the SNDCLT_DSP_* ioctls anymore (the last port using
 them was removed few months ago), so they could be removed now. As
 there's no ABI change, no shlib_version crank is necessary.
 
 The motivation of removing these ioctls is to ease
 simplifications and development of the audio(4) driver.
 
 OK?
 

ok armani@



remove dsp bits from libossaudio

2015-04-17 Thread Alexandre Ratchov
No code uses the SNDCLT_DSP_* ioctls anymore (the last port using
them was removed few months ago), so they could be removed now. As
there's no ABI change, no shlib_version crank is necessary.

The motivation of removing these ioctls is to ease
simplifications and development of the audio(4) driver.

OK?

Index: ossaudio.c
===
RCS file: /cvs/src/lib/libossaudio/ossaudio.c,v
retrieving revision 1.17
diff -u -p -u -p -r1.17 ossaudio.c
--- ossaudio.c  27 Mar 2013 20:28:22 -  1.17
+++ ossaudio.c  17 Apr 2015 10:20:35 -
@@ -54,9 +54,6 @@
 
 static struct audiodevinfo *getdevinfo(int);
 
-static void setblocksize(int, struct audio_info *);
-
-static int audio_ioctl(int, unsigned long, void *);
 static int mixer_ioctl(int, unsigned long, void *);
 static int opaque_to_enum(struct audiodevinfo *di, audio_mixer_name_t *label, 
int opq);
 static int enum_to_ord(struct audiodevinfo *di, int enm);
@@ -74,388 +71,13 @@ _oss_ioctl(int fd, unsigned long com, ..
argp = va_arg(ap, void *);
va_end(ap);
if (IOCGROUP(com) == 'P')
-   return audio_ioctl(fd, com, argp);
+   return ENOTTY;
else if (IOCGROUP(com) == 'M')
return mixer_ioctl(fd, com, argp);
else
return ioctl(fd, com, argp);
 }
 
-static int
-audio_ioctl(int fd, unsigned long com, void *argp)
-{
-
-   struct audio_info tmpinfo;
-   struct audio_offset tmpoffs;
-   struct audio_buf_info bufinfo;
-   struct count_info cntinfo;
-   struct audio_encoding tmpenc;
-   struct audio_bufinfo tmpab;
-   u_long ldat;
-   u_int u;
-   int idat, idata;
-   int tempret, retval = 0, rerr = 0;
-
-   switch (com) {
-   case SNDCTL_DSP_RESET:
-   retval = ioctl(fd, AUDIO_FLUSH, 0);
-   rerr = errno;
-   break;
-   case SNDCTL_DSP_SYNC:
-   retval = ioctl(fd, AUDIO_DRAIN, 0);
-   rerr = errno;
-   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 =
-   tmpinfo.record.sample_rate = INTARG;
-   retval = ioctl(fd, AUDIO_SETINFO, tmpinfo);
-   rerr = errno;
-   /* FALLTHRU */
-   case SOUND_PCM_READ_RATE:
-   tempret = ioctl(fd, AUDIO_GETINFO, tmpinfo);
-   if (retval = 0) {
-   retval = tempret;
-   rerr = errno;
-   }
-   INTARG = tmpinfo.play.sample_rate;
-   break;
-   case SNDCTL_DSP_STEREO:
-   AUDIO_INITINFO(tmpinfo);
-   tmpinfo.play.channels =
-   tmpinfo.record.channels = INTARG ? 2 : 1;
-   retval = ioctl(fd, AUDIO_SETINFO, tmpinfo);
-   rerr = errno;
-   tempret = ioctl(fd, AUDIO_GETINFO, tmpinfo);
-   if (retval = 0) {
-   retval = tempret;
-   rerr = errno;
-   }
-   INTARG = tmpinfo.play.channels - 1;
-   break;
-   case SNDCTL_DSP_GETBLKSIZE:
-   retval = ioctl(fd, AUDIO_GETINFO, tmpinfo);
-   rerr = errno;
-   setblocksize(fd, tmpinfo);
-   INTARG = tmpinfo.blocksize;
-   break;
-   case SNDCTL_DSP_SETFMT:
-   AUDIO_INITINFO(tmpinfo);
-   switch (INTARG) {
-   case AFMT_MU_LAW:
-   tmpinfo.play.precision =
-   tmpinfo.record.precision = 8;
-   tmpinfo.play.encoding =
-   tmpinfo.record.encoding = AUDIO_ENCODING_ULAW;
-   break;
-   case AFMT_A_LAW:
-   tmpinfo.play.precision =
-   tmpinfo.record.precision = 8;
-   tmpinfo.play.encoding =
-   tmpinfo.record.encoding = AUDIO_ENCODING_ALAW;
-   break;
-   case AFMT_U8:
-   tmpinfo.play.precision =
-   tmpinfo.record.precision = 8;
-   tmpinfo.play.encoding =
-   tmpinfo.record.encoding = AUDIO_ENCODING_ULINEAR;
-   break;
-   case AFMT_S8:
-   tmpinfo.play.precision =
-   tmpinfo.record.precision = 8;
-   tmpinfo.play.encoding =
-   tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR;
-   break;
-   case AFMT_S16_LE:
-   tmpinfo.play.precision =
-   tmpinfo.record.precision = 16;
-   tmpinfo.play.encoding =
-