Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15995
Modified Files: Tag: desiredata s_audio_oss.c Log Message: removed fprintf
Index: s_audio_oss.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_oss.c,v retrieving revision 1.6.4.2.2.2.2.7 retrieving revision 1.6.4.2.2.2.2.8 diff -C2 -d -r1.6.4.2.2.2.2.7 -r1.6.4.2.2.2.2.8 *** s_audio_oss.c 10 Jul 2007 07:04:55 -0000 1.6.4.2.2.2.2.7 --- s_audio_oss.c 30 Jul 2007 22:55:24 -0000 1.6.4.2.2.2.2.8 *************** *** 132,145 ****
if (sys_verbose) post("bytes per sample = %d", dev->bytespersamp); ! if (ioctl(fd, SNDCTL_DSP_SETFMT, ¶m) == -1) ! fprintf(stderr,"OSS: Could not set DSP format\n"); ! else if (wantformat != param) ! fprintf(stderr,"OSS: DSP format: wanted %d, got %d\n", wantformat, param); /* sample rate */ orig = param = srate; ! if (ioctl(fd, SNDCTL_DSP_SPEED, ¶m) == -1) ! fprintf(stderr,"OSS: Could not set sampling rate for device\n"); ! else if( orig != param ) ! fprintf(stderr,"OSS: sampling rate: wanted %d, got %d\n", orig, param );
if (oss_blockmode && !skipblocksize) { --- 132,141 ----
if (sys_verbose) post("bytes per sample = %d", dev->bytespersamp); ! if (ioctl(fd, SNDCTL_DSP_SETFMT, ¶m) == -1) error("OSS: Could not set DSP format"); ! else if (wantformat != param) error("OSS: DSP format: wanted %d, got %d", wantformat, param); /* sample rate */ orig = param = srate; ! if (ioctl(fd, SNDCTL_DSP_SPEED, ¶m) == -1) error("OSS: Could not set sampling rate for device"); ! else if (orig != param) error("OSS: sampling rate: wanted %d, got %d", orig, param );
if (oss_blockmode && !skipblocksize) { *************** *** 180,184 **** out. */ int defect; ! if (ioctl(fd, SOUND_PCM_GETOSPACE,&ainfo) < 0) fprintf(stderr,"OSS: ioctl on output device failed"); dev->bufsize = ainfo.bytes; defect = sys_advance_samples * (dev->bytespersamp * nchannels) --- 176,180 ---- out. */ int defect; ! if (ioctl(fd, SOUND_PCM_GETOSPACE,&ainfo) < 0) error("OSS: ioctl on output device failed"); dev->bufsize = ainfo.bytes; defect = sys_advance_samples * (dev->bytespersamp * nchannels) *************** *** 186,190 **** if (defect > 0) { if (sys_verbose || defect > (dev->bufsize >> 2)) ! fprintf(stderr, "OSS: requested audio buffer size %d limited to %d\n", sys_advance_samples * (dev->bytespersamp * nchannels), dev->bufsize); sys_advance_samples = (dev->bufsize-OSS_XFERSAMPS(nchannels)) / (dev->bytespersamp*nchannels); --- 182,186 ---- if (defect > 0) { if (sys_verbose || defect > (dev->bufsize >> 2)) ! error("OSS: requested audio buffer size %d limited to %d", sys_advance_samples * (dev->bytespersamp * nchannels), dev->bufsize); sys_advance_samples = (dev->bufsize-OSS_XFERSAMPS(nchannels)) / (dev->bytespersamp*nchannels); *************** *** 326,332 **** will not block. But I wonder why we only have to read from one of the devices and not all of them??? */ if (linux_nindevs) { ! if (sys_verbose) fprintf(stderr,("OSS: issuing first ADC 'read' ... ")); read(linux_adcs[0].fd, buf, linux_adcs[0].bytespersamp * linux_adcs[0].nchannels * sys_dacblocksize); ! if (sys_verbose) fprintf(stderr, "...done.\n"); } /* now go and fill all the output buffers. */ --- 322,328 ---- will not block. But I wonder why we only have to read from one of the devices and not all of them??? */ if (linux_nindevs) { ! if (sys_verbose) post("OSS: issuing first ADC 'read'..."); read(linux_adcs[0].fd, buf, linux_adcs[0].bytespersamp * linux_adcs[0].nchannels * sys_dacblocksize); ! if (sys_verbose) post("...done."); } /* now go and fill all the output buffers. */ *************** *** 357,366 **** for (int dev=0; dev<linux_noutdevs; dev++) { if (ioctl(linux_dacs[dev].fd, SOUND_PCM_GETOSPACE,&ainfo) < 0) ! fprintf(stderr,"OSS: ioctl on output device %d failed",dev); linux_dacs[dev].space = ainfo.bytes; } for (int dev=0; dev<linux_nindevs; dev++) { if (ioctl(linux_adcs[dev].fd, SOUND_PCM_GETISPACE,&ainfo) < 0) ! fprintf(stderr, "OSS: ioctl on input device %d, fd %d failed", dev, linux_adcs[dev].fd); linux_adcs[dev].space = ainfo.bytes; } --- 353,362 ---- for (int dev=0; dev<linux_noutdevs; dev++) { if (ioctl(linux_dacs[dev].fd, SOUND_PCM_GETOSPACE,&ainfo) < 0) ! error("OSS: ioctl on output device %d failed",dev); linux_dacs[dev].space = ainfo.bytes; } for (int dev=0; dev<linux_nindevs; dev++) { if (ioctl(linux_adcs[dev].fd, SOUND_PCM_GETISPACE,&ainfo) < 0) ! error("OSS: ioctl on input device %d, fd %d failed", dev, linux_adcs[dev].fd); linux_adcs[dev].space = ainfo.bytes; } *************** *** 370,375 **** if (!oss_blockmode) { oss_calcspace(); ! for (int dev=0; dev < linux_noutdevs; dev++) fprintf(stderr, "dac %d space %d\n", dev, linux_dacs[dev].space); ! for (int dev=0; dev < linux_nindevs; dev++) fprintf(stderr, "adc %d space %d\n", dev, linux_adcs[dev].space); } } --- 366,371 ---- if (!oss_blockmode) { oss_calcspace(); ! for (int dev=0; dev < linux_noutdevs; dev++) post("dac %d space %d", dev, linux_dacs[dev].space); ! for (int dev=0; dev < linux_nindevs; dev++) post("adc %d space %d", dev, linux_adcs[dev].space); } } *************** *** 389,396 **** } else while (d.space > OSS_XFERSIZE(d.nchannels, d.bytespersamp)) { linux_adcs_read(d.fd, buf, OSS_XFERSIZE(d.nchannels, d.bytespersamp)); ! if (ioctl(d.fd, SOUND_PCM_GETISPACE, &ainfo) < 0) { ! fprintf(stderr, "OSS: ioctl on input device %d, fd %d failed", dev, d.fd); ! break; ! } d.space = ainfo.bytes; } --- 385,389 ---- } else while (d.space > OSS_XFERSIZE(d.nchannels, d.bytespersamp)) { linux_adcs_read(d.fd, buf, OSS_XFERSIZE(d.nchannels, d.bytespersamp)); ! if (ioctl(d.fd, SOUND_PCM_GETISPACE, &ainfo) < 0) { error("OSS: ioctl on input device %d, fd %d failed",dev,d.fd); break;} d.space = ainfo.bytes; } *************** *** 405,412 **** } linux_dacs_write(d.fd, buf, OSS_XFERSIZE(d.nchannels, d.bytespersamp)); ! if (ioctl(d.fd, SOUND_PCM_GETOSPACE, &ainfo) < 0) { ! fprintf(stderr, "OSS: ioctl on output device %d, fd %d failed", dev, d.fd); ! break; ! } d.space = ainfo.bytes; } --- 398,402 ---- } linux_dacs_write(d.fd, buf, OSS_XFERSIZE(d.nchannels, d.bytespersamp)); ! if (ioctl(d.fd, SOUND_PCM_GETOSPACE, &ainfo) < 0) {error("OSS: ioctl on output device %d, fd %d failed",dev,d.fd); break;} d.space = ainfo.bytes; }