mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-07-29 13:34:15 -04:00
Rebalance demodulator threads, tweak priorities
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user