Changeset 4490 for pjproject/trunk/pjmedia/src/pjmedia-audiodev/bb10_dev.c
- Timestamp:
- Apr 23, 2013 7:56:12 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/bb10_dev.c
r4480 r4490 438 438 pj_timestamp tstamp; 439 439 int result = 0; 440 int policy; 441 struct sched_param param; 442 443 TRACE_((THIS_FILE, "pb_thread_func: size = %d ", size)); 444 445 pthread_getschedparam(pthread_self(), &policy, ¶m); 446 param.sched_priority = 18; 447 pthread_setschedparam (pthread_self(), policy, ¶m); 440 448 441 449 pj_bzero (buf, size); 442 450 tstamp.u64 = 0; 443 444 TRACE_((THIS_FILE, "pb_thread_func: size = %d ", size));445 451 446 452 /* Do the final initialization now the thread has started. */ … … 527 533 pj_timestamp tstamp; 528 534 int result; 535 int policy; 529 536 struct sched_param param; 530 pthread_t *thid;531 537 532 538 TRACE_((THIS_FILE, "ca_thread_func: size = %d ", size)); 533 539 534 thid = (pthread_t*) pj_thread_get_os_handle (pj_thread_this()); 535 param.sched_priority = sched_get_priority_max (SCHED_RR); 536 537 result = pthread_setschedparam (*thid, SCHED_RR, ¶m); 538 if (result) { 539 if (result == EPERM) { 540 PJ_LOG (4,(THIS_FILE, "Unable to increase thread priority, " 541 "root access needed.")); 542 } else { 543 PJ_LOG (4,(THIS_FILE, "Unable to increase thread priority, " 544 "error: %d", result)); 545 } 546 } 540 pthread_getschedparam(pthread_self(), &policy, ¶m); 541 param.sched_priority = 18; 542 pthread_setschedparam (pthread_self(), policy, ¶m); 547 543 548 544 pj_bzero (buf, size); … … 561 557 pjmedia_frame frame; 562 558 563 pj_bzero (buf, size);559 //pj_bzero (buf, size); 564 560 565 561 /* read the input device */ … … 752 748 pp.mode = SND_PCM_MODE_BLOCK; 753 749 pp.channel = SND_PCM_CHANNEL_PLAYBACK; 754 pp.start_mode = SND_PCM_START_ DATA;750 pp.start_mode = SND_PCM_START_FULL; 755 751 pp.stop_mode = SND_PCM_STOP_ROLLOVER; 756 752 pp.buf.block.frag_size = param->samples_per_frame * param->bits_per_sample / 8; 757 /* RIM recommends maximum of 3*/758 pp.buf.block.frags_max = 3;753 /* RIM recommends maximum of 5 */ 754 pp.buf.block.frags_max = 5; 759 755 pp.buf.block.frags_min = 1; 760 756 pp.format.interleave = 1; … … 861 857 pp.mode = SND_PCM_MODE_BLOCK; 862 858 pp.channel = SND_PCM_CHANNEL_CAPTURE; 863 pp.start_mode = SND_PCM_START_ DATA;859 pp.start_mode = SND_PCM_START_FULL; 864 860 /* Auto-recover from errors */ 865 861 pp.stop_mode = SND_PCM_STOP_ROLLOVER; 866 862 pp.buf.block.frag_size = param->samples_per_frame * param->bits_per_sample / 8; 867 863 /* From January 2013 gold OS release. RIM recommend these for capture */ 868 pp.buf.block.frags_max = 1;864 pp.buf.block.frags_max = -1; 869 865 pp.buf.block.frags_min = 1; 870 866 pp.format.interleave = 1;
Note: See TracChangeset
for help on using the changeset viewer.