Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 1997 19:20:09 -0400
From:      Randall Hopper <rhh@ct.picker.com>
To:        Steve Passe <smp@csn.net>, Amancio Hasty <hasty@rah.star-gate.com>
Cc:        freebsd-multimedia@FreeBSD.ORG
Subject:   Re: Problem with my Wincast, fxtv
Message-ID:  <19970910192009.21380@ct.picker.com>
In-Reply-To: <199708170639.AAA04736@Ilsa.StevesCafe.com>; from Steve Passe on Sun, Aug 17, 1997 at 12:39:36AM -0600
References:  <199708170629.XAA01103@rah.star-gate.com> <199708170639.AAA04736@Ilsa.StevesCafe.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Amancio Hasty:
 |Steve Passe:
 | |Amancio Hasty:
 | |> except that I have new bt848 driver release:
 | |> ftp://rah.star-gate.com/pub/bt848.tar.gz
 | |> ...
 | |> 	Can someone please check in  the driver, the vic module I will
 | |>         submit to Steve Macanne.
 | |
 | |have  all the various versions been merged in this (Randall's etc.)?
 |
 |I don't remember however I am using Randall's fxtv-43.

(Finally getting to catch up on my backlogged multimedia mail folder.)

The main changes in my version are patches to get temporal decimation (FPS)
working.  Having this working in some form for video capture is critical
since many systems can't swallow 30fps in 16 or 24bpp at a frame
resolution worth capturing.

Amancio, last we swapped mail about this, you were going to ask the
Brooktree folks about this.  Any word back?

Anyway, this driver version (970604; linked to the Fxtv page) is a patched
version of the 970424 driver.  It gets FPS working for single field
captures, but not double fields.  The mainstream driver doesn't work for
either case.  That's why Fxtv still delivers on 970604 and not a newer
version.

Attached is some past mail with with my patches and more detailed problem
description that may be of some use.  Let me know if you have time to take
a look and can integrat these with a more recent driver version.

Randall


-----Forwarded message from Randall Hopper <rhh@ct.picker.com>-----

Date: Tue, 3 Jun 1997 22:38:53 -0400
From: Randall Hopper <rhh@ct.picker.com>
To: Amancio Hasty <hasty@rah.star-gate.com>, Steve Passe <smp@csn.net>
Cc: multimedia@freebsd.org
Subject: bktr FPS/Temporal Decimation problems

     Well, after picking at the FPS problems for a few evenings, I need to
ask for some help.  I got it partially working (works fine in single
field--though I'm sure the method probably isn't right), but in interlaced
mode the engine seems to be dropping fields instead of frames, giving a
cool (but wrong) ghosting effect.

     Attached is my patch to this point.  It will apply to the 970424
driver posted on the home page.  The original TDEC computation wasn't
correct.  Additionally, I've made the FPS code more PAL-friendly,
obsoleting a PAL FPS hack that was in there.  It also turns temporal
decimation off for CAP_SINGLEs so you always get a frame in this capture
mode.

     The problem: despite the databook's description of how temporal
decimation on frames is supposed to work (whole frames are masked as a unit
for purposes of synchronization), it appears that the engine is masking out
fields, or rotating the enablement of the fields based on the requested
number of dropped frames.  Anyway, I must be missing something.  Could sure
use a set of eyes with more bt experience.

     BTW, in the patch, the correct TDEC computation:

/*#define FPS_TO_TDEC(bktr,fps) (((FPS_MAX(bktr) - (fps))*2) & 0x3f)*/

is commented out in favor of a tweaked version I was having better luck
with.

Thanks,

Randall


--- brooktree848.c-970424	Sun Jun  1 20:35:25 1997
+++ brooktree848.c	Tue Jun  3 22:21:19 1997
@@ -176,6 +176,10 @@
                            interrupt isn't delivered, and fixed fixing 
 			   CAP_SINGLEs that for ODD_ONLY fields.
 
+1.19            6/02/97    Randall Hopper <rhh@ct.picker.com>
+                           Fix temporal decimation, & disable it when doing
+			   CAP_SINGLEs.
+
 */
 
 #include "bktr.h"
@@ -255,6 +259,14 @@
 
 #define BKTRPRI (PZERO+8)|PCATCH
 
+#define NTSC_ACTIVE(bktr)     (bktr->format_params == FORMAT_PARAMS_NTSC525)
+#define FPS_MAX(bktr)         (NTSC_ACTIVE(bktr) ? 30 : 25)
+
+/*  Though the docs say # of frames or fields to drop out of a total of   */
+/*    60, for single-field captures, we get better results using 30.      */
+/*#define FPS_TO_TDEC(bktr,fps) (((FPS_MAX(bktr) - (fps))*2) & 0x3f)*/
+#define FPS_TO_TDEC(bktr,fps) ((FPS_MAX(bktr) - (fps)) & 0x3f)
+
 static char*	bktr_probe( pcici_t tag, pcidi_t type );
 static void	bktr_attach( pcici_t tag, int unit );
 
@@ -764,16 +776,24 @@
 	printf( " STATUS %x %x %x \n",
 		dstatus, bktr_status, bt848->risc_count );
 	*/
+
+#define RESTART_ERRORS  (BT848_INT_FBUS   | BT848_INT_FTRGT  | \
+			 BT848_INT_FDSR   | BT848_INT_PPERR  | \
+			 BT848_INT_RIPERR | BT848_INT_PABORT | \
+			 BT848_INT_OCERR  | BT848_INT_SCERR)
+
+	/* if temp decimation is on, frames will be skipped; ignore dropped */
+	/*   data and overrun errors logged w/ the frame after the skip(s)  */
+	if ( (bt848->tdec != 0) && (bktr_status & BT848_INT_RISC_EN) &&
+	     (bktr_status & BT848_INT_RISCI) &&
+	     (bktr_status & (BT848_INT_FDSR | BT848_INT_FBUS)) &&
+	     !(bktr_status & 
+	       (RESTART_ERRORS & ~(BT848_INT_FDSR | BT848_INT_FBUS))) )
+		bktr_status &= ~(BT848_INT_FDSR | BT848_INT_FBUS);
+
 	/* if risc was disabled re-start process again */
-	if ( !(bktr_status & BT848_INT_RISC_EN) ||
-	     ((bktr_status & (BT848_INT_FBUS   |
-			      BT848_INT_FTRGT  |
-			      BT848_INT_FDSR   |
-			      BT848_INT_PPERR  |
-			      BT848_INT_RIPERR |
-			      BT848_INT_PABORT |
-			      BT848_INT_OCERR  |
-			      BT848_INT_SCERR)) != 0) ) {
+	else if ( !(bktr_status & BT848_INT_RISC_EN) ||
+	     ((bktr_status & RESTART_ERRORS) != 0) ) {
 
 		bt848->gpio_dma_ctl = FIFO_RISC_DISABLED;
 
@@ -981,7 +1001,7 @@
 	bktr->even_fields_captured = 0;
 	bktr->odd_fields_captured = 0;
 	bktr->proc = (struct proc *)0;
-	set_fps(bktr, 30);
+	set_fps(bktr, FPS_MAX(bktr));
 	bktr->video.addr = 0;
 	bktr->video.width = 0;
 	bktr->video.banksize = 0;
@@ -2350,9 +2370,9 @@
 
 	/* contruct sync : for video packet format */
 	*dma_prog++ = OP_SYNC  | 1 << 15 | BKTR_FM1;
+	*dma_prog++ = 0;  /* NULL WORD */
 
 	/* sync, mode indicator packed data */
-	*dma_prog++ = 0;  /* NULL WORD */
 	width = cols;
 	for (i = 0; i < (rows/interlace); i++) {
 	    target = target_buffer;
@@ -2793,6 +2813,12 @@
 	bt848->dstatus = 0;
 	bt848->int_stat = bt848->int_stat;
 
+	/*  For capcontin, set FPS (disable for capsingle)          */
+	/*    (Always init to 0 first to reset decimation counter)  */
+	bt848->tdec = 0;
+	if ( type != METEOR_SINGLE )
+		bt848->tdec = FPS_TO_TDEC( bktr, bktr->fps );
+
 	bktr->flags |= type;
 	switch(bktr->flags & METEOR_ONLY_FIELDS_MASK) {
 	case METEOR_ONLY_EVEN_FIELDS:
@@ -2844,13 +2870,8 @@
 
 	bktr->fps = fps;
 
-	if ( fps == 30 ) {
-		bt848->tdec = 0;
-		return;
-	} else {
-		bt848->tdec = (int) (((float) fps / 30.0) * 60.0) & 0x3f;
-		bt848->tdec |= 0x80;
-	}
+	bt848->tdec = 0;	/*  Always init to 0 1st to reset decim ctr */
+	bt848->tdec = FPS_TO_TDEC( bktr, bktr->fps );
 
 	if ( bktr->flags & METEOR_CAP_MASK ) {
 

-----End of forwarded message-----
-----Forwarded message from Randall Hopper <rhh@ct.picker.com>-----

Date: Wed, 4 Jun 1997 17:37:47 -0400
From: Randall Hopper <rhh@ct.picker.com>
To: Amancio Hasty <hasty@rah.star-gate.com>
Cc: Steve Passe <smp@csn.net>, multimedia@freebsd.org
Subject: Re: bktr FPS/Temporal Decimation problems

Amancio Hasty:
 |Feel free to try out my latest beta on my ftp site:
 |
 |That release makes the correct decision in set_fps for PAL or NTSC.

     Well, neither single field or full field works for me with this
version.  Testing by flipping an ioctl(SFPS, 1) into fxtv, for single field
(ODD_ONLY) CAP_CONTINUOUS, I get a frame every 1 to 3 seconds, and in
between the updates, trash corrupts the image (see:

     http://multiverse.com/~rhh/tmpimages/bt848-970524-prob1.gif

for a snap).

    For interlaced images, I get 1 or 2 single-field (not frame) updates
every 1 to 30 seconds, with less image trash but still some corruption
gradually appearing between field appearances.

     Also, as an aside, CAP_SINGLEs rarely work since temporal decimation
isn't being turned off for CAP_SINGLE requests and turned on for
CAP_CONTINUOUS, but rather is always left on.  This was one of the fixes in
the patch I posted.  A simple mod.

     In case it helps, here is some debug driver output for single and
double frame continuous-capture generated with ioctl(SFPS,1) and the 970526
driver off rah.

Thanks,

Randall


begin 644 LOG.SINGLE.gz
M'XL( '/>E3,  ^V800Z#(!!%]YYBCC!8K8F[GD%[ "68F)K:(+U_C8JM&S>U
M#>A?N?@,O/DS((&R_))?,U),%3.'?";1?UE("FC2)/?RNE9P-&A5&%%0WXVF
MSA3FV<UB/V[2YU LN;;D=ZBQ1=UD3K#\E&5HI^6< KZ Q0<6]"Y\^1M+>3.:
M4ZI;:9J43-<H]2"E=:OI%-MA/O[L<;_ GMN098Q+K!;*X^8>':GNV ]@ 0M8
M<-W \0I?X(O3OB3P!2R^L^RT=]\Y?.;G5PZH+7R!+P[X A;W6="[B[CY^5"4
6!\H=3PVNE@+;<P>^O "*Z*3I:R4  .;G
 
end


begin 644 LOG.INTERLACE.gz
M'XL( &K>E3,  ^W<04["0!@&T#VGF"-,*\K:,X '0 ()&Q:TW%]$J&"@)K:Q
MG<E;N?B9,GU\]DN+,<P7KXNW>5C%L(XQEO$E%,>?L5B%2;B=+>/T--N4TS#9
M[NI]J.IE?:B:X?%UY_G/I7T?=AW#YI?#CN4MNVWU^;+57H[9TUY.;+?'++AP
M2<'ESE[:UCTULW)PS^GG.92KV: ?;=NZK]G=;?[W5FC2I-G#!?#^A3H#%B&C
M29,F39KI:?95ZNYJA),F39HT:29=ZM^/*M\'/X=1< HG39HT:=(<>BL>OPLG
M39HT:=),7E.I"R=-FC1ITLQ$4ZD+)TV:-&G2S$13J0LG39HT:=+,1+-;J?M#
M.>&D29,F39JCT72G+IPT:=*D23,33:4NG#1ITJ1),Q--I2Z<-&G2I$DS$TVE
M+IPT:=*D23,33:4NG#1ITJ1),Q--I2Z<-&G2I$DS$TVE+IPT:=*D23,33:4N
MG#1ITJ1),Q/-;J7NG\\()TV:-&G2'(VF.W7AI$F3)DV:F6CV5>KEX.<P"D[A
MI$F3)DV:0V^E^^-WI2Z<-&G2I$DSZ5*?76:%4A=.FC1ITJ29=*G[3ETX:=*D
M29/F:#3_6NKGV<VZ[:[>AZI>UH>J&1Y?=YX_VLZCMVSY %O0^EEUE:/!,YU(
CD/Q:TJ1)DV:RFF[PG<)HPTF3IJN5<-*\FGT TG;PD.[%  #0
 
end

-----End of forwarded message-----
-----Forwarded message from Randall Hopper <rhh@ct.picker.com>-----

Message-ID: <19970605063933.51877@ct.picker.com>
Date: Thu, 5 Jun 1997 06:39:33 -0400
From: Randall Hopper <rhh@ct.picker.com>
To: Amancio Hasty <hasty@rah.star-gate.com>
Cc: multimedia@FreeBSD.ORG
Subject: Re: bktr FPS/Temporal Decimation problems
References: <199706050648.IAA28992@labinfo.iet.unipi.it> <199706050803.BAA12816@rah.star-gate.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.75
In-Reply-To: <199706050803.BAA12816@rah.star-gate.com>; from Amancio Hasty on Thu, Jun 05, 1997 at 01:03:22AM -0700

Amancio Hasty:
 |I am going to mail to brooktree to find out a few more things 
 |about the Bt848 : like just how exactly the Bt848 wants the
 |format for RISC programs and the proper way to set fps.

Ok, thanks.

Randall

-----End of forwarded message-----



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