diff options
author | Andreas Eversberg <andreas@eversberg.eu> | 2008-08-02 16:51:52 -0400 |
---|---|---|
committer | Karsten Keil <kkeil@suse.de> | 2009-01-09 16:44:22 -0500 |
commit | 8dd2f36f317569665e454268a2677cfba3e848f1 (patch) | |
tree | 62f0d30aa090594648ed21cb9a863e4cc2b4f4fd /drivers/isdn/mISDN/dsp_core.c | |
parent | 69e656cc16511719a89d83373c48172d3f39bc5f (diff) |
mISDN: Add feature via MISDN_CTRL_FILL_EMPTY to fill fifo if empty
This prevents underrun of fifo when filled and in case of an underrun it
prevents subsequent underruns due to jitter.
Improve dsp, so buffers are kept filled with a certain delay, so moderate
jitter will not cause underrun all the time -> the audio quality is highly
improved. tones are not interrupted by gaps anymore, except when CPU is
stalling or in high load.
Signed-off-by: Andreas Eversberg <andreas@eversberg.eu>
Signed-off-by: Karsten Keil <kkeil@suse.de>
Diffstat (limited to 'drivers/isdn/mISDN/dsp_core.c')
-rw-r--r-- | drivers/isdn/mISDN/dsp_core.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c index 1dc21d803410..1d504ba954f5 100644 --- a/drivers/isdn/mISDN/dsp_core.c +++ b/drivers/isdn/mISDN/dsp_core.c | |||
@@ -191,6 +191,8 @@ dsp_rx_off_member(struct dsp *dsp) | |||
191 | struct mISDN_ctrl_req cq; | 191 | struct mISDN_ctrl_req cq; |
192 | int rx_off = 1; | 192 | int rx_off = 1; |
193 | 193 | ||
194 | memset(&cq, 0, sizeof(cq)); | ||
195 | |||
194 | if (!dsp->features_rx_off) | 196 | if (!dsp->features_rx_off) |
195 | return; | 197 | return; |
196 | 198 | ||
@@ -249,6 +251,32 @@ dsp_rx_off(struct dsp *dsp) | |||
249 | } | 251 | } |
250 | } | 252 | } |
251 | 253 | ||
254 | /* enable "fill empty" feature */ | ||
255 | static void | ||
256 | dsp_fill_empty(struct dsp *dsp) | ||
257 | { | ||
258 | struct mISDN_ctrl_req cq; | ||
259 | |||
260 | memset(&cq, 0, sizeof(cq)); | ||
261 | |||
262 | if (!dsp->ch.peer) { | ||
263 | if (dsp_debug & DEBUG_DSP_CORE) | ||
264 | printk(KERN_DEBUG "%s: no peer, no fill_empty\n", | ||
265 | __func__); | ||
266 | return; | ||
267 | } | ||
268 | cq.op = MISDN_CTRL_FILL_EMPTY; | ||
269 | cq.p1 = 1; | ||
270 | if (dsp->ch.peer->ctrl(dsp->ch.peer, CONTROL_CHANNEL, &cq)) { | ||
271 | printk(KERN_DEBUG "%s: CONTROL_CHANNEL failed\n", | ||
272 | __func__); | ||
273 | return; | ||
274 | } | ||
275 | if (dsp_debug & DEBUG_DSP_CORE) | ||
276 | printk(KERN_DEBUG "%s: %s set fill_empty = 1\n", | ||
277 | __func__, dsp->name); | ||
278 | } | ||
279 | |||
252 | static int | 280 | static int |
253 | dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) | 281 | dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb) |
254 | { | 282 | { |
@@ -593,8 +621,6 @@ get_features(struct mISDNchannel *ch) | |||
593 | struct dsp *dsp = container_of(ch, struct dsp, ch); | 621 | struct dsp *dsp = container_of(ch, struct dsp, ch); |
594 | struct mISDN_ctrl_req cq; | 622 | struct mISDN_ctrl_req cq; |
595 | 623 | ||
596 | if (dsp_options & DSP_OPT_NOHARDWARE) | ||
597 | return; | ||
598 | if (!ch->peer) { | 624 | if (!ch->peer) { |
599 | if (dsp_debug & DEBUG_DSP_CORE) | 625 | if (dsp_debug & DEBUG_DSP_CORE) |
600 | printk(KERN_DEBUG "%s: no peer, no features\n", | 626 | printk(KERN_DEBUG "%s: no peer, no features\n", |
@@ -610,6 +636,10 @@ get_features(struct mISDNchannel *ch) | |||
610 | } | 636 | } |
611 | if (cq.op & MISDN_CTRL_RX_OFF) | 637 | if (cq.op & MISDN_CTRL_RX_OFF) |
612 | dsp->features_rx_off = 1; | 638 | dsp->features_rx_off = 1; |
639 | if (cq.op & MISDN_CTRL_FILL_EMPTY) | ||
640 | dsp->features_fill_empty = 1; | ||
641 | if (dsp_options & DSP_OPT_NOHARDWARE) | ||
642 | return; | ||
613 | if ((cq.op & MISDN_CTRL_HW_FEATURES_OP)) { | 643 | if ((cq.op & MISDN_CTRL_HW_FEATURES_OP)) { |
614 | cq.op = MISDN_CTRL_HW_FEATURES; | 644 | cq.op = MISDN_CTRL_HW_FEATURES; |
615 | *((u_long *)&cq.p1) = (u_long)&dsp->features; | 645 | *((u_long *)&cq.p1) = (u_long)&dsp->features; |
@@ -865,6 +895,9 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb) | |||
865 | if (dsp->dtmf.hardware || dsp->dtmf.software) | 895 | if (dsp->dtmf.hardware || dsp->dtmf.software) |
866 | dsp_dtmf_goertzel_init(dsp); | 896 | dsp_dtmf_goertzel_init(dsp); |
867 | get_features(ch); | 897 | get_features(ch); |
898 | /* enable fill_empty feature */ | ||
899 | if (dsp->features_fill_empty) | ||
900 | dsp_fill_empty(dsp); | ||
868 | /* send ph_activate */ | 901 | /* send ph_activate */ |
869 | hh->prim = PH_ACTIVATE_REQ; | 902 | hh->prim = PH_ACTIVATE_REQ; |
870 | if (ch->peer) | 903 | if (ch->peer) |