[Home]

Summary:ASTERISK-13144: Small delay when using nocallsetup=no
Reporter:Marc Beekman (beekman)Labels:
Date Opened:2008-11-30 08:29:08.000-0600Date Closed:2011-06-07 14:08:08
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Addons/chan_mobile
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I use chan_mobile for incomming and outbound calls. This works well but i think there is a problem with the audio buffer. Some examples:

Inbound call (from cellphone):
Audio from cellphone to asterisk is delayed (with 1 second and after a while this will be bigger and bigger)
Audio from asterisk to the cellphone is NOT delayed

Outbound call (to the cellphone) with nocallsetup=no
Audio from cellphone to asterisk is delayed (with 1 second and after a while this will be bigger and bigger)
Audio from asterisk to the cellphone is NOT delayed

Outbound call (to the cellphone) with nocallsetup=yes
Audio from cellphone to asterisk is NOT delayed
Audio from asterisk to the cellphone is NOT delayed
But after a while (2 minutes) the audio delayed too. And the delay is bigger and bigger if you make a long call.

I use:
- Asterisk SVN-trunk-r159475
- CSR BC4
- 2.6.27-7 ubuntu kernel
- bluez 4.19 (tar.gz version)
- L6 motorola phones


I think there is a problem with the buffer. I make the Frame size smaller but this doesn't work. I think he can't loose the buffer and the frame size is bigger and bigger or something.

****** ADDITIONAL INFORMATION ******

Maybe we can resolve this problem to modify the next code:


static struct ast_frame *mbl_read(struct ast_channel *ast)
{

       struct mbl_pvt *pvt = ast->tech_pvt;
       struct ast_frame *f;
       int r;

       ast_debug(2, "*** mbl_read()\n");

       if (!pvt->owner) {
               return &ast_null_frame;
       }
       memset(&pvt->fr, 0x00, sizeof(struct ast_frame));
       pvt->fr.frametype = AST_FRAME_VOICE;
       pvt->fr.subclass = DEVICE_FRAME_FORMAT;
       pvt->fr.datalen = CHANNEL_FRAME_SIZE;
       pvt->fr.samples = CHANNEL_FRAME_SIZE / 2;
       pvt->fr.src = "Mobile";
       pvt->fr.offset = AST_FRIENDLY_OFFSET;
       pvt->fr.mallocd = 0;
       pvt->fr.delivery.tv_sec = 0;
       pvt->fr.delivery.tv_usec = 0;
       pvt->fr.data.ptr = pvt->io_buf + AST_FRIENDLY_OFFSET;

       if ((r = read(pvt->io_pipe[0], pvt->fr.data.ptr, CHANNEL_FRAME_SIZE)) != CHANNEL_FRAME_SIZE) {
               if (r == -1) {
                       ast_log(LOG_ERROR, "read error %d\n", errno);
                       return &ast_null_frame;
               } else {
                       pvt->fr.datalen = r;
                       pvt->fr.samples = r / 2;
               }
       }

       f = ast_dsp_process(0, pvt->dsp, &pvt->fr);
       if (f && (f->frametype == AST_FRAME_DTMF_END)) {
               pvt->fr.frametype = AST_FRAME_DTMF_END;
               pvt->fr.subclass = f->subclass;
       }

       return &pvt->fr;

}
Comments:By: Matthew Nicholson (mnicholson) 2009-02-23 11:18:03.000-0600

Please try the patch from issue 12567.