[Asterisk-Users] Lag in speech

Thor Atle Rustad thor.rustad at gmail.com
Thu Nov 24 11:04:50 MST 2005


I found the mail from Pauline Middelink!

filename: hfc_pci.c.diff



--- /root/hfc_pci.c	Wed Aug  7 15:31:24 2002
+++ /usr/src/linux/drivers/isdn/hisax/hfc_pci.c	Thu Oct 31 10:18:05 2002
@@ -270,8 +270,16 @@
 	if (fifo_state)
 	        cs->hw.hfcpci.fifo_en ^= fifo_state;
 	Write_hfc(cs, HFCPCI_FIFO_EN, cs->hw.hfcpci.fifo_en);
-	bzt->za[MAX_B_FRAMES].z1 = B_FIFO_SIZE + B_SUB_VAL - 1;
-	bzt->za[MAX_B_FRAMES].z2 = bzt->za[MAX_B_FRAMES].z1;
+	/* Notice the z2 is readonly, and could be active when we enter this
+	 * function. (I.e. changing.) When we now reset z1 to MAXSIZE, the
+	 * FIFO thinks there is data and runs it when re-enabled...
+	 * To prevent this from happening, we make z1 ONE higher than z2, so
+	 * when the FIFO gets re-enabled, it thinks it only has to send a
+	 * single byte, which hopefully nobody notices (1/8000 second?)
+	 * (Pauline Middelink - 2002) */
+	bzt->za[MAX_B_FRAMES].z1 = bzt->za[MAX_B_FRAMES].z2 + 1;
+	if (bzt->za[MAX_B_FRAMES].z1 >= B_FIFO_SIZE + B_SUB_VAL)
+		bzt->za[MAX_B_FRAMES].z1 -= B_FIFO_SIZE;
 	bzt->f1 = MAX_B_FRAMES;
 	bzt->f2 = bzt->f1;	/* init F pointers to remain constant */
 	if (fifo_state)



More information about the asterisk-users mailing list