<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>98223</bug_id>
          
          <creation_ts>2005-01-30 20:18:06 +0000</creation_ts>
          <short_desc>JuK takes 100% of cpu while paused with aKode output</short_desc>
          <delta_ts>2005-05-16 21:29:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>akodelib</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hasso Tepper">hasso</reporter>
          <assigned_to name="Allan Sandfeld">kde</assigned_to>
          <cc>georgi.r.ivanov</cc>
    
    <cc>mr_smith</cc>
    
    <cc>uli.2001</cc>
    
    <cc>vide80</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>308516</commentid>
    <comment_count>0</comment_count>
    <who name="Hasso Tepper">hasso</who>
    <bug_when>2005-01-30 20:18:06 +0000</bug_when>
    <thetext>Version:           2.1.89 (using KDE 3.3.91 (beta1), compiled sources)
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-6)
OS:                Linux (i686) release 2.6.10-rc2-bk8

As short description says ... Although aKode output works like a charm mostly, JuK takes 100% of cpu if paused.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>308521</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Wheeler">wheeler</who>
    <bug_when>2005-01-30 20:30:16 +0000</bug_when>
    <thetext>This was fixed a long time ago...actually about 2 days after the aKode backend came in.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>308527</commentid>
    <comment_count>2</comment_count>
    <who name="Hasso Tepper">hasso</who>
    <bug_when>2005-01-30 20:46:58 +0000</bug_when>
    <thetext>Scott Wheeler wrote:
&gt; This was fixed a long time ago...actually about 2 days after the aKode 
&gt; backend came in. 

I recompiled whole kdemultimedia HEAD from scratch yesterday (make cvs-clean 
etc). And bug is there for me.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>308532</commentid>
    <comment_count>3</comment_count>
    <who name="Scott Wheeler">wheeler</who>
    <bug_when>2005-01-30 20:55:19 +0000</bug_when>
    <thetext>Hmm, ok -- I&apos;ll pass this on to aKode then.  I had this problem when the backend was new, but Allan quickly fixed it.

You&apos;ll probably want to follow the instructions here to get a backtrace:

http://developer.kde.org/~wheeler/freeze.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>309370</commentid>
    <comment_count>4</comment_count>
    <who name="Hasso Tepper">hasso</who>
    <bug_when>2005-02-02 12:51:34 +0000</bug_when>
    <thetext>#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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>309371</commentid>
    <comment_count>5</comment_count>
    <who name="Hasso Tepper">hasso</who>
    <bug_when>2005-02-02 12:53:17 +0000</bug_when>
    <thetext>Ah, forgot to mention that I upgraded to the latest qt-copy (3.3.4) as well. Maybe it&apos;s related.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>315496</commentid>
    <comment_count>6</comment_count>
    <who name="Allan Sandfeld">kde</who>
    <bug_when>2005-02-18 12:44:30 +0000</bug_when>
    <thetext>I need the other backtrace as well. Akode generates a new thread and the backtrace of the other thread is much more interesting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>315853</commentid>
    <comment_count>7</comment_count>
    <who name="Hasso Tepper">hasso</who>
    <bug_when>2005-02-19 14:33:40 +0000</bug_when>
    <thetext>Due to disk crashes I have no room to compile KDE with debug info at the moment. It might take some weeks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>324292</commentid>
    <comment_count>8</comment_count>
    <who name="Max Howell">max.howell</who>
    <bug_when>2005-03-15 22:31:57 +0000</bug_when>
    <thetext>*** Bug 101433 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>326637</commentid>
    <comment_count>9</comment_count>
    <who name="Allan Sandfeld">kde</who>
    <bug_when>2005-03-22 01:51:00 +0000</bug_when>
    <thetext>Using OSS output and the nvsound driver, I can now reproduce the bug as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>334897</commentid>
    <comment_count>10</comment_count>
    <who name="Alexandre Oliveira">aoliveira</who>
    <bug_when>2005-04-15 23:37:08 +0000</bug_when>
    <thetext>*** Bug 103978 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>338647</commentid>
    <comment_count>11</comment_count>
    <who name="Luke Plant">L.Plant.98</who>
    <bug_when>2005-04-30 18:12:01 +0000</bug_when>
    <thetext>I&apos;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.


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>340180</commentid>
    <comment_count>12</comment_count>
    <who name="Allan Sandfeld">kde</who>
    <bug_when>2005-05-07 18:28:04 +0000</bug_when>
    <thetext>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(&amp;mutex);
     paused = false;
+    if (!empty())
+        pthread_cond_signal(&amp;not_empty);
+    pthread_mutex_unlock(&amp;mutex);
 }
 
 } // namespace
--- trunk/KDE/kdemultimedia/akode/lib/player.cpp #410344:410345
@@ -108,6 +108,8 @@
             else
             if (m_data-&gt;in_decoder-&gt;eof())
                 goto eof;
+            else
+                std::cerr &lt;&lt; &quot;Blip?\n&quot;;
         }
         else {
             AudioFrame* out_frame = &amp;frame;
@@ -336,6 +338,7 @@
     // connect the streams to play
     m_data-&gt;decoder = new FrameToStreamDecoder(m_data-&gt;frame_decoder);
     m_data-&gt;in_decoder = new StreamToFrameDecoder(m_data-&gt;decoder, m_data-&gt;buffer);
+    m_data-&gt;in_decoder-&gt;setBlocking(true);
 
     //m_data-&gt;player_thread = new pthread_t;
     if (pthread_create(&amp;m_data-&gt;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-&gt;buffer-&gt;get(frame, false)) {
+    if (m_data-&gt;buffer-&gt;get(frame, m_data-&gt;blocking)) {
         m_data-&gt;latestPos = frame-&gt;pos;
         m_data-&gt;latest_config = *frame;
 
@@ -146,6 +148,10 @@
     }
 }
 
+void StreamToFrameDecoder::setBlocking(bool block) {
+    m_data-&gt;blocking = block;
+}
+
 const AudioConfiguration* StreamToFrameDecoder::audioConfiguration() {
     if (m_data-&gt;latest_config.channels &gt; 0)
         return &amp;m_data-&gt;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;
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>341921</commentid>
    <comment_count>13</comment_count>
    <who name="Allan Sandfeld">kde</who>
    <bug_when>2005-05-14 13:55:11 +0000</bug_when>
    <thetext>*** Bug 105651 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342608</commentid>
    <comment_count>14</comment_count>
    <who name="Alexandre Oliveira">aoliveira</who>
    <bug_when>2005-05-16 21:29:48 +0000</bug_when>
    <thetext>*** Bug 105746 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>