You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change that worked well on the laptop completely screws up playback on SparrenBurcht - Pine64. The code tries to find a very small OS buffer size to optimize performance, but somehow that doesn't play well with Pine64. Code has been removed for now, to be checked later if Pine64 can be optimized as well.
public void open() {
// The buffer should be big enough for the sound card buffer millis + some small percentage
// to account for different sound card streams being out of sync.
// The underlying implementation will take care of rounding the buffer size to a number of frames.
int bufferSize = (int) (getTechnicalSettings().getSoundCardBufferMillis() * this.outputFormat.getNumberOfBytesPerMilli() * 1.1);
boolean openSuccess = false;
// Max number of retries, should be plenty based on test findings.
int maxRetries = 10;
int tries = 0;
// We have seen LineUnavailableException's happen at certain buffer sizes, so perform retries
// for slightly larger buffer sizes until either it was a success or the max retries has been reached.
while (!openSuccess && tries < maxRetries) {
try {
this.outputLine.open(this.outputFormat.toJavaAudioFormat(), bufferSize);
openSuccess = true;
} catch (LineUnavailableException e) {
Logger.info("Line unavailable for requested buffer size, will try buffer size with one extra frame");
bufferSize += this.outputFormat.getNumberOfBytesPerFrame();
tries++;
}
}
if (!openSuccess) {
throw new IllegalStateException("Line unavailable after max retries");
}
}
The text was updated successfully, but these errors were encountered:
The change that worked well on the laptop completely screws up playback on SparrenBurcht - Pine64. The code tries to find a very small OS buffer size to optimize performance, but somehow that doesn't play well with Pine64. Code has been removed for now, to be checked later if Pine64 can be optimized as well.
The text was updated successfully, but these errors were encountered: