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
0bedeb6e
Commit
0bedeb6e
authored
16 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
another try to fix the dtmf and ringtone bugs
parent
38e8d709
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/audio/alsalayer.cpp
+10
-7
10 additions, 7 deletions
src/audio/alsalayer.cpp
src/audio/alsalayer.h
+0
-5
0 additions, 5 deletions
src/audio/alsalayer.h
with
10 additions
and
12 deletions
src/audio/alsalayer.cpp
+
10
−
7
View file @
0bedeb6e
...
...
@@ -32,7 +32,6 @@ bool ringtone_thread_is_running;
,
_PlaybackHandle
(
NULL
)
,
_CaptureHandle
(
NULL
)
,
_periodSize
()
,
_AsyncHandler
(
NULL
)
,
_audioPlugin
()
,
_inChannel
()
,
_outChannel
()
...
...
@@ -208,7 +207,7 @@ AlsaLayer::playSamples(void* buffer, int toCopy, bool isTalking)
AlsaLayer
::
putUrgent
(
void
*
buffer
,
int
toCopy
)
{
if
(
_PlaybackHandle
){
fillHWBuffer
();
//
fillHWBuffer();
int
a
=
_urgentBuffer
.
AvailForPut
();
if
(
a
>=
toCopy
){
return
_urgentBuffer
.
Put
(
buffer
,
toCopy
,
_defaultVolume
);
...
...
@@ -268,9 +267,12 @@ void AlsaLayer::restorePulseAppsVolume( void ){}
void
AlsaLayer
::
playTones
(
void
)
{
int
frames
;
int
maxBytes
;
int
frames
=
_periodSize
;
int
maxBytes
=
frames
*
sizeof
(
SFLDataFormat
)
;
frames
=
_periodSize
;
frames
=
940
;
maxBytes
=
frames
*
sizeof
(
SFLDataFormat
)
;
SFLDataFormat
*
out
=
(
SFLDataFormat
*
)
malloc
(
maxBytes
*
sizeof
(
SFLDataFormat
));
if
(
_talk
)
{}
else
{
...
...
@@ -371,6 +373,7 @@ bool AlsaLayer::alsa_set_params( snd_pcm_t *pcm_handle, int type, int rate ){
_debugAlsa
(
"(%i) The choosen period size %d bytes is not supported by your hardware.
\n
Using %d instead.
\n
"
,
type
,
(
int
)
periodsize
,
(
int
)
exact_lvalue
);
}
periodsize
=
exact_lvalue
;
_periodSize
=
exact_lvalue
;
/* Set the number of fragments */
exact_ivalue
=
periods
;
dir
=
0
;
...
...
@@ -437,7 +440,7 @@ AlsaLayer::open_device(std::string pcm_p, std::string pcm_c, int flag)
if
(
flag
==
SFL_PCM_BOTH
||
flag
==
SFL_PCM_PLAYBACK
)
{
if
((
err
=
snd_pcm_open
(
&
_PlaybackHandle
,
pcm_p
.
c_str
(),
SND_PCM_STREAM_PLAYBACK
,
SND_PCM_NONBLOCK
))
<
0
){
if
((
err
=
snd_pcm_open
(
&
_PlaybackHandle
,
pcm_p
.
c_str
(),
SND_PCM_STREAM_PLAYBACK
,
0
))
<
0
){
_debugAlsa
(
"Error while opening playback device %s
\n
"
,
pcm_p
.
c_str
());
setErrorMessage
(
ALSA_PLAYBACK_DEVICE
);
return
false
;
...
...
@@ -484,7 +487,7 @@ AlsaLayer::write(void* buffer, int length)
int
err
=
snd_pcm_writei
(
_PlaybackHandle
,
buffer
,
frames
);
switch
(
err
)
{
case
-
EAGAIN
:
_debugAlsa
(
" (%s)
\n
"
,
snd_strerror
(
err
));
_debugAlsa
(
"
EAGAIN
(%s)
\n
"
,
snd_strerror
(
err
));
snd_pcm_resume
(
_PlaybackHandle
);
break
;
case
-
EPIPE
:
...
...
@@ -493,7 +496,7 @@ AlsaLayer::write(void* buffer, int length)
snd_pcm_writei
(
_PlaybackHandle
,
buffer
,
frames
);
break
;
case
-
ESTRPIPE
:
_debugAlsa
(
" (%s)
\n
"
,
snd_strerror
(
err
));
_debugAlsa
(
"
ESTRPIPE
(%s)
\n
"
,
snd_strerror
(
err
));
snd_pcm_resume
(
_PlaybackHandle
);
break
;
case
-
EBADFD
:
...
...
This diff is collapsed.
Click to expand it.
src/audio/alsalayer.h
+
0
−
5
View file @
0bedeb6e
...
...
@@ -308,11 +308,6 @@ class AlsaLayer : public AudioLayer {
*/
snd_pcm_uframes_t
_periodSize
;
/**
* Handle on asynchronous event
*/
snd_async_handler_t
*
_AsyncHandler
;
/**
* Volume is controlled by the application. Data buffer are modified here to adjust to the right volume selected by the user on the main interface
* @param buffer The buffer to adjust
...
...
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