### patch number: 20 ### area: Aaxp server. ### severity: med. ### comments: patch using command "(cd ; patch -p < thisfile)" ### Removes dead code and adds support for line input as well ### as the mic input. *** ./patchlevel.h Wed Mar 3 16:02:55 1993 --- /crl/audio/./patchlevel.h Fri Mar 5 11:30:15 1993 *************** *** 1 **** ! #define PATCHLEVEL 19 --- 1 ---- ! #define PATCHLEVEL 20 *** ./AF/server/dda/axp/Imakefile Tue Mar 9 11:35:16 1993 --- /crl/audio/./AF/server/dda/axp/Imakefile Tue Apr 20 13:16:46 1993 *************** *** 3,17 **** CDEBUGFLAGS= -g SRCS = dda.c event.c max_io.c \ codec_tables.c pscodec.c \ ! crecord.c cplay.c write.c read.c OBJS = dda.o event.o max_io.o \ codec_tables.o pscodec.o \ ! crecord.o cplay.o write.o read.o - INCLUDES = -I../mi -I../../../include -I../../include -I$(INCLUDESRC) \ ! -I/usr/sys/include/netisdn/h -I$(INCROOT) LINTLIBS = ../../dix/llib-ldix.ln ../../os/4.2bsd/llib-los.ln \ ../mi/llib-lmi.ln --- 3,18 ---- CDEBUGFLAGS= -g SRCS = dda.c event.c max_io.c \ codec_tables.c pscodec.c \ ! crecord.c cplay.c write.c read.c \ ! axp_ioctl.c OBJS = dda.o event.o max_io.o \ codec_tables.o pscodec.o \ ! crecord.o cplay.o write.o read.o \ ! axp_ioctl.o INCLUDES = -I../mi -I../../../include -I../../include -I$(INCLUDESRC) \ ! -I$(INCROOT) -I/usr/sys/include LINTLIBS = ../../dix/llib-ldix.ln ../../os/4.2bsd/llib-los.ln \ ../mi/llib-lmi.ln *** ./AF/server/dda/axp/write.c Tue Mar 9 11:35:16 1993 --- /crl/audio/./AF/server/dda/axp/write.c Tue Apr 20 13:16:26 1993 *************** *** 38,44 **** * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char write_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/write.c,v 1.7 1993/03/09 16:12:14 tml Exp $"; #endif /* !lint && !SABER */ --- 38,44 ---- * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char write_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/write.c,v 1.9 1993/04/20 17:15:14 tml Exp $"; #endif /* !lint && !SABER */ *************** *** 52,58 **** #include #include #include ! #include #include #include #endif __alpha --- 52,58 ---- #include #include #include ! #include #include #include #endif __alpha *************** *** 233,239 **** if(1 /* scanit(source, nsamples) */) { result = write(axpfd, source, nsamples); if(result != nsamples) ! printf("short write %d %d\n", result, nsamples); memset(source, SILENCE, nsamples); twritten += nsamples; } --- 233,239 ---- if(1 /* scanit(source, nsamples) */) { result = write(axpfd, source, nsamples); if(result != nsamples) ! ErrorF("short write %d %d\n", result, nsamples); memset(source, SILENCE, nsamples); twritten += nsamples; } *************** *** 252,258 **** if(1 /* scanit(source, nsamples) */) { result = write(sunfd, source, nsamples); if(result != nsamples) ! printf("short write %d %d\n", result, nsamples); memset(source, SILENCE, nsamples); twritten += nsamples; last_stime = start_time; --- 252,258 ---- if(1 /* scanit(source, nsamples) */) { result = write(sunfd, source, nsamples); if(result != nsamples) ! ErrorF("short write %d %d\n", result, nsamples); memset(source, SILENCE, nsamples); twritten += nsamples; last_stime = start_time; *** ./AF/server/dda/axp/cplay.c Sun Feb 7 19:11:33 1993 --- /crl/audio/./AF/server/dda/axp/cplay.c Tue Apr 20 13:16:22 1993 *************** *** 39,45 **** */ #if !defined(lint) && !defined(SABER) ! static char cplay_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/cplay.c,v 1.2 1993/02/08 00:11:33 stewart Exp $"; #endif /* !lint && !SABER */ #include --- 39,45 ---- */ #if !defined(lint) && !defined(SABER) ! static char cplay_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/cplay.c,v 1.3 1993/04/20 17:15:14 tml Exp $"; #endif /* !lint && !SABER */ #include *************** *** 47,53 **** #include #include #include ! #include "bba.h" #include "ringbuffers.h" #include "physdevice.h" #include "max_io.h" --- 47,53 ---- #include #include #include ! #include #include "ringbuffers.h" #include "physdevice.h" #include "max_io.h" *************** *** 55,61 **** #include "pscodec.h" #include "devtime.h" ! #define EPSILON DMASIZE /* This procedure is invoked by a protocol dispatching routine --- 55,61 ---- #include "pscodec.h" #include "devtime.h" ! #define EPSILON BBA_DMASIZE /* This procedure is invoked by a protocol dispatching routine *** ./AF/server/dda/axp/read.c Tue Mar 9 11:35:16 1993 --- /crl/audio/./AF/server/dda/axp/read.c Tue Apr 20 13:16:25 1993 *************** *** 38,44 **** * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char read_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/read.c,v 1.4 1993/03/09 16:12:14 tml Exp $"; #endif /* !lint && !SABER */ /* Revision History --- 38,44 ---- * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char read_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/read.c,v 1.5 1993/04/20 17:15:14 tml Exp $"; #endif /* !lint && !SABER */ /* Revision History *************** *** 51,57 **** #include #include #include ! #include #include #include #include --- 51,57 ---- #include #include #include ! #include #include #include #include *** ./AF/server/dda/axp/devtime.h Sun Feb 7 19:12:37 1993 --- /crl/audio/./AF/server/dda/axp/devtime.h Tue Apr 20 13:16:01 1993 *************** *** 50,56 **** (current)-(time) ) /* Given a codec audio device, read the time register on the hardware. */ ! #define GET_TIME(aDev) bba_get_time( ((maxPhysDevice *)((aDev)->devPtr))->bba) /* Give a audio device, update current time in the audio device. */ #define UPDATE_TIME(aDev) \ --- 50,56 ---- (current)-(time) ) /* Given a codec audio device, read the time register on the hardware. */ ! #define GET_TIME(aDev) bba_get_time() /* Give a audio device, update current time in the audio device. */ #define UPDATE_TIME(aDev) \ *** ./AF/server/dda/axp/event.c Sun Feb 7 19:12:44 1993 --- /crl/audio/./AF/server/dda/axp/event.c Tue Apr 20 13:16:23 1993 *************** *** 39,45 **** */ #if !defined(lint) && !defined(SABER) ! static char event_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/event.c,v 1.2 1993/02/08 00:12:44 stewart Exp $"; #endif /* !lint && !SABER */ #include --- 39,45 ---- */ #if !defined(lint) && !defined(SABER) ! static char event_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/event.c,v 1.3 1993/04/20 17:15:14 tml Exp $"; #endif /* !lint && !SABER */ #include *************** *** 49,55 **** #include #include #include "dda.h" ! #include "bba.h" #include "max_io.h" #include "physdevice.h" #include "event.h" --- 49,55 ---- #include #include #include "dda.h" ! #include #include "max_io.h" #include "physdevice.h" #include "event.h" *************** *** 59,122 **** void ProcessInputEvents() { - int i; - struct interrupt_event event; - aEvent cEvent; - int device; - maxPhysDevice *pDev; - AudioDevicePtr aDev; - ATime etime; - ATime ctime; - - pDev = &physDevices[0]; - aDev = physmap[0].primDev; - - /* Check event queue. */ - if(GetEvent(pDev->bba, &event) == 0) return; - - /* Compute the audio device format timestamp for this event. */ - ctime = (*(aDev->GetTime))(aDev); - - switch(event.type){ - case UNKNOWN: - default: - ErrorF("Unexpected event received in ProcessInputEvents %d\n", - event.type); - break; - } - } - - - /* - * returns an event, principally to hide the details of the queue. - * May craft a server internal event. - */ - int GetEvent(info, event) - struct bba_info *info; - struct interrupt_event *event; - { - struct interrupt_event *e; - int i; - if (info->head == info->tail) return 0; - i = info->head; - e = (struct interrupt_event *)((int)(info->us_start) - + info->event_size * i); - *event = *e; - if (i >= info->event_list_size - 1) i = info->head = 0; - else i = ++info->head; - return 1; } - /* - * flushes event queue - */ - int FlushEvent(info) - struct bba_info *info; - { - struct interrupt_event e; - int i=0; - while(GetEvent(info, &e) != 0) - ++i; - return i; - } --- 59,64 ---- *** ./AF/server/dda/axp/event.h Sun Feb 7 19:12:52 1993 --- /crl/audio/./AF/server/dda/axp/event.h Tue Apr 20 13:16:02 1993 *************** *** 42,51 **** #ifndef EVENT_H #define EVENT_H - /* - #include "bba.h" - */ - extern void lofiInputInit(); int GetEvent(); int FlushEvent(); --- 42,47 ---- *** ./AF/server/dda/axp/max_io.c Tue Mar 9 11:35:16 1993 --- /crl/audio/./AF/server/dda/axp/max_io.c Tue Apr 20 13:16:23 1993 *************** *** 38,44 **** * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char lofiio_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/max_io.c,v 1.4 1993/03/09 16:12:14 tml Exp $"; #endif /* !lint && !SABER */ /* Revision History --- 38,44 ---- * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char lofiio_c_rcsid[]="$Header: /crl/audio/AF/server/dda/axp/RCS/max_io.c,v 1.5 1993/04/20 17:15:14 tml Exp $"; #endif /* !lint && !SABER */ /* Revision History *************** *** 62,68 **** #include #include #ifdef __alpha ! #include #endif __alpha #ifdef SUN #include --- 62,68 ---- #include #include #ifdef __alpha ! #include #endif __alpha #ifdef SUN #include *************** *** 70,76 **** #endif SUN #include "physdevice.h" ! #include "bba.h" #include "ringbuffers.h" #include "max_io.h" #include "codec.h" --- 70,76 ---- #endif SUN #include "physdevice.h" ! #include #include "ringbuffers.h" #include "max_io.h" #include "codec.h" *************** *** 88,94 **** * puts control bits in known state, and finally * loads (not enables) the dsp uKernel. */ ! struct bba_info my_bba_info; #ifdef SUN #include #include --- 88,94 ---- * puts control bits in known state, and finally * loads (not enables) the dsp uKernel. */ ! #ifdef SUN #include #include *************** *** 124,136 **** pDev->state = STATE_INIT; #ifndef SUN - #ifdef mips - if (ioctl(pDev->fd, QIOBBAINFO, &pDev->bba) < 0) { - ErrorF("dda QIOBBAINFO failed, errno message %d\n", - errno); - exit(1); - } - #endif mips #ifdef __alpha if ((pDev->fd = open(devName, O_RDWR | O_NDELAY, 0)) < 0) { ErrorF("dda can't open %s, errno message \" %d \"\n", devName, --- 124,129 ---- *************** *** 137,144 **** errno); exit(1); } - bzero(&my_bba_info, sizeof(struct bba_info)); - pDev->bba = &my_bba_info; axpfd = pDev->fd; data [0] = 1; /* Enable */ if (axpIoctl (pDev->fd, ISDNIOC_MIC_ENABLE, data, sizeof (int)) < 0) { --- 130,135 ---- *************** *** 163,170 **** errno); exit(1); } - bzero(&my_bba_info, sizeof(struct bba_info)); - pDev->bba = &my_bba_info; sunfd = pDev->fd; if ((sunfd1 = open(devName, O_RDONLY | O_NDELAY, 0)) < 0) { ErrorF("dda can't open %s, errno message \" %d \"\n", devName, --- 154,159 ---- *************** *** 187,203 **** ErrorF("dda can't close device. errno message \" %d \"\n", errno); pDev->state = STATE_CLOSED; - } - - #include - void msleep(info, msecs) - struct bba_info *info; - int msecs; - { - struct timeval timeout; - - timeout.tv_sec = msecs / 1000; - timeout.tv_usec = msecs * 1000; - select(0, NULL, NULL, NULL, &timeout); } --- 176,180 ---- *** ./AF/server/dda/axp/max_io.h Sun Feb 7 19:13:10 1993 --- /crl/audio/./AF/server/dda/axp/max_io.h Tue Apr 20 13:16:03 1993 *************** *** 42,51 **** #ifndef MAXIO_H #define MAXIO_H ! #include "bba.h" #include "physdevice.h" - void msleep(); void initMAX(); void closeMAX(); #endif /* MAXIO_H */ --- 42,50 ---- #ifndef MAXIO_H #define MAXIO_H ! #include #include "physdevice.h" void initMAX(); void closeMAX(); #endif /* MAXIO_H */ *** ./AF/server/dda/axp/pscodec.c Mon Mar 15 16:40:42 1993 --- /crl/audio/./AF/server/dda/axp/pscodec.c Tue Apr 20 13:16:24 1993 *************** *** 38,44 **** * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char pscodec_c_rcsid[] = "$Header: /crl/audio/AF/server/dda/axp/RCS/pscodec.c,v 1.10 1993/03/09 16:31:12 tml Exp tml $"; #endif /* !lint && !SABER */ /* Revision History --- 38,44 ---- * SOFTWARE. */ #if !defined(lint) && !defined(SABER) ! static char pscodec_c_rcsid[] = "$Header: /crl/audio/AF/server/dda/axp/RCS/pscodec.c,v 1.11 1993/04/20 17:15:14 tml Exp $"; #endif /* !lint && !SABER */ /* Revision History *************** *** 71,77 **** #include