diff -urN kernel-2.6.7-orig/drivers/media/video/bttv-driver.c kernel-2.6.7-bttv-mdvh/drivers/media/video/bttv-driver.c
--- kernel-2.6.7-orig/drivers/media/video/bttv-driver.c	2004-11-26 06:23:14.000000000 +0100
+++ kernel-2.6.7-bttv-mdvh/drivers/media/video/bttv-driver.c	2004-11-26 06:27:27.000000000 +0100
@@ -197,7 +197,7 @@
 		.scaledtwidth   = 1135,
 		.hdelayx1       = 186,
 		.hactivex1      = 924,
-		.vdelay         = 0x20,
+		.vdelay         = 0x20, /*mdvh orig .vdelay         = 0x20,*/
 		.vbipack        = 255,
 		.sram           = 0,
 	},{
@@ -487,7 +487,8 @@
 #define V4L2_CID_PRIVATE_VCR_HACK    (V4L2_CID_PRIVATE_BASE + 5)
 #define V4L2_CID_PRIVATE_WHITECRUSH_UPPER   (V4L2_CID_PRIVATE_BASE + 6)
 #define V4L2_CID_PRIVATE_WHITECRUSH_LOWER   (V4L2_CID_PRIVATE_BASE + 7)
-#define V4L2_CID_PRIVATE_LASTP1      (V4L2_CID_PRIVATE_BASE + 8)
+#define V4L2_CID_PRIVATE_SYNC_DISABLE   (V4L2_CID_PRIVATE_BASE + 8)
+#define V4L2_CID_PRIVATE_LASTP1      (V4L2_CID_PRIVATE_BASE + 9)
 
 static const struct v4l2_queryctrl no_ctl = {
 	.name  = "42",
@@ -621,6 +622,13 @@
 		.step          = 1,
 		.default_value = 0x7F,
 		.type          = V4L2_CTRL_TYPE_INTEGER,
+	},{
+		.id            = V4L2_CID_PRIVATE_SYNC_DISABLE, /*mdvh*/
+		.name          = "sync disable",
+		.minimum       = 0,
+		.maximum       = 1,
+		.default_value = 0,
+		.type          = V4L2_CTRL_TYPE_BOOLEAN,
 	}
 
 };
@@ -939,6 +947,20 @@
 		bttv_tda9880_setnorm(btv,c.norm);
 }
 
+/*mdvh extra functions to change tthe undocumented TEST register into nosync state and other tricks) */
+/*static int
+set_testregister(unsigned char * testvalue)
+{
+	btwrite(*testvalue,BT848_TEST);
+}
+
+static int
+get_testregister(unsigned char * testvalue)
+{
+	*testvalue    = btread(BT848_TEST);
+}*/
+/*mdvh*/
+
 static int
 set_tvnorm(struct bttv *btv, unsigned int norm)
 {
@@ -955,7 +977,8 @@
 	btaor(tvnorm->iform,~(BT848_IFORM_NORM|BT848_IFORM_XTBOTH),
 	      BT848_IFORM);
 	btwrite(tvnorm->vbipack, BT848_VBI_PACK_SIZE);
-	btwrite(1, BT848_VBI_PACK_DEL);
+	/*mdvh orig btwrite(1, BT848_VBI_PACK_DEL);*/
+	btwrite(1 | BT848_VBI_PACK_DEL_EXT_FRAME, BT848_VBI_PACK_DEL);
 	bt848A_set_timing(btv);
 
 	switch (btv->c.type) {
@@ -1154,6 +1177,9 @@
 	case V4L2_CID_PRIVATE_WHITECRUSH_LOWER:
 		c->value = btv->opt_whitecrush_lower;
 		break;
+	case V4L2_CID_PRIVATE_SYNC_DISABLE:/*mdvh*/
+		c->value = btv->opt_sync_disable;
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -1250,6 +1276,11 @@
 		btv->opt_whitecrush_lower = c->value;
 		btwrite(c->value, BT848_WC_DOWN);
 		break;
+	case V4L2_CID_PRIVATE_SYNC_DISABLE:
+		btv->opt_sync_disable = c->value;
+		btwrite(btv->opt_sync_disable ? BT848_SYNC_DISABLE : BT848_SYNC_NORMAL,
+			BT848_TEST);
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -1363,7 +1394,9 @@
 		return -EINVAL;
 	if (fmt->btformat == BT848_COLOR_FMT_RAW) {
 		width  = RAW_BPL;
-		height = RAW_LINES*2;
+		/* mdvh height = RAW_LINES*2;*/
+		/*height = height*4;*/
+                //height=0;
 		if (width*height > buf->vb.bsize)
 			return -EINVAL;
 		buf->vb.size = buf->vb.bsize;
@@ -1801,7 +1834,21 @@
 		up(&btv->lock);
 		return 0;
 	}
-
+    /********* mdvh extra ioctls to enable setting the test register to nosync state and other tricks*********/
+	/*case BT848_S_TESTREGISTER:
+	{
+		unsigned char *f = arg;
+		set_testregister(f);
+		return 0;
+	}
+	case BT848_G_TESTREGISTER:
+	{
+		unsigned char *f = arg;
+		get_testregister(f);
+		return 0;
+	}*/
+	/*mdvh*/
+	
 	default:
 		return -ENOIOCTLCMD;
 	
diff -urN kernel-2.6.7-orig/drivers/media/video/bttv-risc.c kernel-2.6.7-bttv-mdvh/drivers/media/video/bttv-risc.c
--- kernel-2.6.7-orig/drivers/media/video/bttv-risc.c	2004-11-26 06:22:56.000000000 +0100
+++ kernel-2.6.7-bttv-mdvh/drivers/media/video/bttv-risc.c	2004-11-26 06:27:27.000000000 +0100
@@ -342,6 +342,76 @@
                 geo->comb = 0;
         }
 }
+void
+bttv_calc_geo_raw(struct bttv *btv, struct bttv_geometry *geo, /*mdvh*/
+	      int width /*not used*/, int height /*not used*/, int interleaved, int norm /*not used*/)
+{
+	//const struct bttv_tvnorm *tvnorm = &bttv_tvnorms[norm];
+        u32 xsf, sr;
+	int vdelay;
+
+	int swidth      ;// = tvnorm->swidth;
+	int totalwidth  ;// = tvnorm->totalwidth;
+	int scaledtwidth ;//= tvnorm->scaledtwidth;
+	const struct bttv_tvnorm raw_pal_tvnorm= {
+/* PAL-BDGHI */
+        /* max. active video is actually 922, but 924 is divisible by 4 and 3! */
+ 	/* actually, max active PAL with HSCALE=0 is 948, NTSC is 768 - nil */
+		.v4l2_id        = V4L2_STD_PAL,
+		.name           = "RAW_PAL",
+		.Fsc            = 35468950,
+		.swidth         = 924,//???
+		.sheight        = 690,//624,//orig 576,
+		.totalwidth     = 1135,// 1024 ?
+		.adelay         = 0x7f,
+		.bdelay         = 0x72, 
+		.iform          = (BT848_IFORM_PAL_BDGHI|BT848_IFORM_XT1),
+		.scaledtwidth   = 1135,//1024 ?
+		.hdelayx1       = 186,
+		.hactivex1      = 924,//???
+		.vdelay         = 0x00,//0x02,//0x31, /*mdvh orig .vdelay         = 0x20,*/
+		.vbipack        = 255,
+		.vtotal         = 0,//588,
+		.sram           = 0,
+	};
+	/*if (bttv_tvcards[btv->c.type].muxsel[btv->input] < 0) {
+		swidth       = 720;
+		totalwidth   = 858;
+		scaledtwidth = 858;
+	}*/
+	swidth       = raw_pal_tvnorm.swidth;
+	totalwidth   = raw_pal_tvnorm.totalwidth;
+	scaledtwidth = raw_pal_tvnorm.scaledtwidth;
+
+	vdelay = raw_pal_tvnorm.vdelay;
+#if 0 /* FIXME */
+	if (vdelay < btv->vbi.lines*2)
+		vdelay = btv->vbi.lines*2;
+#endif
+
+        xsf = (swidth*scaledtwidth)/swidth;
+        geo->hscale =  ((totalwidth*4096UL)/xsf-4096);
+        geo->hdelay =  raw_pal_tvnorm.hdelayx1;
+        geo->hdelay =  (geo->hdelay*swidth)/swidth;
+        geo->hdelay &= 0x3fe;
+        sr = ((raw_pal_tvnorm.sheight >> (interleaved?0:1))*512)/raw_pal_tvnorm.sheight - 512;
+        geo->vscale =  (0x10000UL-sr) & 0x1fff;
+        geo->crop   =  ((swidth>>8)&0x03) | ((geo->hdelay>>6)&0x0c) |
+                ((raw_pal_tvnorm.sheight>>4)&0x30) | ((vdelay>>2)&0xc0);
+        geo->vscale |= interleaved ? (BT848_VSCALE_INT<<8) : 0;
+        geo->vdelay  =  vdelay;
+        geo->width   =  swidth;
+        geo->sheight =  raw_pal_tvnorm.sheight;
+	geo->vtotal  =  raw_pal_tvnorm.vtotal;
+
+       /* if (btv->opt_combfilter) {
+                geo->vtc  = (width < 193) ? 2 : ((width < 385) ? 1 : 0);
+                geo->comb = (width < 769) ? 1 : 0;
+        } else {*/
+                geo->vtc  = 0 | ((~0x03) & 0xff);
+                geo->comb = 0;
+        /*}*/
+}
 
 void
 bttv_apply_geo(struct bttv *btv, struct bttv_geometry *geo, int odd)
@@ -702,12 +772,18 @@
 	if (buf->fmt->flags & FORMAT_FLAGS_RAW) {
 		/* build risc code */
 		buf->vb.field = V4L2_FIELD_SEQ_TB;
-		bttv_calc_geo(btv,&buf->geo,tvnorm->swidth,tvnorm->sheight,
-			      1,buf->tvnorm);
+		bttv_calc_geo_raw(btv,&buf->geo,tvnorm->swidth /*not used*/,tvnorm->sheight /*not used RAW_LINES ? or RAW_LINES*2*/,
+			      1,buf->tvnorm /*not used*/);
+
+		//buf->geo.crop  = (buf->geo.crop) & (~0x30);
+		//buf->geo.crop  = (buf->geo.crop) | ((625>>4)&0x30); /* mdvh tvnorm->sheight == 576 */
+		/* buf->geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) |
+                ((tvnorm->sheight>>4)&0x30) | ((vdelay>>2)&0xc0);*/
+	        //buf->geo.sheight =  625;/* =tvnorm->sheight;*/
 		bttv_risc_packed(btv, &buf->top,  buf->vb.dma.sglist,
-				 0, RAW_BPL, 0, RAW_LINES);
+				 0, RAW_BPL, 0, buf->vb.height >> 1 /*RAW_LINES*/);
 		bttv_risc_packed(btv, &buf->bottom, buf->vb.dma.sglist,
-				 buf->vb.size/2 , RAW_BPL, 0, RAW_LINES);
+				 buf->vb.size/2 , RAW_BPL, 0, buf->vb.height >> 1);//mdvh last param was RAW_LINES
 	}
 
 	/* copy format info */
diff -urN kernel-2.6.7-orig/drivers/media/video/bttvp.h kernel-2.6.7-bttv-mdvh/drivers/media/video/bttvp.h
--- kernel-2.6.7-orig/drivers/media/video/bttvp.h	2004-11-26 06:22:09.000000000 +0100
+++ kernel-2.6.7-bttv-mdvh/drivers/media/video/bttvp.h	2004-11-26 06:27:27.000000000 +0100
@@ -65,7 +65,8 @@
 #define RESOURCE_VIDEO         2
 #define RESOURCE_VBI           4
 
-#define RAW_LINES            640
+/* mdvh define RAW_LINES            640*/
+#define RAW_LINES            692
 #define RAW_BPL             1024
 
 #define UNSET (-1U)
@@ -187,6 +188,8 @@
 /* calculate / apply geometry settings */
 void bttv_calc_geo(struct bttv *btv, struct bttv_geometry *geo,
 		   int width, int height, int interleaved, int norm);
+void bttv_calc_geo_raw(struct bttv *btv, struct bttv_geometry *geo,
+		   int width, int height, int interleaved, int norm);
 void bttv_apply_geo(struct bttv *btv, struct bttv_geometry *geo, int top);
 
 /* control dma register + risc main loop */
@@ -350,6 +353,7 @@
 	int opt_vcr_hack;
 	int opt_whitecrush_upper;
 	int opt_whitecrush_lower;
+	int opt_sync_disable;/*mdvh*/
 
 	/* radio data/state */
 	int has_radio;
diff -urN kernel-2.6.7-orig/sound/oss/btaudio.c kernel-2.6.7-bttv-mdvh/sound/oss/btaudio.c
--- kernel-2.6.7-orig/sound/oss/btaudio.c	2004-11-26 06:20:53.000000000 +0100
+++ kernel-2.6.7-bttv-mdvh/sound/oss/btaudio.c	2004-11-26 06:27:27.000000000 +0100
@@ -69,6 +69,7 @@
 			   IRQ_RISCI)
 
 /* REG_GPIO_DMA_CTL bits */
+#define DMA_CTL_A_G2X     (1 << 27)
 #define DMA_CTL_A_PWRDN   (1 << 26)
 #define DMA_CTL_DA_SBR    (1 << 14)
 #define DMA_CTL_DA_ES2    (1 << 13)
@@ -142,7 +143,10 @@
 	int sampleshift;
 	int channels;
 	int analog;
-	int rate;
+	int rate;	
+	int decimation_stage2; /* DA_ES2*/ /* mdvh additions */
+	int gain_boost[3]; /* A_G2X */
+
 };
 
 struct cardinfo {
@@ -261,7 +265,8 @@
 		btwrite(DMA_CTL_ACAP_EN |
 			DMA_CTL_RISC_EN |
 			DMA_CTL_FIFO_EN |
-			DMA_CTL_DA_ES2  |
+			((bta->decimation_stage2 == 1) ? DMA_CTL_DA_ES2 : 0) | /* mdvh*/
+			((bta->gain_boost[bta->source] == 1) ? DMA_CTL_A_G2X : 0) | /* mdvh*/
 			((bta->bits == 8) ? DMA_CTL_DA_SBR : 0) |
 			(bta->gain[bta->source] << 28) |
 			(bta->source            << 24) |
@@ -271,7 +276,7 @@
 		btwrite(DMA_CTL_ACAP_EN |
 			DMA_CTL_RISC_EN |
 			DMA_CTL_FIFO_EN |
-			DMA_CTL_DA_ES2  |
+			((bta->decimation_stage2 == 1) ? DMA_CTL_DA_ES2 : 0) | /* mdvh*/
 			DMA_CTL_A_PWRDN |
 			(1 << 6)   |
 			((bta->bits == 8) ? DMA_CTL_DA_SBR : 0) |
@@ -396,13 +401,21 @@
 			i = 1;
 		if (MIXER_WRITE(SOUND_MIXER_LINE3) == cmd)
 			i = 2;
-		bta->gain[i] = (val & 0xff) * 15 / 100;
+		if((bta->analog) && ((val & 0xff) >50))
+		{
+			bta->gain_boost[i] = 1; /* +6db gain boost, this is twice the sound volume) */
+			bta->gain[i] = ((val & 0xff) * 15) / (2 * 100);/* mdvh this was  (val & 0xff) * 15 / 100;) */
+		} else
+		{
+			bta->gain_boost[i] = 0;
+			bta->gain[i] = (val & 0xff) * 15 / 100;
+		}
 		if (bta->gain[i] > 15) bta->gain[i] = 15;
 		if (bta->gain[i] <  0) bta->gain[i] =  0;
 		if (i == bta->source)
-			btaor((bta->gain[bta->source]<<28),
+			btaor((bta->gain[bta->source]<<28)| bta->gain_boost[bta->source]<<27,
 			      0x0fffffff, REG_GPIO_DMA_CTL);
-		ret  = bta->gain[i] * 100 / 15;
+		ret  = bta->gain_boost[i]?(bta->gain[i] * 200 / 15):(bta->gain[i] * 100 / 15);
 		ret |= ret << 8;
 		break;
 
@@ -415,7 +428,8 @@
 			i = 1;
 		if (MIXER_READ(SOUND_MIXER_LINE3) == cmd)
 			i = 2;
-		ret  = bta->gain[i] * 100 / 15;
+		/* mdvh ret  = bta->gain[i] * 100 / 15;*/
+ret  = bta->gain_boost[i]?(bta->gain[i] * 200 / 15):(bta->gain[i] * 100 / 15);
 		ret |= ret << 8;
 		break;
 
@@ -637,18 +651,28 @@
 			for (s = 0; s < 16; s++)
 				if (val << s >= HWBASE_AD*4/15)
 					break;
-			for (i = 15; i >= 5; i--)
-				if (val << s <= HWBASE_AD*4/i)
+			for (i = 15; i >= 1; i--) /*mdvh was >=5 */
+				if (i==0 || val << s <= HWBASE_AD*4*2/i)
 					break;
+
+			if (i==0 && val << s > HWBASE_AD*4/1)
+			{
+				bta->decimation_stage2=0;/*=0*/
+				
+			} else
+			{
+				bta->decimation_stage2=0;
+			}
 			bta->sampleshift = s;
 			bta->decimation  = i;
 			if (debug)
 				printk(KERN_DEBUG "btaudio: rate: req=%d  "
 				       "dec=%d shift=%d hwrate=%d swrate=%d\n",
-				       val,i,s,(HWBASE_AD*4/i),(HWBASE_AD*4/i)>>s);
+				       val,i,s,(HWBASE_AD*(8 >> bta->decimation_stage2)/i),(HWBASE_AD*(8 >> bta->decimation_stage2)/(i>0)?i:1)>>s);/*mdvh*/
 		} else {
 			bta->sampleshift = (bta->channels == 2) ? 0 : 1;
 			bta->decimation  = 0;
+			bta->decimation_stage2=1;
 		}
 		if (bta->recording) {
 			down(&bta->lock);
@@ -659,7 +683,7 @@
 		/* fall through */
         case SOUND_PCM_READ_RATE:
 		if (bta->analog) {
-			return put_user(HWBASE_AD*4/bta->decimation>>bta->sampleshift, p);
+			return put_user(HWBASE_AD*(8 >> bta->decimation_stage2)/bta->decimation>>bta->sampleshift, p);
 		} else {
 			return put_user(bta->rate, p);
 		}
@@ -929,6 +953,8 @@
 	bta->source     = 1;
 	bta->bits       = 8;
 	bta->channels   = 1;
+
+	bta->decimation_stage2 = 1; /*mdvh*/
 	if (bta->analog) {
 		bta->decimation  = 15;
 	} else {
@@ -1097,7 +1123,7 @@
 
 static int btaudio_init_module(void)
 {
-	printk(KERN_INFO "btaudio: driver version 0.7 loaded [%s%s%s]\n",
+	printk(KERN_INFO "btaudio: driver version 0.7-mdvh loaded [%s%s%s]\n",
 	       digital ? "digital" : "",
 	       analog && digital ? "+" : "",
 	       analog ? "analog" : "");

