Bug 59052 - display actual resource usage number in mouseover popup
Summary: display actual resource usage number in mouseover popup
Status: RESOLVED FIXED
Alias: None
Product: ksysguard
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 60540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-27 21:42 UTC by Nan Zou
Modified: 2010-05-12 12:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Zou 2003-05-27 21:42:50 UTC
Version:            (using KDE KDE 3.1.1)
Installed from:    Compiled From Sources
Compiler:          gcc 2.96 
OS:          Linux

Currently, placing the mouse over the various charts in the System Load view will pop up these messages:

localhost:cpu/nice
localhost:cpu/sys
localhost:cpu/user

It will be more useful to display the popup message that has the actual resource usage numbers in them, like this:

localhost:cpu/nice: 15
localhost:cpu/sys: 5
localhost:cpu/user: 40

same for the memory displays.
Comment 1 Greg Martyn 2006-05-25 19:55:32 UTC
"Digital" labels on the graphs would be something nice to add too, but I like your tooltip idea.
Comment 2 Greg Martyn 2006-05-25 20:20:09 UTC
From Frédéric Motte on bug 60540:
Color of data tracked will be another nice information to have. 
Comment 3 Greg Martyn 2006-05-25 20:23:40 UTC
*** Bug 60540 has been marked as a duplicate of this bug. ***
Comment 4 John Tapsell 2006-11-23 13:30:29 UTC
Greg,  I've added the color already to KDE4.

Showing the values..  the trouble is i can show the value but it won't update _while the tooltip is being shown_.  You can't modify the tooltip in real time.

Comment 5 Tiago Freire 2006-11-23 13:46:02 UTC
as for not updating in real time while the tooltip is being displayed... does it HAVE to be a tooltip? won't KDE 4 allow for more stuff and eye candy? Not just for beauty, but a better way to convey information.
Look at our pager. instead of a tooltip it does this baloon with icons and information about runnin programs on that desktop etc. I like to use a small kicker, but i'd like to see, when I hover my mouse over the ksysguard cpu meter, for instance (could be anything else), pops me a baloon not unlike the pager one (minus the animation maybe?), with a BIG version of the graph itself (say 64x64) and the textual information at the right, updated in real time.
Comment 6 John Tapsell 2006-12-04 00:09:28 UTC
Okay from revision 610259  it now shows the values in the tooltip.

Tiago, I really like your idea.  Could you file it as another wish please as it's separate.
Comment 7 Holger 2007-03-22 08:19:22 UTC
Situation: My fan goes off cause the CPU load shoots up to 100%
Reaction: First look at KSysGuard-Applet in the controllbar
Frustration: It does not show me the culprit

It just takes too long to open up the processtable, deactivate the treeview, sort for CPU-Usage, pic the process, activate the treeview again, sort alphabetically and sroll to monitor it.

Anyway, how do I sort for the total CPU usage and not the partial user usage?

KSysGuard itself becomes slow, because the other process is going wild. And second until you see it on the screen, the show is all over and the process gone or sleeping.

What I'd really love to have is a quick display of the top consumer and maybe offer some way to send it a KILL.

And if you really want to see me drooling: Add a history, so that I can hover my mouse over the graph and see the culprit, who caused that peek CPU-Usage.

In other words: Have a look at Process Explorer, that does a pretty good job in the M$ Windows world: http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx
Comment 8 Greg Martyn 2007-03-22 14:47:52 UTC
Holger, please file a separate bug report. Showing the 'culprit' a good idea, but it should be a separate wishlist item.

Re: Ksysguard's speed
The kde4 version is very fast. It should be able to respond under any load.

Re: Total CPU usage
The kde4 version shows total CPU usage by default now.
Comment 9 Holger 2007-03-22 17:30:17 UTC
@Greg

My request is now at Bug 143348

I wasn't complaining about KSysGuards normal speed. This is about the abnormal situation of another process eating up 99% CPU.

