Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 1999 21:04:37 +0200 (MET)
From:      Martin Kraft <kraft@hpcs14.dv.fal.de>
To:        freebsd-multimedia@freebsd.org
Cc:        cdoherty@nttmcl.com
Subject:   RE: SB Vibra16: more joy and rapture
Message-ID:  <199907151904.VAA05492@hpcs14.dv.fal.de>

next in thread | raw e-mail | index | archive | help
Chris,

your problem (posted on july 7) was:

> int format = AFMT_S16_LE;
> Ioctl( fd, SNDCTL_DSP_SETFMT, &format );
> 
> at which point format == 0. disturbed, I then did
> 
> Ioctl( fd, AFMT_QUERY, &format );
> 
> thinking I might get the current format; and ioctl() failed!
> 
> is this a characteristic of SB cards? can I safely assume if 
>  ioctl() returns ok from SNDCTL_DSP_SETFMT, that the
> format has been set?

I had the same situation, and this was, what I found today in an
earlier posting by runge <runge@rostock.zgdv.de> on january 3 in
mailing.freebsd.bugs (found it via www.deja.com):

> Subject: i386/9283: ioctl(SNDCTL_DSP_SETFMT) on /dev/audio (pcm)
>           returns wrong value when sampling
[..]
> Environment: 
> FreeBSD fietje 3.0-RELEASE FreeBSD 3.0-RELEASE #15: Sat Jan  2 17:28:59
>  CET 1999
> 
> >Description: 
> if you configure the audio device (luigis pcm driver) for sampling and
> set the format via SNDCTL_DSP_SETFMT, the
> driver returns the wrong format, even if it's set to the right value.
> This bug even can be found in -current, guessing, it's in all previous
> versions as well.
> >How-To-Repeat:
> open device read-only and try changing the sample format. Check the
> return value  and compare to input.
> >Fix:         
> in /usr/src/sys/i386/isa/snd/sound.c change this:
>  
>         if (ask_init(d)) 
>             *(int *)arg = d->play_fmt ; 
> 
> in line 992 (source of 3.0 RELEASE)
> 
> to:           
>         if (ask_init(d)) 
>         {             
>         if (d->play_fmt) 
>             *(int *)arg = d->play_fmt ; 
>         if (d->rec_fmt)
>             *(int *)arg = d->rec_fmt ;
>         }


I did this change, recompiled my kernel, and it works (using DAP).

Hope this also helps for you.

Martin (martin.kraft@fal.de)


P.S.: I don't follow freebsd-multimedia@freebsd.org; I just found
your question in www.deja.com. Please cc any comment to my personal
email address. Thanks.



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?199907151904.VAA05492>