Version: unspecified (using KDE 4.5.95) OS: Linux I recently installed a headless machine with pulseaudio. When I start up at home Kmix takes 100% CPU for some minutes. After a while, it moves to a sane state, but it keeps owning the CPU from time to time for a while. Reproducible: Didn't try Steps to Reproduce: Use a remote pulseaudio server as default sound card Log into kde Watch Kmix taking all CPU power Actual Results: 100% CPU consumption Expected Results: Much lower CPU consumption. A mixer is not expected to have such a tough job.
I can confirm this. I run KMix on my local computer with a local pulseaudio server and it uses 100% of a core and about 700mb of memory. Sometimes it does not react to user actions at all / the ui does not show.
@Niels, this is a different scenario... you are saying that with *just* local PA (not network involved) that you can reproduce this scenario? Is this happening with 4.6 final packages?
Yes, this happens with 4.6.0 final and a local pulseaudio server. I get this backtrace when I break kmix during startup (which takes quite long with 100% cpu usage). Memory usage is steadily increasing. #0 0x00007f791536ea59 in memcpy () from /lib/libc.so.6 #1 0x00007f7916fed61d in QString::realloc(int) () from /usr/lib64/qt4/libQtCore.so.4 #2 0x00007f7916fedafe in QString::append(QString const&) () from /usr/lib64/qt4/libQtCore.so.4 #3 0x00007f7916fdb590 in QRegExpEngine::Box::cat(QRegExpEngine::Box const&) () from /usr/lib64/qt4/libQtCore.so.4 #4 0x00007f7916fdd12a in QRegExpEngine::parseTerm(QRegExpEngine::Box*) () from /usr/lib64/qt4/libQtCore.so.4 #5 0x00007f7916fdd2f6 in QRegExpEngine::parseExpression(QRegExpEngine::Box*) () from /usr/lib64/qt4/libQtCore.so.4 #6 0x00007f7916fdb7a7 in QRegExpEngine::parse(QChar const*, int) () from /usr/lib64/qt4/libQtCore.so.4 #7 0x00007f7916fdd5fc in QRegExpEngine::QRegExpEngine(QRegExpEngineKey const&) () from /usr/lib64/qt4/libQtCore.so.4 #8 0x00007f7916fdf1f1 in prepareEngine_helper(QRegExpPrivate*) () from /usr/lib64/qt4/libQtCore.so.4 #9 0x00007f7916fdf3bd in prepareEngineForMatch(QRegExpPrivate*, QString const&) () from /usr/lib64/qt4/libQtCore.so.4 #10 0x00007f7916fdf4dd in QRegExp::indexIn(QString const&, int, QRegExp::CaretMode) const () from /usr/lib64/qt4/libQtCore.so.4 #11 0x00007f7906d111ca in ViewSliders::_setMixSet() () from /usr/lib64/libkdeinit4_kmix.so #12 0x00007f7906d0f39d in ViewBase::setMixSet() () from /usr/lib64/libkdeinit4_kmix.so #13 0x00007f7906d10c8c in ViewSliders::ViewSliders(QWidget*, char const*, Mixer*, unsigned int, GUIProfile*, KActionCollection*) () from /usr/lib64/libkdeinit4_kmix.so #14 0x00007f7906d195a8 in KMixerWidget::createViewsByProfile(Mixer*, GUIProfile*, unsigned int) () from /usr/lib64/libkdeinit4_kmix.so #15 0x00007f7906d19666 in KMixerWidget::createLayout(unsigned int) () from /usr/lib64/libkdeinit4_kmix.so #16 0x00007f7906d19709 in KMixerWidget::KMixerWidget(Mixer*, QWidget*, unsigned int, GUIProfile*, KActionCollection*) () from /usr/lib64/libkdeinit4_kmix.so #17 0x00007f7906d04dca in KMixWindow::addMixerWidget(QString const&, GUIProfile*, int) () from /usr/lib64/libkdeinit4_kmix.so #18 0x00007f7906d07f49 in KMixWindow::recreateGUI(bool, QString const&, bool) () from /usr/lib64/libkdeinit4_kmix.so #19 0x00007f7906d08ce3 in KMixWindow::recreateGUI(bool) () from /usr/lib64/libkdeinit4_kmix.so #20 0x00007f7906d095e9 in KMixWindow::KMixWindow(bool) () from /usr/lib64/libkdeinit4_kmix.so #21 0x00007f7906d0a7eb in KMixApp::newInstance() () from /usr/lib64/libkdeinit4_kmix.so #22 0x00007f79180c3191 in KUniqueApplicationAdaptor::newInstance(QByteArray const&, QByteArray const&) () from /usr/lib/libkdeui.so.5 #23 0x00007f79180c3226 in KUniqueApplicationAdaptor::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5 #24 0x00007f79173eda5b in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QList<int> const&, int) () from /usr/lib64/qt4/libQtDBus.so.4 #25 0x00007f79173ee774 in QDBusConnectionPrivate::activateCall(QObject*, int, QDBusMessage const&) () from /usr/lib64/qt4/libQtDBus.so.4 #26 0x00007f79173eef8e in QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, QDBusMessage const&, int) () from /usr/lib64/qt4/libQtDBus.so.4 #27 0x00007f79173ef1d8 in QDBusActivateObjectEvent::placeMetaCall(QObject*) () from /usr/lib64/qt4/libQtDBus.so.4 #28 0x00007f79170a2462 in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4 #29 0x00007f7916227945 in QApplication::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4 #30 0x00007f79162252bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4 #31 0x00007f7916229d7a in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4 #32 0x00007f79180bcc88 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5 #33 0x00007f791708e0eb in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4 #34 0x00007f7917091904 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/qt4/libQtCore.so.4 #35 0x00007f79170b9033 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib64/qt4/libQtCore.so.4 #36 0x00007f7911ccc17a in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #37 0x00007f7911ccc958 in g_main_context_iterate.clone.5 () from /usr/lib/libglib-2.0.so.0 #38 0x00007f7911cccbbf in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #39 0x00007f79170b919a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4 #40 0x00007f79162ca746 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtGui.so.4 #41 0x00007f791708d432 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4 #42 0x00007f791708d6b4 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4 #43 0x00007f7917091b9b in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4 #44 0x00007f7906d0279a in kdemain () from /usr/lib64/libkdeinit4_kmix.so #45 0x0000000000407713 in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) () #46 0x0000000000408228 in handle_launcher_request () #47 0x0000000000408965 in handle_requests(int) () #48 0x000000000040959a in main ()
Hmm, seems like some regexp parsing there... strange it should take so long... do you have any files in ~/.kde4/share/apps/kmix/profiles/? If so can you kill kmix, move those files out of the way (keep them for later analysis if they are the cause of problems) and see if kmix still has issues. This is one bit of the code that uses regexp parsing, so just wondering if removing the profiles could avoid the issue.
Thanks, it works now as intended. You can find the previous configuration data here: http://stuff.salscheider-online.de/kmix.tar.gz Some files cause KWrite to become quite unresponsive - there is definitely something wrong with them.
Great! @Aitor can you confirm if you have a similar issue? In your case it could just be related to a bad regexp sneaking in there.... so different issue, but similar symptoms etc. I'm very, very tempted to disable the profile support completely with PA backend (and thus the whole (misnamed in this case) "Configure Channels" menu option) It's not really relevant for PA backend and does cause a few headaches.
Hmm, yeah a 35meg XML file can't really be a good thing :D It seems there are bad stream names in there (invalid UTF8 or something)... not sure if it's my fault for cocking up the encoding, or just if it's poorly converted to a string suitable for the XML stuff. All in all I'll need to speak to Christian about this as I'm a bit clueless about the profile stuff and how best to handle it. Christian WDYT?
(FYI the profiles part could be related in some way to discussions on bug #262632)
I've got an almost 5MB xml in ~/.kde4/share/apps/kmix with really weird content. It's "PulseAudio.Playback_Streams.1.default.xml". You can download all profiles from http://aitorpazos.es/files/kmix-profiles.tar.bz
Cool, thanks Aitor. Does deleting those XML files resolve the memory and performance issue (it's safe to just delete them)?
Performance and memory is fine after deleting those files, but there are no controls available in kmix dialog. I can't even see kmix in top now ;)
Confirming the problem on my part as well (kmix taking lot of cpu). I have a pretty huge Pulse...Profile....xml file, and one very strange loong line in it like <control id="^stream:Ã<U+0083>Â<U+0083>Ã<U+0082>Â<U+0083>Ã<U+0083>Â<U .... Deleting the file makes things ok. a) I don't understand what's up w/ these profiles, and how the hell that strange string landed in there. b) on a different computer kmix starts to get into this loop when starting flash inside Chrome browser. c) I guess that Unicode string might be broken and/or that QRegExp class chokes badly on it. Other thoughts: a) see who could introduce streams with such names, with unicode "NO BREAK HERE", "BREAK ALLOWED HERE" b) cutting those 2 characters (at insertion time) - could that be a fix? :-D c) skipping controls w/ names that are longer then a hardcoded size - at insert time!
*** Bug 264959 has been marked as a duplicate of this bug. ***
Created attachment 56802 [details] ~/.kde/share/apps/kmix/profiles/PulseAudio.Streams_wiedergeben.1.default.xml.zip Another huge file, 31MB when extracted. PulseAudio is used only locally. That was shown on console before kmix hanged completely: QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: Datei oder Verzeichnis nicht gefunden QFileSystemWatcher: failed to add paths: /home/dominic/.config/ibus/bus Bus::open: Can not get ibus-daemon's address. IBusInputContext::createInputContext: no connection to ibus-daemon unnamed app(13966): Communication problem with "kmix" , it probably crashed. Error message was: "org.freedesktop.DBus.Error.NoReply" : " "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." " kmix(13967) context_state_callback: Connection to PulseAudio daemon closed. Attempting reconnection. kmix(13967) source_output_cb: Source Output callback failure kmix(13967) ext_stream_restore_read_cb: Failed to initialize stream_restore extension: Zeitüberschreitung UdevQt: unhandled device action "move" kmix(13967) sink_input_cb: Ignoring sink-input due to it being designated as an event and thus handled by the Event slider kmix(13967) sink_cb: Sink callback failure kmix(13967) sink_cb: Sink callback failure kmix(13967) sink_cb: Sink callback failure kmix(13967) sink_cb: Sink callback failure kmix(13967) sink_cb: Sink callback failure
Same here: a 210 MB corrupted xml file called PulseAudio.Playback_Streams.1.default.xml. Local pulseaudio, KDE 4.6. I have the following 2 questions: 1. Why is this bug still unconfirmed? 2. If I delete the file, will it mess up something (as in comment #11)?
Fixed 1. for you David - I've been on holiday this past week, so not had a chance to look into this much yet. I think there may be another XML file that needs editing to "restore" all the controls back again... I'll have to try and fix things. I've now got KDE 4.6 properly installed so should be able to work on a fix now.
...and same also here. After deleting my 7Mb file, all is working correctly.
> I've now got KDE 4.6 properly installed so should be able to work on a fix now. Ok, so just another bit of information. I have deleted said xml file, and kmix was OK for a while. However, the file is now back to 19M, and kmix is using 100% again. I had to turn off the computer without properly shutting it down yesterday (kernel freeze), so it may have cause the file to be corrupted, I don't know.
Still present in KDE4.6.1. Seems to be triggered by Flash running on my system, though I suspect that's just because Flash is the only thing that uses Pulse (I have a patched Phonon backend to bypass Pulse). My PulseAudio.Playback_Streams.1.default.xml file had made it to 27MB, also with the random Unicode character spam observed by someone else. I have a full multithreaded backtrace with all relevant debugging symbols from attaching gdb while kmix is in the CPU-maxed state here: http://pastebin.com/eTVdnQVn
*** Bug 266070 has been marked as a duplicate of this bug. ***
*** Bug 266271 has been marked as a duplicate of this bug. ***
Probably fixed in my tree. Just waiting for Christian to review. For the eager: http://colin.guthr.ie/git/kdemultimedia-trunk/log/
This is now committed and will be in KDE 4.6.3 whenever that comes. Or you can grab the patches from the 4.6 branch in kdemultimedia subversion. Please feel free to reopen of these patches do not fix the problem.
I have seen this behavior (eating 100% CPU on one core) since 4.6.0 and it still happen on 4.6.2. The way to trigger it on my laptop is to view a video using vlc even for only a few seconds. After that kmix goes to mars and I have to kill it. Fortunately I can still have sound on the system. I don't think this bug is fixed.
(In reply to comment #24) > I have seen this behavior (eating 100% CPU on one core) since 4.6.0 and it > still happen on 4.6.2. The way to trigger it on my laptop is to view a video > using vlc > even for only a few seconds. > > After that kmix goes to mars and I have to kill it. Fortunately I can still > have sound > on the system. > > I don't think this bug is fixed. The KDE update didn't overwrite the configuration file, which caused that error. I fixed it by overwriting the damaged file. Comment #5 fixed it.
----- incarus6@googlemail.com a écrit : > The KDE update didn't overwrite the configuration file, which caused > that error. I fixed it by overwriting the damaged file. > Comment #5 fixed it. Indeed. However I do not have any audio channels anymore... My HDA Intel isn't shown as it was and there is only 1 output channel.
(In reply to comment #26) > ----- incarus6@googlemail.com a écrit : > > The KDE update didn't overwrite the configuration file, which caused > > that error. I fixed it by overwriting the damaged file. > > Comment #5 fixed it. > > Indeed. > However I do not have any audio channels anymore... My HDA Intel > isn't shown as it was and there is only 1 output channel. So you do not have a device called "Internal Audio Stereo"? or similar? You cannot right click and select "Split Channels"? If you can do this then it's working as expected. 99% of users do not know they have an "Intel HDA" or a "VIA VX12345" or whatever, so the device name is simplified. Split channels is also there to keep things cleaner in the UI for the most common cases, but still provides the control you need.
> So you do not have a device called "Internal Audio Stereo"? or > similar? Yes I do. But as an old timer I still prefer it to be called by its name so that I can be sure it's detected as it should. > You cannot right click and select "Split Channels"? No. Don't know where I should do that. In kmix there is no such option. I have "Configure channels" -- at least in french -- but no channel is shown on the list. And there is none as the master channel. > If you can do this then it's working as expected. Well, so I think it's not working as expected :-/ > 99% of users do not know they have an "Intel HDA" or a > "VIA VX12345" or whatever, so the device name is simplified. I'm not among them ;) I'm using and developping for Linux since '94/95 and I'm now currently an embedded linux developper (bootloaders, kernel and stuff)... > Split channels is also there to keep things cleaner in the UI for the > most common cases, but still provides the control you need. There's nothing either in kmix or in phonon's configuration module where I could find this option.
(In reply to comment #28) > > So you do not have a device called "Internal Audio Stereo"? or > > similar? > > Yes I do. But as an old timer I still prefer it to be called > by its name so that I can be sure it's detected as it should. I'm afraid this is just how we do things in PA. There is no way to configure this, although you can manually rename things (although it is somewhat tricky to do so - just set the device.description proplist entry on the sink, and it will be remembered thereafter. > > You cannot right click and select "Split Channels"? > > No. Don't know where I should do that. In kmix there is no > such option. I have "Configure channels" -- at least in french -- > but no channel is shown on the list. And there is none as the > master channel. In Subversion for both master and 4.6, the "Configure Channels" option is removed. It doesn't make sense any longer with PA. In order to select the Split Channels option simply bring up the context menu by right clicking on the slider in question. This has been part of KMix since long before PA support was added. > > If you can do this then it's working as expected. > > Well, so I think it's not working as expected :-/ Well, as I designed how it worked, it's working as expected! ;) That said it may not be how you are used to working, but if you prefer not to move with the times, then you should still be able to go back to ALSA only mode should your distro provide such facilities. > > 99% of users do not know they have an "Intel HDA" or a > > "VIA VX12345" or whatever, so the device name is simplified. > > I'm not among them ;) I'm using and developping for Linux > since '94/95 and I'm now currently an embedded linux > developper (bootloaders, kernel and stuff)... Yeah I can appreciate that and I include myself among someone who is used to "how thigns used to work" too, but I very much appreciate the simplified interface that PA provides because unfiltered displays can be absolutely impossible for new users... we all know why alsa sucks sometimes: http://people.redhat.com/alexl/files/why-alsa-sucks.png > > Split channels is also there to keep things cleaner in the UI for the > > most common cases, but still provides the control you need. > > There's nothing either in kmix or in phonon's configuration module > where I could find this option. As said above, just right click on the slider in kmix.
----- "Colin Guthrie" <cguthrie@mandriva.org> a écrit : > > > > Yes I do. But as an old timer I still prefer it to be called > > by its name so that I can be sure it's detected as it should. > > I'm afraid this is just how we do things in PA. There is no way to > configure this, although you can manually rename things (although > it is somewhat tricky to do so - just set the device.description > proplist entry on the sink, and it will be remembered thereafter. That's not really a problem in itself. It's just that as it's no more the way it used to be, it should be advertised somewhere so that old timers could know, or a full description somewhere... > In Subversion for both master and 4.6, the "Configure Channels" option > is removed. It doesn't make sense any longer with PA. I'm using 4.6.2 and it's still here... > In order to select the Split Channels option simply bring up the > context menu by right clicking on the slider in question. This has been part of > KMix since long before PA support was added. Have a look at the screenshots I took today... It's a bit unusual. > > Well, so I think it's not working as expected :-/ > > Well, as I designed how it worked, it's working as expected! ;) :) I said that because I don't have any channel to split/configure/select... > That said it may not be how you are used to working, but if you prefer not > to move with the times, then you should still be able to go back to ALSA > only mode should your distro provide such facilities. I think the Linux sound layer should go past alsa ;) > Yeah I can appreciate that and I include myself among someone who is > used to "how thigns used to work" too, but I very much appreciate the > simplified interface that PA provides because unfiltered displays can > be absolutely impossible for new users... Simplifying things could be a nice move. However the new simplified things should then "just work" (and a nicer move should be to allow "advanced" configuration -- just the opposite of gnomish overly to simplified things). > we all know why alsa sucks > sometimes: http://people.redhat.com/alexl/files/why-alsa-sucks.png Oh yeah :) I completely agree. But my opinion doesn't count as I was fine with OSS (fortunately I didn't have to code sound drivers). > As said above, just right click on the slider in kmix. There's no slider appart the "master" I get from clicking in the system tray, but there's no popup menu associated with it.
Created attachment 59019 [details] Kmix audio playback channels list
Created attachment 59020 [details] Kmix audio capture channels list
Created attachment 59021 [details] Kmix available channels list
Created attachment 59022 [details] Kmix master channel
Ahh right, yeah that's a bit *too* simplified :D This is a separate bug, but I have fixed that in both the trunk and 4.6 branches of SVN. I was too late for the 4.6.2 window, but it'll be in 4.6.3 or you can grab the patches from subversion if you're rolling your own. See the attached screenshot for what it should look like :)
Created attachment 59024 [details] How the split channels should look. (as a side note, you may need to delete your ~/.kde4/share/config/kmixrc file to get all the tabs to show up due to previous bugs injecting bogus content into the file)
> --> (http://bugs.kde.org/attachment.cgi?id=59024) > How the split channels should look. > > (as a side note, you may need to delete your > ~/.kde4/share/config/kmixrc file > to get all the tabs to show up due to previous bugs injecting bogus > content into the file) That worked! I got back one channel and I can split it... Thanks a lot!
> Ahh right, yeah that's a bit *too* simplified :D :) > This is a separate bug, but I have fixed that in both the trunk and > 4.6 branches of SVN. I was too late for the 4.6.2 window, but it'll > be in 4.6.3 or you can grab the patches from subversion if you're > rolling your own. I'll be waiting for packages to be built for my distro: I prefer spending most of my free time with my children (however, for now, my favorite hobby is currently testing Plan9).
(In reply to comment #37) > > (as a side note, you may need to delete your > > ~/.kde4/share/config/kmixrc file > > to get all the tabs to show up due to previous bugs injecting bogus > > content into the file) > > That worked! I got back one channel and I can split it... Thanks a lot! How many times should I use this fix ? I needed it again today :(
(In reply to comment #39) > How many times should I use this fix ? I needed it again today :( Do you have the patches yet or are you still using the buggy version? If you are still using the buggy version then you'll still need to do the work around....
----- "Colin Guthrie" <cguthrie@mandriva.org> a écrit : > > How many times should I use this fix ? I needed it again today :( > > Do you have the patches yet or are you still using the buggy version? > If you are still using the buggy version then you'll still need to do > the work around.... Ah, ok. So I must still have the buggy version. Packages may not have been updated. Do you know what triggers the bug ? Thanks, Colin... T.
I believe that 4.6.3 is now out with my fixes included. I think the trigger case was kinda random, but one thing that could cause it related to me not calling QString::number() on numeric data and just concatenating strange characters onto strings that resulted in invalid utf8 data in the config files. Whoops.
> I believe that 4.6.3 is now out with my fixes included. Nice . I hope They'll be provided for my distro. > I think the trigger case was kinda random, but one thing that could > cause it > related to me not calling QString::number() on numeric data and just > concatenating strange characters onto strings that resulted in invalid > utf8 > data in the config files. Whoops. Ok. So not something I can avoid by doing or not doing something else :) Thanks a lot. T.
(In reply to comment #12) > Confirming the problem on my part as well (kmix taking lot of cpu). > I have a pretty huge Pulse...Profile....xml file, > and one very strange loong line in it like > <control id="^stream:Ã<U+0083>Â<U+0083>Ã<U+0082>Â<U+0083>Ã<U+0083>Â<U .... > > Deleting the file makes things ok. > > a) I don't understand what's up w/ these profiles, and how the hell that > strange string landed in there. > b) on a different computer kmix starts to get into this loop when starting > flash inside Chrome browser. > c) I guess that Unicode string might be broken and/or that QRegExp class chokes > badly on it. > > Other thoughts: > a) see who could introduce streams with such names, with unicode "NO BREAK > HERE", "BREAK ALLOWED HERE" > b) cutting those 2 characters (at insertion time) - could that be a fix? :-D > c) skipping controls w/ names that are longer then a hardcoded size - at insert > time! Deleting the huge xml file, that is, /.kde/share/apps/kmix/profiles/PulseAudio.Playback_Streams.1.default.xml, works for me as well. I'm using kde 4.6.2. Just FYI.