[X2Go-Commits] [x2goclient] 03/08: Windows: On XP & Server 2003 (R2), prevent high PulseAudio CPU usage by lowering its CPU priority to "normal" (Fixes #526)

git-admin at x2go.org git-admin at x2go.org
Thu Jul 10 01:10:55 CEST 2014


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch release/4.0.2.x
in repository x2goclient.

commit 0858f328936b3b3ab1a069a041f5de75f238e009
Author: Mike DePaulo <mikedep333 at gmail.com>
Date:   Tue Jul 1 20:10:31 2014 -0400

    Windows: On XP & Server 2003 (R2), prevent high PulseAudio CPU usage by lowering its CPU priority to "normal" (Fixes #526)
---
 debian/changelog |    3 +++
 onmainwindow.cpp |   18 ++++++++++++++++++
 onmainwindow.h   |    1 +
 3 files changed, 22 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 18cb7d1..fe3cbd4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -39,6 +39,9 @@ x2goclient (4.0.2.1-0x2go1) UNRELEASED; urgency=low
 
   [ Mike DePaulo ]
   * New upstream release (4.0.2.1):
+    - Windows: Prevent high PulseAudio CPU usage on Windows XP by lowering
+      PulseAudio's CPU priority from "high" to "normal" on XP specifically.
+      Also do so on Windows Server 2003 (R2) (Fixes #526)
     - Windows: Enable PulseAudio log when --debug is passed.
     - Windows: Fix compatibility with current PulseAudio master branch
     - Windows: Reduce size of NSIS installer by switching to lzma solid compression
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index f09d80d..96914c0 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -9788,6 +9788,24 @@ void ONMainWindow::startPulsed()
     pulseArgs<<"--exit-idle-time=-1"<<"-n"<<"-F"<<pulseDir+"\\config.pa";
     if (debugging)
         pulseArgs<<"--log-level=debug"<<"--verbose"<<"--log-target=file:"+pulseDir+"\\pulse.log";
+    /*
+    Fix for x2goclient bug #526.
+    Works Around PulseAudio bug #80772.
+    Tested with PulseAudio 5.0.
+    This argument will not cause PulseAudio 0.9.6 or 1.1 (the legacy versions)
+    to fail to launch.
+    However, 0.9.6 defaults to normal priority anyway,
+    and 1.1 ignores it for some reason.
+    So yes, the fact that 1.1 ignores it would be a bug in x2goclient if we
+    ever ship 1.1 again.
+    */
+    if (QSysInfo::WindowsVersion == QSysInfo::WV_XP ||
+        QSysInfo::WindowsVersion == QSysInfo::WV_2003 )
+    {
+        x2goDebug<<"Windows XP or Server 2003 (R2) detected.";
+        x2goDebug<<"Setting PulseAudio to \"Normal\" CPU priority.";
+            pulseArgs<<"--high-priority=no";
+    }
 #else
     pulseArgs<<"--exit-idle-time=-1"<<"-n"<<"-F"<<pulseDir+"/config.pa";
 #endif
diff --git a/onmainwindow.h b/onmainwindow.h
index 1764993..6227c18 100644
--- a/onmainwindow.h
+++ b/onmainwindow.h
@@ -47,6 +47,7 @@
 
 #ifdef Q_OS_WIN
 #include <windows.h>
+#include <QSysInfo>
 #endif
 /**
 @author Oleksandr Shneyder

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list