Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 1999 08:21:19 +0200
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        freebsd-multimedia@freebsd.org
Subject:   Reason why fxtv can't capture audio with Luigi's sound code...
Message-ID:  <19990412082119.A91030@internal>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990412082119.A91030>