mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-04 16:31:15 -05:00
RtAudio tweaks, disable unused GL states
This commit is contained in:
parent
24b3b81f34
commit
051c4f081f
@ -47,6 +47,7 @@ bool CubicSDR::OnInit() {
|
||||
|
||||
AppFrame *appframe = new AppFrame();
|
||||
|
||||
#ifdef __APPLE__
|
||||
int main_policy;
|
||||
struct sched_param main_param;
|
||||
|
||||
@ -54,6 +55,7 @@ bool CubicSDR::OnInit() {
|
||||
main_param.sched_priority = sched_get_priority_min(SCHED_OTHER);
|
||||
|
||||
pthread_setschedparam(pthread_self(), main_policy, &main_param);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -59,8 +59,13 @@ void AudioThread::threadMain() {
|
||||
unsigned int sampleRate = AUDIO_FREQUENCY;
|
||||
unsigned int bufferFrames = 256;
|
||||
|
||||
RtAudio::StreamOptions opts;
|
||||
opts.flags = RTAUDIO_MINIMIZE_LATENCY | RTAUDIO_SCHEDULE_REALTIME;
|
||||
opts.streamName = "CubicSDR Audio Output";
|
||||
opts.priority = 0;
|
||||
|
||||
try {
|
||||
dac.openStream(¶meters, NULL, RTAUDIO_FLOAT32, sampleRate, &bufferFrames, &audioCallback, (void *) this);
|
||||
dac.openStream(¶meters, NULL, RTAUDIO_FLOAT32, sampleRate, &bufferFrames, &audioCallback, (void *) this, &opts);
|
||||
dac.startStream();
|
||||
} catch (RtAudioError& e) {
|
||||
e.printMessage();
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
SpectrumContext::SpectrumContext(SpectrumCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
WaterfallContext::WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
Loading…
Reference in New Issue
Block a user