Looking forward for openSUSE to release an update to KDE4 :-)
Comment 10 Colin Guthrie 2010-05-12 12:47:33 UTC
commit fae4a67a16b9907708c940c1ea72ec1a0eaf7bb9
Author: Colin Guthrie <cguthrie@mandriva.org>
Date:   Wed May 12 10:03:59 2010 +0100

    pulse: Some signal emission protection and some debug tweaks.
    
    This commit ensures that the objectDescriptionChanged signal is only emitted
    when PA is active. If we try to connect, succeed, but the backend ultimately
    cannot support PA, we fail.
    
    At present the GST backend operates a 'hit and hope' policy
    with regards to the pulsesink. This needs to be tightened up.
    
    Also added is extra debug info when the support is enabled
    and a new debug method which is not called anywhere but can
    be useful when debugging code.
    
    CCBUG: 59052

diff --git a/phonon/pulsesupport.cpp b/phonon/pulsesupport.cpp
index e85abd5..769d7e1 100644
--- a/phonon/pulsesupport.cpp
+++ b/phonon/pulsesupport.cpp
@@ -666,6 +666,19 @@ void PulseSupport::shutdown()
     }
 }
 
+void PulseSupport::debug()
+{
+#ifdef HAVE_PULSEAUDIO
+    logMessage(QString("Have we been initialised yet? %1").arg(s_instance ? "Yes" : "No"));
+    if (s_instance) {
+        logMessage(QString("Connected to PulseAudio? %1").arg(s_pulseActive ? "Yes" : "No"));
+        logMessage(QString("PulseAudio support 'Active'? %1").arg(s_instance->isActive() ? "Yes" : "No"));
+    }
+#else
+    logMessage("PulseAudio support not available.");
+#endif
+}
+
 PulseSupport::PulseSupport()
  : QObject(), mEnabled(false)
 {
@@ -780,7 +793,6 @@ void PulseSupport::connectToDaemon()
 bool PulseSupport::isActive()
 {
 #ifdef HAVE_PULSEAUDIO
-    //logMessage(QString("Enabled Breakdown: mEnabled: %1, s_pulseActive %2").arg(mEnabled).arg(s_pulseActive));
     return mEnabled && s_pulseActive;
 #else
     return false;
@@ -790,6 +802,9 @@ bool PulseSupport::isActive()
 void PulseSupport::enable(bool enabled)
 {
     mEnabled = enabled;
+#ifdef HAVE_PULSEAUDIO
+    logMessage(QString("Enabled Breakdown: mEnabled: %1, s_pulseActive %2").arg(mEnabled ? "Yes" : "No" ).arg(s_pulseActive ? "Yes" : "No"));
+#endif
 }
 
 QList<int> PulseSupport::objectDescriptionIndexes(ObjectDescriptionType type) const
@@ -997,7 +1012,8 @@ PulseStream *PulseSupport::registerCaptureStream(QString streamUuid, Category ca
 
 void PulseSupport::emitObjectDescriptionChanged(ObjectDescriptionType type)
 {
-    emit objectDescriptionChanged(type);
+    if (mEnabled)
+        emit objectDescriptionChanged(type);
 }
 
 bool PulseSupport::setOutputName(QString streamUuid, QString name) {
diff --git a/phonon/pulsesupport.h b/phonon/pulsesupport.h
index dc08330..d78ac64 100644
--- a/phonon/pulsesupport.h
+++ b/phonon/pulsesupport.h
@@ -66,6 +66,7 @@ namespace Phonon
             //    or phonon supports capture properly... which ever comes first.
             void clearStreamCache(QString streamUuid);
 
+            static void debug();
         public slots:
             void connectToDaemon();
Comment 11 Colin Guthrie 2010-05-12 12:47:34 UTC
commit 70babff2d8f27828c5912a879538d04a756fc86c
Author: Colin Guthrie <cguthrie@mandriva.org>
Date:   Wed May 12 10:43:23 2010 +0100

    gstreamer: Rejig the PulseAudio detection and handling a little.
    
    Attempt to make the PulseAudio initialisation in GStreamer a bit more robust.
    Validate the initial sink usage if it comes from either env var or settings
    against the known status of PA (is it running or not) and only ever try a
    'pulsesink' if it is running, with 'auto' favouring 'pulsesink' when
    PA is running.
    
    When trying to open the device fails when PA is running we change back
    to 'auto' and try again. This handles the case when the GStreamer
    'pulsesink' is not available (which is hard as it's a -good plugin
    these days).
    
    CCBUG: 59052

diff --git a/gstreamer/devicemanager.cpp b/gstreamer/devicemanager.cpp
index c3826eb..6485094 100644
--- a/gstreamer/devicemanager.cpp
+++ b/gstreamer/devicemanager.cpp
@@ -82,13 +82,21 @@ DeviceManager::DeviceManager(Backend *backend)
 
     PulseSupport *pulse = PulseSupport::getInstance();
     m_audioSink = qgetenv("PHONON_GST_AUDIOSINK");
-    if (m_audioSink.isEmpty()) {
+    if (m_audioSink.isEmpty())
         m_audioSink = settings.value(QLatin1String("audiosink"), "Auto").toByteArray().toLower();
-        if (m_audioSink == "auto" && pulse->isActive())
-            m_audioSink = "pulsesink";
-    }
-    if ("pulsesink" != m_audioSink)
+
+    if ("pulsesink" == m_audioSink && !pulse->isActive()) {
+        // If pulsesink is specifically requested, but not active, then
+        // fall back to auto.
+        m_audioSink = "auto";
+    } else if (m_audioSink == "auto" && pulse->isActive()) {
+        // We favour specific PA support if it's active and we're in 'auto' mode
+        // (although it may still be disabled if the pipeline cannot be made)
+        m_audioSink = "pulsesink";
+    } else if (m_audioSink != "pulsesink") {
+        // Otherwise, PA should not be used.
         pulse->enable(false);
+    }
 
     m_videoSinkWidget = qgetenv("PHONON_GST_VIDEOMODE");
     if (m_videoSinkWidget.isEmpty()) {
@@ -234,9 +242,19 @@ GstElement *DeviceManager::createAudioSink(Category category)
             sink = gst_element_factory_make (m_audioSink, NULL);
             if (canOpenDevice(sink))
                 m_backend->logMessage(QString("AudioOutput using %0").arg(QString::fromUtf8(m_audioSink)));
-            else if (sink) {
-                gst_object_unref(sink);
-                sink = 0;
+            else {
+                if (sink) {
+                    gst_object_unref(sink);
+                    sink = 0;
+                }
+                if ("pulsesink" == m_audioSink) {
+                    // We've tried to use PulseAudio support, but the GST plugin
+                    // doesn't exits. Let's try again, but not use PA support this time.
+                    m_backend->logMessage("PulseAudio support failed. Falling back to 'auto'");
+                    PulseSupport::getInstance()->enable(false);
+                    m_audioSink = "auto";
+                    sink = createAudioSink();
+                }
             }
         }
     }
Comment 12 Colin Guthrie 2010-05-12 12:47:35 UTC
commit 67b424626866d1a4b2e80c3e93698456042889fc
Author: Colin Guthrie <cguthrie@mandriva.org>
Date:   Wed May 12 10:55:37 2010 +0100

    gstreamer: Move some code inside pointer protection.
    
    This can only happen if asserts are disabled, so this is somewhat
    unlikely, but it's better to be safe.
    
    This is unlikely to be related to the bug #59052, but in the event
    that PA is running but both 'pulsesink' and 'fakesink' cannot be
    created AND asserts are disabled, then this could cause some issues.
    
    CCBUG: 59052

diff --git a/gstreamer/devicemanager.cpp b/gstreamer/devicemanager.cpp
index 6485094..3b0d4c3 100644
--- a/gstreamer/devicemanager.cpp
+++ b/gstreamer/devicemanager.cpp
@@ -392,10 +392,10 @@ void DeviceManager::updateDeviceList()
                 }
             }
         }
-    }
 
-    gst_element_set_state (audioSink, GST_STATE_NULL);
-    gst_object_unref (audioSink);
+        gst_element_set_state (audioSink, GST_STATE_NULL);
+        gst_object_unref (audioSink);
+    }
 }
 
 /**
Comment 13 Colin Guthrie 2010-05-12 12:48:12 UTC
Dammit.

Totally incorrect bug reference. Sorry about that :(