Rebalance demodulator threads, tweak priorities

This commit is contained in:
Charles J. Cliffe
2014-12-16 20:33:44 -05:00
parent 62c5ab38e5
commit 02cf2099a9
9 changed files with 87 additions and 30 deletions
+10 -2
View File
@@ -44,7 +44,14 @@ static int audioCallback(void *outputBuffer, void *inputBuffer, unsigned int nBu
}
void AudioThread::threadMain() {
std::cout << "Audio thread initializing.." << std::endl;
#ifdef __APPLE__
pthread_t tID = pthread_self(); // ID of this thread
int priority = sched_get_priority_min( SCHED_RR );
sched_param prio = { priority }; // scheduling priority of thread
pthread_setschedparam( tID, SCHED_RR, &prio );
#endif
std::cout << "Audio thread initializing.." << std::endl;
if (dac.getDeviceCount() < 1) {
std::cout << "No audio devices found!" << std::endl;
@@ -59,7 +66,8 @@ void AudioThread::threadMain() {
unsigned int bufferFrames = 256;
RtAudio::StreamOptions opts;
// opts.flags = RTAUDIO_SCHEDULE_REALTIME | RTAUDIO_MINIMIZE_LATENCY;
opts.flags = RTAUDIO_SCHEDULE_REALTIME;
// | RTAUDIO_MINIMIZE_LATENCY;
// opts.flags = RTAUDIO_MINIMIZE_LATENCY;
opts.streamName = "CubicSDR Audio Output";
// opts.priority = sched_get_priority_max(SCHED_FIFO);