Program: 12810
Project: 12810
Buggy source:
@Override public void run(){
  try {
    SourceDataLine out=computer.mixer.getLine(this);
    int[] leftBuffer=new int[BUFFER_LENGTH];
    int[] rightBuffer=new int[BUFFER_LENGTH];
    int frameSize=out.getFormat().getFrameSize();
    byte[] buffer=new byte[BUFFER_LENGTH * frameSize];
    System.out.println("String_Node_Str");
    int bytesPerSample=frameSize / 2;
    buildMixerTable();
    ticksBeteenPlayback=(int)((Motherboard.SPEED * BUFFER_LENGTH) / SAMPLE_RATE);
    ticksSinceLastPlayback=0;
    int zeroSamples=0;
    setRun(true);
    while (isRunning()) {
      computer.getMotherboard().requestSpeed(this);
      playSound(leftBuffer,rightBuffer);
      int p=0;
      for (int idx=0; idx < BUFFER_LENGTH; idx++) {
        int sampleL=leftBuffer[idx];
        int sampleR=rightBuffer[idx];
        if (sampleL == 0 && sampleR == 0) {
          zeroSamples++;
        }
 else {
          zeroSamples=0;
        }
        for (int shift=SoundMixer.BITS - 8, index=0; shift >= 0; shift-=8, index++) {
          buffer[p + index]=(byte)(sampleR >> shift);
          buffer[p + index + bytesPerSample]=(byte)(sampleL >> shift);
        }
        p+=frameSize;
      }
      try {
        timerSync.lock();
        ticksSinceLastPlayback-=ticksBeteenPlayback;
      }
  finally {
        timerSync.unlock();
      }
      out.write(buffer,0,buffer.length);
      if (zeroSamples >= MAX_IDLE_SAMPLES) {
        zeroSamples=0;
        pause=true;
        computer.getMotherboard().cancelSpeedRequest(this);
        while (pause && isRunning()) {
          try {
            Thread.sleep(50);
            timerSync.lock();
            playbackFinished.signalAll();
          }
 catch (          InterruptedException ex) {
            return;
          }
catch (          IllegalMonitorStateException ex) {
          }
 finally {
            try {
              timerSync.unlock();
            }
 catch (            IllegalMonitorStateException ex) {
            }
          }
        }
      }
      try {
        timerSync.lock();
        playbackFinished.signalAll();
        while (isRunning() && ticksSinceLastPlayback < ticksBeteenPlayback) {
          cpuCountReached.await();
        }
      }
 catch (      InterruptedException ex) {
      }
 finally {
        timerSync.unlock();
      }
    }
  }
 catch (  LineUnavailableException ex) {
    Logger.getLogger(CardMockingboard.class.getName()).log(Level.SEVERE,null,ex);
  }
 finally {
    computer.getMotherboard().cancelSpeedRequest(this);
    System.out.println("String_Node_Str");
    computer.mixer.returnLine(this);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    SourceDataLine out=computer.mixer.getLine(this);
    int[] leftBuffer=new int[BUFFER_LENGTH];
    int[] rightBuffer=new int[BUFFER_LENGTH];
    int frameSize=out.getFormat().getFrameSize();
    byte[] buffer=new byte[BUFFER_LENGTH * frameSize];
    System.out.println("String_Node_Str");
    int bytesPerSample=frameSize / 2;
    buildMixerTable();
    ticksBeteenPlayback=(int)((Motherboard.SPEED * BUFFER_LENGTH) / SAMPLE_RATE);
    ticksSinceLastPlayback=0;
    int zeroSamples=0;
    setRun(true);
    while (isRunning()) {
      while (!computer.isRunning()) {
        Thread.sleep(500);
      }
      computer.getMotherboard().requestSpeed(this);
      playSound(leftBuffer,rightBuffer);
      int p=0;
      for (int idx=0; idx < BUFFER_LENGTH; idx++) {
        int sampleL=leftBuffer[idx];
        int sampleR=rightBuffer[idx];
        if (sampleL == 0 && sampleR == 0) {
          zeroSamples++;
        }
 else {
          zeroSamples=0;
        }
        for (int shift=SoundMixer.BITS - 8, index=0; shift >= 0; shift-=8, index++) {
          buffer[p + index]=(byte)(sampleR >> shift);
          buffer[p + index + bytesPerSample]=(byte)(sampleL >> shift);
        }
        p+=frameSize;
      }
      try {
        timerSync.lock();
        ticksSinceLastPlayback-=ticksBeteenPlayback;
      }
  finally {
        timerSync.unlock();
      }
      out.write(buffer,0,buffer.length);
      if (zeroSamples >= MAX_IDLE_SAMPLES) {
        zeroSamples=0;
        pause=true;
        computer.getMotherboard().cancelSpeedRequest(this);
        while (pause && isRunning()) {
          try {
            Thread.sleep(50);
            timerSync.lock();
            playbackFinished.signalAll();
          }
 catch (          InterruptedException ex) {
            return;
          }
catch (          IllegalMonitorStateException ex) {
          }
 finally {
            try {
              timerSync.unlock();
            }
 catch (            IllegalMonitorStateException ex) {
            }
          }
        }
      }
      try {
        timerSync.lock();
        playbackFinished.signalAll();
        while (isRunning() && ticksSinceLastPlayback < ticksBeteenPlayback) {
          cpuCountReached.await();
        }
      }
 catch (      InterruptedException ex) {
      }
 finally {
        timerSync.unlock();
      }
    }
  }
 catch (  LineUnavailableException ex) {
    Logger.getLogger(CardMockingboard.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  InterruptedException ex) {
    Logger.getLogger(CardMockingboard.class.getName()).log(Level.SEVERE,null,ex);
  }
 finally {
    computer.getMotherboard().cancelSpeedRequest(this);
    System.out.println("String_Node_Str");
    computer.mixer.returnLine(this);
  }
}