mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-02 13:17:48 -04: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();
|
AppFrame *appframe = new AppFrame();
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
int main_policy;
|
int main_policy;
|
||||||
struct sched_param main_param;
|
struct sched_param main_param;
|
||||||
|
|
||||||
@ -54,6 +55,7 @@ bool CubicSDR::OnInit() {
|
|||||||
main_param.sched_priority = sched_get_priority_min(SCHED_OTHER);
|
main_param.sched_priority = sched_get_priority_min(SCHED_OTHER);
|
||||||
|
|
||||||
pthread_setschedparam(pthread_self(), main_policy, &main_param);
|
pthread_setschedparam(pthread_self(), main_policy, &main_param);
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,13 @@ void AudioThread::threadMain() {
|
|||||||
unsigned int sampleRate = AUDIO_FREQUENCY;
|
unsigned int sampleRate = AUDIO_FREQUENCY;
|
||||||
unsigned int bufferFrames = 256;
|
unsigned int bufferFrames = 256;
|
||||||
|
|
||||||
|
RtAudio::StreamOptions opts;
|
||||||
|
opts.flags = RTAUDIO_MINIMIZE_LATENCY | RTAUDIO_SCHEDULE_REALTIME;
|
||||||
|
opts.streamName = "CubicSDR Audio Output";
|
||||||
|
opts.priority = 0;
|
||||||
|
|
||||||
try {
|
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();
|
dac.startStream();
|
||||||
} catch (RtAudioError& e) {
|
} catch (RtAudioError& e) {
|
||||||
e.printMessage();
|
e.printMessage();
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
|
ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
|
||||||
PrimaryGLContext(canvas, sharedContext) {
|
PrimaryGLContext(canvas, sharedContext) {
|
||||||
glEnable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
SpectrumContext::SpectrumContext(SpectrumCanvas *canvas, wxGLContext *sharedContext) :
|
SpectrumContext::SpectrumContext(SpectrumCanvas *canvas, wxGLContext *sharedContext) :
|
||||||
PrimaryGLContext(canvas, sharedContext) {
|
PrimaryGLContext(canvas, sharedContext) {
|
||||||
glEnable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
WaterfallContext::WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext) :
|
WaterfallContext::WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext) :
|
||||||
PrimaryGLContext(canvas, sharedContext) {
|
PrimaryGLContext(canvas, sharedContext) {
|
||||||
glEnable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user