From owner-freebsd-mobile Thu Aug 17 10:37:41 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from mag.ik.nu (mail.olm.nl [194.151.118.79]) by hub.freebsd.org (Postfix) with ESMTP id E0D9537BCAE; Thu, 17 Aug 2000 10:36:57 -0700 (PDT) Received: (from ralphm@localhost) by mag.ik.nu (8.9.3/8.9.3) id TAA80999; Thu, 17 Aug 2000 19:36:43 +0200 (CEST) (envelope-from ralphm) Date: Thu, 17 Aug 2000 19:36:43 +0200 From: Ralph Meijer To: freebsd-mobile@freebsd.org, freebsd-stable@freebsd.org Cc: taku@cent.saitama-u.ac.jp Subject: Followup: ESS Maestro-2E Message-ID: <20000817193642.B80887@mag.ik.nu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Upon suggestion by Sean O'Connell triggered by a Maestro thread on -stable I've tried the (beta) newpcm driver from http://access.cent.saitama-u.ac.jp/~taku/freebsd/maestro/ It didn't compile on my 4.1-RELEASE box because of changes in /sys/dev/sound/pcm/datatypes.h but following patch fixes that. I'm not sure if it could be done easier, but this works. Note that you have to crank the volume up quite a bit compared to the OSS driver I used. Futhermore, there is no recording support (yet). Greetz, Ralphm (r@ik.nu) --->8-- cut here --->8--- --- maestro.c.orig Wed Aug 16 17:09:32 2000 +++ maestro.c Thu Aug 17 19:03:58 2000 @@ -88,6 +88,7 @@ u_int num; u_int16_t aputype; u_int16_t wcreg_tpl; + u_int32_t fmt; }; struct agg_info { @@ -584,10 +585,16 @@ static inline u_int calc_timer_freq(struct agg_chinfo *ch) { + unsigned ss; + pcm_channel *c = ch->channel; - return (c->speed * c->buffer.sample_size + c->blocksize - 1) - / c->blocksize; + ss = 1; + ss <<= (ch->fmt & AFMT_STEREO)? 1 : 0; + ss <<= (ch->fmt & AFMT_16BIT)? 1 : 0; + + return (c->speed * ss + c->buffer.blksz - 1) + / c->buffer.blksz; } static void @@ -679,6 +686,7 @@ } ch->wcreg_tpl = wcreg_tpl; ch->aputype = aputype; + ch->fmt = format; return format; } --->8-- cut here --->8--- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message