Project

General

Profile

Actions

Emulator Issues #2796

closed

PulseAudio - sound skipping - suggest increasing buffer size

Added by darumo about 14 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Games music giving almost imperceptible sound skipping, probably need more buffer.

It sounds much better to change the code in this way in pulseaudio plugin:

void PulseAudio::SoundLoop()
{
if (!PulseInit()) {
thread_data = 2;
return;
}
while (!thread_data)
{
int err;
//int frames_to_deliver = 512;
int frames_to_deliver = 768;
m_mixer->Mix(reinterpret_cast<short *>(mix_buffer), frames_to_deliver);
if (pa_simple_write(handle, mix_buffer, frames_to_deliver * 2 * 2, &err) < 0)
{
ERROR_LOG(AUDIO, "pa_simple_write fail: %s", pa_strerror(err));
}
}
PulseShutdown();
thread_data = 2;
}

Actions

Also available in: Atom PDF