Hi Joao, Please see inline comments.. 2008/8/22 Jo?o C?sar <jpcesar at gmail.com>: > Hi Nanang, > > these are the last values before the assertion fails: > > 256 <= 320 > 160 <= 160 > 352 <= 320 Those values (256 & 352) seems odd, what is the value of 'memory_port'->info.samples_per_frame? And also conference bridge's samples_per_frame value? Could you send along the result of 'cl' command in pjsua prompt? > > Assertion failed: cport->rx_buf_count <= cport->rx_buf_cap, file > e:\development\ > jcesar\pjproject-0.9.0\pjmedia\src\pjmedia\conference.c, line 1404 > >> Which codec and which clock rates are you using for >> the sound device/conference and conference ports used such as file >>ports if any. And, sometime reclean the whole project may resolve a >> problem occured after changing library. > > we are working with the no sound device option since we only use PJSIP to > deliver the packets to a third party application via SIP. we receive audio > packets from a socket, if we dont have a call for that client we make the > call, else we just feed the memory port with more samples. > > we are making the call like this: > > sampleRate = 8000; > channels = 1; > number_frames = 960; > channel_count = 1; > > // create a media port to generate samples. > status = create_memory_port( pool, sampleRate, 512, number_frames, > channel_count, &callData[sessionId].memory_port_phone_out); > What is 512 stand for here? > // add port to conference > status = pjsua_conf_add_port(pool, > callData[sessionId].memory_port_phone_out, &callData[sessionId].port_id); > if (status != PJ_SUCCESS) error_exit("Error adding memory port", status); > > status = pjsua_call_make_call(acc_id,uri, 0, &callData[sessionId].port_id, > NULL,NULL); > if (status != PJ_SUCCESS) error_exit("Error making call", status); > > // assign the callid to the current call in callData > callData[sessionId].call_id = callId; > > // increment callId for next call > callId++; > > //creates the sound port > status = pjmedia_snd_port_create_player(pjsua_var.pool, > 0, > > 8000, > > pjsua_var.mconf_cfg.channel_count, > > pjsua_var.mconf_cfg.samples_per_frame, > > pjsua_var.mconf_cfg.bits_per_sample, > 0, > &sound_port); > > status = pjmedia_snd_port_connect(sound_port, > pjmedia_conf_get_master_port(pjsua_var.mconf)); > > > Each time we receive an audio packet we put that frame into memory_port: > > // put frame > memory_put_frame(callData[sessionId].memory_port_phone_out, &pjframe ); > > > and these are the options on the create memory port function: > > > /* Fill in port info. */ > port->info.bits_per_sample = 16; > port->info.channel_count = channel_count; > port->info.encoding_name = pj_str("pcm"); > port->info.has_info = 1; > port->info.name = pj_str("memory playback"); > port->info.need_info = 0; > port->info.pt = 0xFF; > port->info.clock_rate = sampling_rate; > port->info.samples_per_frame = frame_size / 2 / channel_count ; > port->info.bytes_per_frame = frame_size; > port->info.type = PJMEDIA_TYPE_AUDIO; > Couldn't find any suspect from the snippet code since it shows mostly variables without knowing the 'important' values. Actually I am interested to know what the value of memory port->info.samples_per_frame and conference's samples_per_frame. > > This was working fine on 0.8. > Conf port's buffer size (rx_buf_cap) calculation has been updated in 0.9 due to multichannel/stereo support in conference (and also IIRC it seems rx_buf_cap in 0.8 is a bit over calculated, perhaps that's why it was working fine on 0.8, miscalculation was tolerated). Regards, nanang