From owner-freebsd-multimedia@FreeBSD.ORG Wed Oct 26 19:09:06 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6C8416A41F for ; Wed, 26 Oct 2005 19:09:06 +0000 (GMT) (envelope-from kazuhito@ph.noda.tus.ac.jp) Received: from phws.ph.noda.tus.ac.jp (phws.ph.noda.tus.ac.jp [133.31.102.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id C640F43D45 for ; Wed, 26 Oct 2005 19:09:05 +0000 (GMT) (envelope-from kazuhito@ph.noda.tus.ac.jp) Received: from localhost (unknown [133.31.111.131]) by phws.ph.noda.tus.ac.jp (Postfix) with ESMTP id 3661D6E40CB; Thu, 27 Oct 2005 04:09:03 +0900 (JST) Date: Thu, 27 Oct 2005 04:09:02 +0900 (JST) Message-Id: <20051027.040902.343165902.kazuhito@ph.noda.tus.ac.jp> To: peo@intersonic.se From: Kazuhito HONDA In-Reply-To: <435B4EBE.5030502@intersonic.se> References: <4358CB6F.2080901@intersonic.se> <20051021235357.0c169e05.skywizard@MyBSD.org.my> <435B4EBE.5030502@intersonic.se> X-Mailer: Mew version 4.2 on XEmacs 21.4.17 (Jumbo Shrimp) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-multimedia@freebsd.org, grattier@digigram.com, skywizard@MyBSD.org.my Subject: Re: uaudio and Digigram UAX220 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2005 19:09:06 -0000 Hello, > http://people.freebsd.org/~ariff/snd_RELENG_5_20051009_054.tar.gz Though FreeBSD sound system came to be able to treat 24-bit sound stream with this patch, USB audio device can't do yet. On the other hand, UAX220 may be unable to play/record 8-bit and 16-bit sound stream directly, may be able to do 24-bit only. I expect that it caused that problem. I had a patch which make USB audio device treat 24-bit on FreeBSD. It was attached to this mail. But cyclic noise will interrupt, though FreeBSD sound system can play/record sound source. It may result from USB system in FreeBSD, and the patch in (http://home.c2i.net/hselasky/isdn4bsd/privat/usb/) will resolve this noise problem. (Usage of this patch was written in http://docs.freebsd.org/cgi/getmsg.cgi?fetch=42785+0+archive/2005/freebsd-multimedia/20050904.freebsd-multimedia) Sincerely yours, Kazuhito HONDA --- uaudio.c.orig Thu Apr 28 02:16:27 2005 +++ uaudio.c Tue Sep 6 23:10:09 2005 @@ -3690,7 +3690,7 @@ uaudio_init_params(struct uaudio_softc * if ((sc->sc_playchan.pipe != NULL) || (sc->sc_recchan.pipe != NULL)) return (-1); - switch(ch->format & 0x0000FFFF) { + switch(ch->format & 0x000FFFFF) { case AFMT_U8: enc = AUDIO_ENCODING_ULINEAR_LE; ch->precision = 8; @@ -3723,6 +3723,22 @@ uaudio_init_params(struct uaudio_softc * enc = AUDIO_ENCODING_ULINEAR_BE; ch->precision = 16; break; + case AFMT_S24_LE: + enc = AUDIO_ENCODING_SLINEAR_LE; + ch->precision = 24; + break; + case AFMT_S24_BE: + enc = AUDIO_ENCODING_SLINEAR_BE; + ch->precision = 24; + break; + case AFMT_U24_LE: + enc = AUDIO_ENCODING_ULINEAR_LE; + ch->precision = 24; + break; + case AFMT_U24_BE: + enc = AUDIO_ENCODING_ULINEAR_BE; + ch->precision = 24; + break; default: enc = 0; ch->precision = 16; @@ -3828,6 +3844,8 @@ uaudio_query_formats(device_t dev, u_int fmt = AFMT_U8; } else if (prec == 16) { fmt = AFMT_U16_LE; + } else if (prec == 24) { + fmt = AFMT_U24_LE; } break; case AUDIO_ENCODING_SLINEAR_LE: @@ -3835,16 +3853,22 @@ uaudio_query_formats(device_t dev, u_int fmt = AFMT_S8; } else if (prec == 16) { fmt = AFMT_S16_LE; + } else if (prec == 24) { + fmt = AFMT_S24_LE; } break; case AUDIO_ENCODING_ULINEAR_BE: if (prec == 16) { fmt = AFMT_U16_BE; + } else if (prec == 24) { + fmt = AFMT_U24_BE; } break; case AUDIO_ENCODING_SLINEAR_BE: if (prec == 16) { fmt = AFMT_S16_BE; + } else if (prec == 24) { + fmt = AFMT_S24_BE; } break; case AUDIO_ENCODING_ALAW: @@ -3876,7 +3900,7 @@ uaudio_query_formats(device_t dev, u_int } } - if ((pn > 8*2) || (rn > 8*2)) + if ((pn > 12*2) || (rn > 12*2)) break; } pfmt[pn] = 0; --- uaudio_pcm.c.orig Thu Apr 28 02:16:27 2005 +++ uaudio_pcm.c Tue Sep 6 23:10:32 2005 @@ -51,13 +51,13 @@ struct ua_info { struct ua_chinfo pch, rch; }; -static u_int32_t ua_playfmt[8*2+1]; /* 8 format * (stereo or mono) + endptr */ +static u_int32_t ua_playfmt[12*2+1]; /* 8 format * (stereo or mono) + endptr */ -static struct pcmchan_caps ua_playcaps = {8000, 48000, ua_playfmt, 0}; +static struct pcmchan_caps ua_playcaps = {8000, 96000, ua_playfmt, 0}; -static u_int32_t ua_recfmt[8*2+1]; /* 8 format * (stereo or mono) + endptr */ +static u_int32_t ua_recfmt[12*2+1]; /* 8 format * (stereo or mono) + endptr */ -static struct pcmchan_caps ua_reccaps = {8000, 48000, ua_recfmt, 0}; +static struct pcmchan_caps ua_reccaps = {8000, 96000, ua_recfmt, 0}; #define UAUDIO_DEFAULT_BUFSZ 16*1024