Kmix causes my computer cpu to use 100% mainly in core 0, but both cores get affected.

Bug #720882 reported by JC on 2011-02-17
60
This bug affects 9 people
Affects Status Importance Assigned to Milestone
kdemultimedia (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: kdemultimedia

Core 0 is usually the first to get affected, but both cores usually reach 100% use.
With kmix on, the cores fluctuate but are mostly at the 100% plateau. When I kill the kmix process, the percentages go back to their normal < 10% range. At times, the volume control doesn't even work at all and my hotkeys have no effect.
Kubuntu 10.10 amd64 kde 4.6

JC (nothingness) wrote :

I believe after using virtualbox ose 4 the kmix goes from ~25,000K to ~92,000K

JC (nothingness) wrote :

It's definitely Virtualbox. When I run a vm, the kmix volume applet cannot load and takes A LOT of resources. It will then either crash kwin or it will delay log out/shutdown.

JC (nothingness) wrote :

When viewing flash videos in opera browser, the kmix problem starts up and opera cannot pause the videos.

JC (nothingness) wrote :

It is definitely adobe flash that crashes the sound. The menu can't even load after viewing a flash video (fullscreen and normal).
I use adobe flash squared preview 3.

JC (nothingness) wrote :

I went to ~.kde/share/apps/kmix and renamed profiles to profiles1. Now I have no problems. It must be a pulseaudio problem!

Jarod82 (jarod1982) wrote :

Every time I boot my system kmix is fine, but as I go to youtube or similar i can't anymore change/mute volume with media keys, and kmix goes in 100% cpu frenzy (forcing me to kill it). I launch it back, it's fine. Youtube, he goes mad. Kill. Repeat at will.

I did the same as JC, and back to normal, I can now use youtube and have a usable kmix, media keys working, blue skyes and birds singing. I don't exactly know what I did and if it can be harmful though. Please fix this issue!

I'm on a Dell Mini 1012, with Maverick and KDE 4.6.1 from the backports ppa.

billy shears (billy-shears) wrote :

same here on natty, it happens when my computer starts playing any sound.
I think this problem is related to pulseaudio too, in one session pulseaudio didn't start due to a failed update and this bug disappeared

Dave Gilbert (ubuntu-treblig) wrote :
Download full text (11.5 KiB)

I also seem to share the same problem; here is a pair of backtraces of a gdb attach to kmix; it seems to be stuck in ViewBase::setMixSet

#0 __memcpy_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:1517
#1 0x00007f960927082c in QString::realloc (this=0x7ffff0265b30, alloc=524272) at /usr/include/bits/string3.h:52
#2 0x00007f9609270d4f in QString::append (this=0x7ffff0265b30, str=...) at tools/qstring.cpp:1534
#3 0x00007f960925eb9d in operator+= (this=0x7ffff0265c90, b=...) at ../../include/QtCore/../../src/corelib/tools/qstring.h:281
#4 operator QString (this=0x7ffff0265c90, b=...) at ../../include/QtCore/../../src/corelib/tools/qstringbuilder.h:130
#5 QRegExpEngine::Box::cat (this=0x7ffff0265c90, b=...) at tools/qregexp.cpp:2535
#6 0x00007f9609260812 in QRegExpEngine::parseTerm (this=0x67bec70, box=0x7ffff0265c90) at tools/qregexp.cpp:3624
#7 0x00007f96092609e1 in QRegExpEngine::parseExpression (this=0x67bec70, box=0x7ffff0265c90) at tools/qregexp.cpp:3630
#8 0x00007f960925edad in QRegExpEngine::parse (this=0x67bec70, pattern=<value optimised out>, len=<value optimised out>)
    at tools/qregexp.cpp:3376
#9 0x00007f9609260cda in QRegExpEngine::QRegExpEngine (this=<value optimised out>, key=...) at tools/qregexp.cpp:1348
#10 0x00007f9609262869 in prepareEngine_helper (priv=0x68d6fc0) at tools/qregexp.cpp:3711
#11 0x00007f9609262a25 in prepareEngine (priv=0x68d6fc0, str=...) at tools/qregexp.cpp:3721
#12 prepareEngineForMatch (priv=0x68d6fc0, str=...) at tools/qregexp.cpp:3726
#13 0x00007f9609262b4b in QRegExp::indexIn (this=0x7ffff0265f90, str=..., offset=0, caretMode=QRegExp::CaretAtZero)
    at tools/qregexp.cpp:4110
#14 0x00007f960c817e37 in contains (this=0x20d0760) at /usr/include/qt4/QtCore/qstring.h:218
#15 ViewSliders::_setMixSet (this=0x20d0760) at ../../kmix/gui/viewsliders.cpp:184
#16 0x00007f960c8160d5 in ViewBase::setMixSet (this=0x20d0760) at ../../kmix/gui/viewbase.cpp:272
#17 0x00007f960c816317 in ViewBase::controlsReconfigured (this=0x20d0760, mixer_ID=...) at ../../kmix/gui/viewbase.cpp:203
#18 0x00007f960c814936 in ViewBase::qt_metacall (this=0x20d0760, _c=QMetaObject::InvokeMetaMethod, _id=<value optimised out>,
    _a=0x7ffff0266280) at ./viewbase.moc:89
