From owner-freebsd-multimedia Sun Apr 11 23:23:48 1999 Delivered-To: freebsd-multimedia@freebsd.org Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by hub.freebsd.org (Postfix) with ESMTP id DC3BA15261 for ; Sun, 11 Apr 1999 23:23:39 -0700 (PDT) (envelope-from andre.albsmeier@mchp.siemens.de) X-Envelope-Sender-Is: andre.albsmeier@mchp.siemens.de (at relayer david.siemens.de) Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.9.3/8.9.3) with ESMTP id IAA29520 for ; Mon, 12 Apr 1999 08:21:52 +0200 (MET DST) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [146.180.31.23]) by mail1.siemens.de (8.9.3/8.9.3) with ESMTP id IAA27853 for ; Mon, 12 Apr 1999 08:20:59 +0200 (MET DST) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.9.3/8.9.3) id IAA20646 for ; Mon, 12 Apr 1999 08:21:21 +0200 (CEST) Date: Mon, 12 Apr 1999 08:21:19 +0200 From: Andre Albsmeier To: freebsd-multimedia@freebsd.org Subject: Reason why fxtv can't capture audio with Luigi's sound code... Message-ID: <19990412082119.A91030@internal> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I am using fxtv-0.48 together with an AWE32 soundcard and Luigi's snd code (pcm1). When trying to capture audio data, this fails with the msg: Selected sample format not supported (on this soundcard). I assumed this was wrong and applied the following patch to tvaudio.c so the case that parm != parm_new is simply ignored: --- tvaudio.c.orig Sat May 30 17:47:07 1998 +++ tvaudio.c Mon Apr 12 08:02:42 1999 @@ -293,12 +293,14 @@ error = True; goto RETURN; } +#if 0 if ( parm != parm_new ) { sprintf( S_error_msg, "Selected sample format not supported (on " "this soundcard)." ); error = True; goto RETURN; } +#endif parm_new = parm = snd->stereo ? 2 : 1; if ( ioctl( *dsp_fd, SOUND_PCM_WRITE_CHANNELS, &parm_new ) < 0 ) { Now audio capturing worked without any problems. If I understand the code fragment above correctly, it tries to verify that the recording settings selected by the user have been accepted by the kernel/soundcard. This is done by assuming that the call ioctl( *dsp_fd, SNDCTL_DSP_SETFMT, &parm_new ) returns the new settings in parm_new. Either this assumption is wrong (then the above code should simply be removed from fxtv) or the returned value is not correct. If the latter is correct, the error might be in the following part of /sys/i386/isa/snd/sound.c: case SNDCTL_DSP_SETFMT: /* sets _one_ format */ /* * when some card (SB16) is opened RDONLY or WRONLY, * only one of the fields is set, the other becomes 0. * This makes it possible to select DMA channels at runtime. */ if (d->play_fmt) d->play_fmt = *(int *)arg ; if (d->rec_fmt) d->rec_fmt = *(int *)arg ; splx(s); if (ask_init(d)) *(int *)arg = d->play_fmt ; break ; Shouldn't this honor d->rec_fmt also in the case for returning the value? E.g.: if (ask_init(d)) { if (d->play_fmt) *(int *)arg = d->play_fmt ; if (d->rec_fmt) *(int *)arg = d->rec_fmt ; } -Andre To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message