pjsua stuck at shutdown - arm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Folks,

I have compiled pjproject-2.4 for arm host (Freescale i.MX53). But when i tried to run pjsua on arm i have encountered below listed issues.

1. While trying to shutdown pjsua by passing "q", it hanged up at "Shutting down presence" message and cpu utilisation went up to %99. I was able to track this down to busy_sleep function called from pjsua_destroy2 function in pjsua_core.c. And after adding some logging codes it turned out that pjsua is never returning from do loop shown below and the issue is resolved after adding pj_time_val_normalize(&now) after pj_gettickcount(&now);

static void busy_sleep(unsigned msec)
{
    pj_time_val timeout, now;

    pj_gettickcount(&timeout);
    timeout.msec += msec;
    pj_time_val_normalize(&timeout);

-->    do {
                int i;
                i = msec / 10;
                while (pjsua_handle_events(10) > 0 && i > 0)
                    --i;
                pj_gettickcount(&now);
//            pj_time_val_normalize(&now);
    } while (PJ_TIME_VAL_LT(now, timeout));
}

2. Second issue is if one tries to make a call and presses q to cancel or calls a nonexistant endpoint cpu utilisation goes up to %99 percent. Same also happens if you let pjsua idle for like 20 minutes or so. And again, after adding some logging codes and strace i traced this to pj_timer_heap_poll function in timer.c. The issue is resolved after adding pj_time_val_normalize(&now) after pj_gettickcount(&now) again.

PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht,
                                     pj_time_val *next_delay )
{
    pj_time_val now;
    unsigned count;

    PJ_ASSERT_RETURN(ht, 0);

    lock_timer_heap(ht);
    if (!ht->cur_size && next_delay) {
                next_delay->sec = next_delay->msec = PJ_MAXINT32;
        unlock_timer_heap(ht);
                return 0;
    }

    count = 0;
-->    pj_gettickcount(&now);
// pj_time_val_normalize(&now);
    while ( ht->cur_size &&
                    PJ_TIME_VAL_LTE(ht->heap[0]->_timer_value, now) &&
            count < ht->max_entries_per_poll )
    {
                pj_timer_entry *node = remove_node(ht, 0);
                pj_grp_lock_t *grp_lock;
...

So, what i am asking is if this is the right approach to solve these issues or did i do something wrong at compile time? Configuration is below for reference;

./configure --host=arm-linux-angstrom-gnueabi --disable-video --disable-speex-codec --disable-speex-aec --disable-g722-codec --disable-g7221-codec --disable-ilbc-codec \
--disable-gsm-codec --disable-silk --disable-l16-codec --disable-large-filter CFLAGS="-O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize" && make dep && make

Config_site.h was empty.
Kernel on arm is 3.12.13

Thank you.

Regards,


Ahmet ?a?r? K?r???k

GATE ELEKTRONIK A.S.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20150515/ee6799b8/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux