From f63d8dbf38352b9ca0f1dc5e8eab87242c81b3ee Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 29 Nov 2009 23:02:21 -0800 Subject: Enable real-time priority for ALSA, OSS, and DirectSound mixing loops --- Alc/alsa.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'Alc/alsa.c') diff --git a/Alc/alsa.c b/Alc/alsa.c index 76f12fdb..cfe80640 100644 --- a/Alc/alsa.c +++ b/Alc/alsa.c @@ -271,6 +271,8 @@ static ALuint ALSAProc(ALvoid *ptr) char *WritePtr; int err; + EnableRTPrio(); + while(!data->killNow) { int state = verify_state(data->pcmHandle); @@ -343,6 +345,8 @@ static ALuint ALSANoMMapProc(ALvoid *ptr) snd_pcm_sframes_t avail; char *WritePtr; + EnableRTPrio(); + while(!data->killNow) { int state = verify_state(data->pcmHandle); @@ -396,6 +400,8 @@ static ALuint ALSANoMMapCaptureProc(ALvoid *ptr) alsa_data *data = (alsa_data*)pDevice->ExtraData; snd_pcm_sframes_t avail; + EnableRTPrio(); + while(!data->killNow) { int state = verify_state(data->pcmHandle); @@ -669,6 +675,9 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) AL_PRINT("buffer malloc failed\n"); return ALC_FALSE; } + device->UpdateSize = periodSizeInFrames; + device->NumUpdates = periods; + device->Frequency = rate; data->thread = StartThread(ALSANoMMapProc, device); } else @@ -679,6 +688,9 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) AL_PRINT("prepare error: %s\n", psnd_strerror(i)); return ALC_FALSE; } + device->UpdateSize = periodSizeInFrames; + device->NumUpdates = periods; + device->Frequency = rate; data->thread = StartThread(ALSAProc, device); } if(data->thread == NULL) @@ -689,10 +701,6 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) return ALC_FALSE; } - device->UpdateSize = periodSizeInFrames; - device->NumUpdates = periods; - device->Frequency = rate; - return ALC_TRUE; } -- cgit v1.2.3