| Summary: | JuK takes 100% of cpu while paused with aKode output | ||
|---|---|---|---|
| Product: | [Unmaintained] akodelib | Reporter: | Hasso Tepper <hasso> |
| Component: | general | Assignee: | Allan Sandfeld <kde> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | georgi.r.ivanov, mr_smith, uli.2001, vide80 |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Hasso Tepper
2005-01-30 20:18:06 UTC
This was fixed a long time ago...actually about 2 days after the aKode backend came in. Scott Wheeler wrote:
> This was fixed a long time ago...actually about 2 days after the aKode
> backend came in.
I recompiled whole kdemultimedia HEAD from scratch yesterday (make cvs-clean
etc). And bug is there for me.
Hmm, ok -- I'll pass this on to aKode then. I had this problem when the backend was new, but Allan quickly fixed it. You'll probably want to follow the instructions here to get a backtrace: http://developer.kde.org/~wheeler/freeze.html #0 0x410ea4e7 in select () from /lib/tls/libc.so.6 #1 0xb671351a in QEventLoop::processEvents (this=0x81efca8, flags=4) at kernel/qeventloop_x11.cpp:287 #2 0xb67826e9 in QEventLoop::enterLoop (this=0x81efca8) at kernel/qeventloop.cpp:198 #3 0xb6782602 in QEventLoop::exec (this=0x81efca8) at kernel/qeventloop.cpp:145 #4 0xb676e1c1 in QApplication::exec (this=0xbffff6b0) at kernel/qapplication.cpp:2758 #5 0x080e0218 in main (argc=2, argv=0xbffff864) at main.cpp:93 Ah, forgot to mention that I upgraded to the latest qt-copy (3.3.4) as well. Maybe it's related. I need the other backtrace as well. Akode generates a new thread and the backtrace of the other thread is much more interesting. Due to disk crashes I have no room to compile KDE with debug info at the moment. It might take some weeks. *** Bug 101433 has been marked as a duplicate of this bug. *** Using OSS output and the nvsound driver, I can now reproduce the bug as well. *** Bug 103978 has been marked as a duplicate of this bug. *** I'm seeing this too, and at other times: - after un-pausing, 95% CPU usage continues - if I close the window (as opposed to either minimising or quitting), CPU immediately goes to 95% - often, a minute or so into a track, it will just start happening, sometimes after much less time. SVN commit 410345 by carewolf:
Avoid looping while paused.
BUG:98223
M +4 -0 trunk/KDE/kdemultimedia/akode/lib/audiobuffer.cpp
M +3 -0 trunk/KDE/kdemultimedia/akode/lib/player.cpp
M +8 -2 trunk/KDE/kdemultimedia/akode/lib/streamtoframe_decoder.cpp
M +2 -0 trunk/KDE/kdemultimedia/akode/lib/streamtoframe_decoder.h
--- trunk/KDE/kdemultimedia/akode/lib/audiobuffer.cpp #410344:410345
@@ -116,7 +116,11 @@
}
void AudioBuffer::resume() {
+ pthread_mutex_lock(&mutex);
paused = false;
+ if (!empty())
+ pthread_cond_signal(¬_empty);
+ pthread_mutex_unlock(&mutex);
}
} // namespace
--- trunk/KDE/kdemultimedia/akode/lib/player.cpp #410344:410345
@@ -108,6 +108,8 @@
else
if (m_data->in_decoder->eof())
goto eof;
+ else
+ std::cerr << "Blip?\n";
}
else {
AudioFrame* out_frame = &frame;
@@ -336,6 +338,7 @@
// connect the streams to play
m_data->decoder = new FrameToStreamDecoder(m_data->frame_decoder);
m_data->in_decoder = new StreamToFrameDecoder(m_data->decoder, m_data->buffer);
+ m_data->in_decoder->setBlocking(true);
//m_data->player_thread = new pthread_t;
if (pthread_create(&m_data->player_thread, 0, run_player, m_data) == 0) {
--- trunk/KDE/kdemultimedia/akode/lib/streamtoframe_decoder.cpp #410344:410345
@@ -34,13 +34,15 @@
, xfader(0)
, latestPos(-1)
, halted(false)
- , halting(false) {};
+ , halting(false)
+ , blocking(false) {};
AudioBuffer *buffer;
StreamDecoder *inDecoder;
CrossFader *xfader;
long latestPos;
AudioConfiguration latest_config;
bool halted, halting;
+ bool blocking;
};
StreamToFrameDecoder::StreamToFrameDecoder(StreamDecoder *inDecoder, AudioBuffer *buffer)
@@ -74,7 +76,7 @@
return true;
}
// Get non-blocking
- if (m_data->buffer->get(frame, false)) {
+ if (m_data->buffer->get(frame, m_data->blocking)) {
m_data->latestPos = frame->pos;
m_data->latest_config = *frame;
@@ -146,6 +148,10 @@
}
}
+void StreamToFrameDecoder::setBlocking(bool block) {
+ m_data->blocking = block;
+}
+
const AudioConfiguration* StreamToFrameDecoder::audioConfiguration() {
if (m_data->latest_config.channels > 0)
return &m_data->latest_config;
--- trunk/KDE/kdemultimedia/akode/lib/streamtoframe_decoder.h #410344:410345
@@ -43,6 +43,8 @@
virtual void stop();
virtual void resume();
+ void setBlocking(bool block);
+
virtual const AudioConfiguration* audioConfiguration();
struct private_data;
*** Bug 105651 has been marked as a duplicate of this bug. *** *** Bug 105746 has been marked as a duplicate of this bug. *** |