Hi all,
A while ago I mentioned that the host-api specific extensions in
PortAudio aren't usable on Linux because applications will fail to link
against the extensions' symbols (they're not exported for some reason).
Specifically, I was interested in using the
PaAlsa_EnableRealtimeScheduling() extension to improve Mixxx's
performance with ALSA, which is noticeably worse than when using OSS
(higher latency needed with ALSA).
Rather than sort out the exporting-symbols-properly mess (it's beyond my
capacity at the moment), I'd like to propose just enabling realtime
scheduling by default in the StartStream implementation for ALSA.
Attached is a simple patch to do so.
Two questions to go along with the patch:
- Is there a good reason not to enable RT by default?
- I'm just assuming that this will fail gracefully/silently if RT
scheduling is not available. Can anyone confirm this?
Mixxx gets a significant performance boost (latency-wise) when using
ALSA through PortAudio with this patch. I'd appreciate any comments, if
anyone can spare the time.
Thank you,
Albert
Index: src/hostapi/alsa/pa_linux_alsa.c
===================================================================
--- src/hostapi/alsa/pa_linux_alsa.c (revision 1355)
+++ src/hostapi/alsa/pa_linux_alsa.c (working copy)
@@ -2126,6 +2126,9 @@
PaAlsaStream* stream = (PaAlsaStream*)s;
int streamStarted = 0; /* So we can know wether we need to take the stream down */
+ /* Attempt to enable realtime scheduling */
+ PaAlsa_EnableRealtimeScheduling(s, 1);
+
/* Ready the processor */
PaUtil_ResetBufferProcessor( &stream->bufferProcessor );
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel