Skip to content
Snippets Groups Projects
Commit 7b161e44 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2333] Modify pulseaudio streams parameters

parent 7a83c0dd
Branches
Tags
No related merge requests found
......@@ -184,11 +184,11 @@ AudioStream::createStream (pa_context* c)
// parameters are defined as number of bytes
// 2048 bytes (1024 int16) is 20 ms at 44100 Hz
if (_streamType == PLAYBACK_STREAM) {
attributes->maxlength = 16000;
attributes->tlength = 2048;
attributes->prebuf = 2048;
attributes->minreq = 1024;
attributes->fragsize = 4096;
attributes->maxlength = 32000;
attributes->tlength = 8192;
attributes->prebuf = 4096;
attributes->minreq = 512;
attributes->fragsize = (uint32_t) -1;
pa_stream_connect_playback( s , NULL , attributes, PA_STREAM_INTERPOLATE_TIMING, &_volume, NULL);
// pa_stream_connect_playback (s , NULL , attributes, PA_STREAM_START_CORKED, &_volume, NULL);
} else if (_streamType == CAPTURE_STREAM) {
......@@ -197,10 +197,10 @@ AudioStream::createStream (pa_context* c)
// attributes->fragsize = (uint32_t)-1;
attributes->maxlength = 16000;
attributes->tlength = 1024;
attributes->prebuf = 1024;
attributes->tlength = 8192;
attributes->prebuf = 4096;
attributes->minreq = 512;
attributes->fragsize = 1024;
attributes->fragsize = (uint32_t) -1;
// pa_stream_connect_record (s , NULL , attributes , PA_STREAM_START_CORKED);
pa_stream_connect_record( s , NULL , attributes , PA_STREAM_INTERPOLATE_TIMING );
......
......@@ -546,6 +546,7 @@ void PulseLayer::writeToSpeaker (void)
if((tone == 0) && (file_tone == 0)) {
// _debug("maxNbBytesToGet: %i\n", maxNbBytesToGet);
bzero (out, maxNbBytesToGet);
pa_stream_write (playback->pulseStream(), out, maxNbBytesToGet, NULL, 0, PA_SEEK_RELATIVE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment