Re: One way audio in LCR because of FLG_FILLEMPTY

Andreas Eversberg <[email protected]>
Newsgroups gmane.linux.isdn.i4l.user
Message-ID <[email protected]>
Bodo.Pfelzer-S0/[email protected] wrote:
> Hi,
>
> I still get no audio from LCR to ISDN with my HFC-PCI card.
>
> I think the crucial code is located in line 790 of hfcpci.c. If
> FLG_FILLEMPTY is set, no real data will ever be written to the card.
> dsp_function enables that flag when receiving PH_ACTIVATE.
>
> What is the contract of FLG_FILLEMPTY. Should it emit silence, if no
> data is available? Or should it emit silence forever, because that's
> what it actually does.
>
> When I deactivate the if clause in line 790 I get audio output as desired.
>
> Bodo
> _______________________________________________
> isdn4linux mailing list
> [email protected]
> https://www.isdn4linux.de/mailman/listinfo/isdn4linux
>   
hi bodo, hi kartsen,

FLG_FILLEMPTY should only emit silence, if there is no data available.
this is useful to maintain silence level after audio stream stops.

my attached patch fixes this issue, at least for hfcpci.c. after quickly
reviewing commit 2a81b2dc (FLG_FILLEMPTY support for card drivers), i
only see this issue for hfcpci.c.

best regards,

andreas

_______________________________________________
isdn4linux mailing list
[email protected]
https://www.isdn4linux.de/mailman/listinfo/isdn4linux
fillempty.patch (text/plain, 1.2 KB)
--- orig	2013-12-13 10:08:47.000000000 +0100
+++ drivers/isdn/hardware/mISDN/hfcpci.c	2013-12-13 10:04:51.000000000 +0100
@@ -752,10 +752,11 @@
 hfcpci_fill_fifo(struct bchannel *bch)
 {
 	struct hfc_pci	*hc = bch->hw;
 	int		maxlen, fcnt;
 	int		count, new_z1;
+	int		fillempty = 0;
 	struct bzfifo	*bz;
 	u_char		*bdata;
 	u_char		new_f1, *src, *dst;
 	__le16 *z1t, *z2t;
 
@@ -764,10 +765,11 @@
 	if ((!bch->tx_skb) || bch->tx_skb->len == 0) {
 		if (!test_bit(FLG_FILLEMPTY, &bch->Flags) &&
 		    !test_bit(FLG_TRANSPARENT, &bch->Flags))
 			return;
 		count = HFCPCI_FILLEMPTY;
+		fillempty = 1;
 	} else {
 		count = bch->tx_skb->len - bch->tx_idx;
 	}
 	if ((bch->nr & 2) && (!hc->hw.bswapped)) {
 		bz = &((union fifo_area *)(hc->hw.fifos))->b_chans.txbz_b2;
@@ -785,11 +787,11 @@
 			       "cnt(%d) z1(%x) z2(%x)\n", bch->nr, count,
 			       le16_to_cpu(*z1t), le16_to_cpu(*z2t));
 		fcnt = le16_to_cpu(*z2t) - le16_to_cpu(*z1t);
 		if (fcnt <= 0)
 			fcnt += B_FIFO_SIZE;
-		if (test_bit(FLG_FILLEMPTY, &bch->Flags)) {
+		if (fillempty) {
 			/* fcnt contains available bytes in fifo */
 			if (count > fcnt)
 				count = fcnt;
 			new_z1 = le16_to_cpu(*z1t) + count;
 			/* new buffer Position */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.