Skip site navigation (1)Skip section navigation (2)
Date:      30 Apr 2002 17:02:32 -0000
From:      Mike Meyer <mwm@mired.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/37600: [Partial PATCH] t4dwave drive doesn't record.
Message-ID:  <20020430170232.25953.qmail@mired.org>

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

>Number:         37600
>Category:       kern
>Synopsis:       [Partial PATCH] t4dwave drive doesn't record.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 30 10:10:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Mike Meyer
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Meyer Consulting
>Environment:
System: FreeBSD guru.mired.org 4.5-STABLE FreeBSD 4.5-STABLE #6: Sun Apr 28 08:34:18 CDT 2002 mwm@guru.mired.org:/sharetmp/obj/usr/src/sys/GURU i386


>Description:
	The t4dwave driver doesn't record sound.

>How-To-Repeat:
	Find a system with a t4dwave in it, and try to record with that card.

>Fix:
	This is a partial patch, and isn't a complete solution. Cameron asked
	me to submit it as he plans on finishing it. I had to replace the card to
	get sound at all on other operating systems running on my test
	machine.

--- t4dwave.c	Sun Mar  3 05:52:17 2002
+++ t4dwave.c-new	Sun Mar  3 10:09:52 2002
@@ -558,7 +558,16 @@
 	struct tr_info *tr = ch->parent;
 	u_int32_t i, bits;
 
-	bits = tr_fmttobits(format);
+	switch (tr->type) {
+        case TDX_PCI_ID:
+	case TNX_PCI_ID:
+	        /* Tridents only record in one format */
+	        bits = tr_fmttobits(AFMT_16BIT | AFMT_STEREO);
+		break;
+	default:	
+	        bits = tr_fmttobits(format);
+		break;
+	}
 	/* set # of samples between interrupts */
 	i = (sndbuf_runsz(ch->buffer) >> ((bits & 0x08)? 1 : 0)) - 1;
 	tr_wr(tr, TR_REG_SBBL, i | (i << 16), 4);
@@ -577,7 +586,16 @@
 	struct tr_info *tr = ch->parent;
 
 	/* setup speed */
-	ch->delta = (48000 << 12) / speed;
+	switch (tr->type) {
+        case TDX_PCI_ID:
+	case TNX_PCI_ID:
+	        /* Tridents only capture at this speed */
+	        ch->delta = 0x1000;
+		break;
+	default:	/* Assume only Tridents require above */
+	        ch->delta = (48000 << 12) / speed;
+		break;
+	}
 	tr_wr(tr, TR_REG_SBDELTA, ch->delta, 2);
 
 	/* return closest possible speed */
@@ -599,12 +617,23 @@
 {
 	struct tr_rchinfo *ch = data;
 	struct tr_info *tr = ch->parent;
+	int bank;
 	u_int32_t i;
 
 	if (go == PCMTRIG_EMLDMAWR || go == PCMTRIG_EMLDMARD)
 		return 0;
 
 	if (go == PCMTRIG_START) {
+#if		0
+		/* set cso to 0 */
+   	        tr_wr(tr, TR_REG_CHNBASE + 1, 0, 1);
+   	        tr_wr(tr, TR_REG_CHNBASE + 2, 0, 2);
+		/* set Alpha and FMS to 0 */
+		tr_wr(tr, TR_REG_CHNBASE + 12, 0, 2);
+		/* Set chorus and reverb volumes to 0x7f */
+		i = tr_rd(tr, TR_REG_CHNBASE + 14, 2);
+		tr_wr(tr, TR_REG_CHNBASE + 14, i | 0x7f, 2);
+#endif
 		/* set up dma mode regs */
 		tr_wr(tr, TR_REG_DMAR15, 0, 1);
 		i = tr_rd(tr, TR_REG_DMAR11, 1) & 0x03;
@@ -799,7 +828,7 @@
 		goto bad;
 	}
 
-	if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/2, /*boundary*/0,
+	if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/8, /*boundary*/0,
 		/*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
 		/*highaddr*/BUS_SPACE_MAXADDR,
 		/*filter*/NULL, /*filterarg*/NULL,



>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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