#19 0x00007f960c8177b8 in ViewSliders::qt_metacall (this=0x20d0760, _c=QMetaObject::InvokeMetaMethod, _id=<value optimised out>,
    _a=<value optimised out>) at ./viewsliders.moc:67

#20 0x00007f96093255e8 in QMetaObject::activate (sender=0x15e5900, m=<value optimised out>, local_signal_index=<value optimised out>,
    argv=0x7ffff0266280) at kernel/qobject.cpp:3287
#21 0x00007f960c834745 in Mixer::controlsReconfigured (this=<value optimised out>, _t1=<value optimised out>) at ./mixer.moc:118
#22 0x00007f960c8347b1 in controlsReconfiguredForwarder (this=0x15e5900, _c=QMetaObject::InvokeMetaMethod, _id=<value optimised out>,
    _a=0x7ffff0266380) at ../../kmix/core/mixer.cpp:229
#23 Mixer::qt_metacall (this=0x15e5900, _c=QMetaObject::InvokeMetaMethod, _id=<value optimised out>, _a=0x7ffff0266380) at ./mixer.moc:93
#24 0x00007f96093255e8 in QMetaObject::activate (sender=0x15e6630, m=<value optimised out>, local_signal_index=<value optimised...

Changed in kdemultimedia (Ubuntu):
status: New → Confirmed
billy shears (billy-shears) wrote :

After some debugging I've found that it gets stuck in ViewSliders::_setMixSet() at line 184, here's the block of code:
   foreach ( ProfControl* control, _guiprof->getControls() )
    {
        //ProfControl* control = *it;
        // The TabName of the control matches this View name (!! attention: Better use some ID, due to i18n() )
        bool isUsed = false;

        QRegExp idRegexp(control->id);
        //bool isExactRegexp = control->id.startsWith('^') && control->id.endsWith('$'); // for optimizing
        //isExactRegexp &= ( ! control->id.contains(".*") ); // For now. Might be removed in the future, as it cannot be done properly !!!
        //kDebug(67100) << "ViewSliders::setMixSet(): Check GUIProfile id==" << control->id << "\n";
        // The following for-loop could be simplified by using a std::find_if
        for ( int i=0; i<mixset.count(); i++ ) {
            MixDevice *md = mixset[i];
            if ( md->id().contains(idRegexp) )

the problem is that control->id is an absurd string (^stream:�\203\302\203�\202\302\203�\203\302\202�\202\302\203�\203\302\203�\202\302\202�\203\302\202 and so on, it's extremely long, the debugger didn't even display the whole string).
I didn't try to find when kmix creates the control with the wrong id.

Dave Gilbert (ubuntu-treblig) wrote :

Hi Billy,
  Well for me it looks like this corresponds to what JC was saying about a corrupt profile - in my ~/.kde/share/apps/kmix/profiles I found PulseAudio.Playback_Streams.1.default.xml was over 100MB:

control id="^stream:m$" subcontrols="*" show="simple" />
<control id="^stream:ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ

and then the stream name goes on for ages.

If I remove all kmix config in .kde/share/apps/kmix and .kde/share/config and restart kmix it works.

The question of course is whether we'll get the vast config file coming back and wth created it.

Dave

Antonio Barbuzzi (antoniob82) wrote :

This is a very annoying bug, since the audio system becomes completely unresponsive.

I think it is reported also upstream, see https://bugs.kde.org/show_bug.cgi?id=264292

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kdemultimedia - 4:4.6.2-0ubuntu2

---------------
kdemultimedia (4:4.6.2-0ubuntu2) natty; urgency=low

  * Add kubuntu_03_kmix_pulseaudio_fixes.diff: Cherry-pick several PulseAudio
    related KMix fixes that will be part of KDE 4.6.3.
    - Fixes very high CPU usage. (LP: #720882)
    - Fixes memory leaks. (LP: #676780)
 -- Felix Geyer <email address hidden> Tue, 19 Apr 2011 16:01:21 +0200

Changed in kdemultimedia (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.