Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
846f3814
Commit
846f3814
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2333] Update playback audiostream parameters
parent
3d2a5409
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-common/src/audio/pulseaudio/audiostream.cpp
+11
-10
11 additions, 10 deletions
sflphone-common/src/audio/pulseaudio/audiostream.cpp
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
+5
-3
5 additions, 3 deletions
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
with
16 additions
and
13 deletions
sflphone-common/src/audio/pulseaudio/audiostream.cpp
+
11
−
10
View file @
846f3814
...
@@ -184,11 +184,11 @@ AudioStream::createStream (pa_context* c)
...
@@ -184,11 +184,11 @@ AudioStream::createStream (pa_context* c)
// parameters are defined as number of bytes
// parameters are defined as number of bytes
// 2048 bytes (1024 int16) is 20 ms at 44100 Hz
// 2048 bytes (1024 int16) is 20 ms at 44100 Hz
if
(
_streamType
==
PLAYBACK_STREAM
)
{
if
(
_streamType
==
PLAYBACK_STREAM
)
{
attributes
->
maxlength
=
32
000
;
attributes
->
maxlength
=
64
000
;
attributes
->
tlength
=
16
000
;
attributes
->
tlength
=
32
000
;
attributes
->
prebuf
=
1024
;
attributes
->
prebuf
=
4096
;
// Pulseaudio will not start if prebuffering is not reached
attributes
->
minreq
=
512
;
attributes
->
minreq
=
2048
;
// The server side playback framesize
attributes
->
fragsize
=
(
uint32_t
)
-
1
;
attributes
->
fragsize
=
8192
;
// Fragment size at wich we receive an interupt
pa_stream_connect_playback
(
s
,
NULL
,
attributes
,
PA_STREAM_INTERPOLATE_TIMING
,
&
_volume
,
NULL
);
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);
// pa_stream_connect_playback (s , NULL , attributes, PA_STREAM_START_CORKED, &_volume, NULL);
}
else
if
(
_streamType
==
CAPTURE_STREAM
)
{
}
else
if
(
_streamType
==
CAPTURE_STREAM
)
{
...
@@ -197,13 +197,14 @@ AudioStream::createStream (pa_context* c)
...
@@ -197,13 +197,14 @@ AudioStream::createStream (pa_context* c)
// attributes->fragsize = (uint32_t)-1;
// attributes->fragsize = (uint32_t)-1;
attributes
->
maxlength
=
32000
;
attributes
->
maxlength
=
32000
;
attributes
->
tlength
=
16000
;
attributes
->
tlength
=
(
uint32_t
)
-
1
;
attributes
->
prebuf
=
1024
;
attributes
->
prebuf
=
(
uint32_t
)
-
1
;
attributes
->
minreq
=
512
;
attributes
->
minreq
=
(
uint32_t
)
-
1
;
attributes
->
fragsize
=
(
uint32_t
)
-
1
;
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_START_CORKED);
pa_stream_connect_record
(
s
,
NULL
,
attributes
,
PA_STREAM_INTERPOLATE_TIMING
);
// pa_stream_connect_record( s , NULL , attributes , PA_STREAM_INTERPOLATE_TIMING );
pa_stream_connect_record
(
s
,
NULL
,
NULL
,
PA_STREAM_INTERPOLATE_TIMING
);
}
else
if
(
_streamType
==
UPLOAD_STREAM
)
{
}
else
if
(
_streamType
==
UPLOAD_STREAM
)
{
pa_stream_connect_upload
(
s
,
1024
);
pa_stream_connect_upload
(
s
,
1024
);
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
+
5
−
3
View file @
846f3814
...
@@ -58,10 +58,11 @@ static void playback_underflow_callback (pa_stream* s, void* userdata UNUSED)
...
@@ -58,10 +58,11 @@ static void playback_underflow_callback (pa_stream* s, void* userdata UNUSED)
{
{
_debug
(
"PulseLayer::Buffer Underflow
\n
"
);
_debug
(
"PulseLayer::Buffer Underflow
\n
"
);
SFLDataFormat
*
out
=
(
SFLDataFormat
*
)
pa_xmalloc
(
framesPerBuffer
*
sizeof
(
SFLDataFormat
));
// fill in audio buffer twice the prebuffering value to restart playback
bzero
(
out
,
framesPerBuffer
*
sizeof
(
SFLDataFormat
));
SFLDataFormat
*
out
=
(
SFLDataFormat
*
)
pa_xmalloc
(
framesPerBuffer
*
sizeof
(
SFLDataFormat
)
*
2
);
bzero
(
out
,
framesPerBuffer
*
sizeof
(
SFLDataFormat
)
*
2
);
pa_stream_write
(
s
,
out
,
framesPerBuffer
*
sizeof
(
SFLDataFormat
),
NULL
,
0
,
PA_SEEK_RELATIVE
);
pa_stream_write
(
s
,
out
,
framesPerBuffer
*
sizeof
(
SFLDataFormat
)
*
2
,
NULL
,
0
,
PA_SEEK_RELATIVE
);
pa_stream_trigger
(
s
,
NULL
,
NULL
);
pa_stream_trigger
(
s
,
NULL
,
NULL
);
pa_xfree
(
out
);
pa_xfree
(
out
);
...
@@ -561,6 +562,7 @@ void PulseLayer::writeToSpeaker (void)
...
@@ -561,6 +562,7 @@ void PulseLayer::writeToSpeaker (void)
}
}
}
}
_urgentRingBuffer
.
Discard
(
toGet
);
_urgentRingBuffer
.
Discard
(
toGet
);
pa_xfree
(
out
);
pa_xfree
(
out
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment