Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
5413ba6a
Commit
5413ba6a
authored
May 26, 2010
by
Alexandre Savard
Browse files
[#3443] Open audio layer using mainbuffer internal sampling rate
parent
303fde7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/audio/alsa/alsalayer.cpp
View file @
5413ba6a
...
@@ -472,6 +472,8 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
...
@@ -472,6 +472,8 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate)
_debugAlsa
(
"Audio: Error: Cannot set sample rate (%s)"
,
snd_strerror
(
err
));
_debugAlsa
(
"Audio: Error: Cannot set sample rate (%s)"
,
snd_strerror
(
err
));
return
false
;
return
false
;
}
}
else
_debug
(
"Audio: Set audio rate to %d"
,
rate
);
if
(
dir
!=
0
)
{
if
(
dir
!=
0
)
{
_debugAlsa
(
"Audio: Error: (%i) The choosen rate %d Hz is not supported by your hardware.Using %d Hz instead. "
,
type
,
rate
,
exact_ivalue
);
_debugAlsa
(
"Audio: Error: (%i) The choosen rate %d Hz is not supported by your hardware.Using %d Hz instead. "
,
type
,
rate
,
exact_ivalue
);
...
...
sflphone-common/src/audio/mainbuffer.cpp
View file @
5413ba6a
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#include
"mainbuffer.h"
#include
"mainbuffer.h"
MainBuffer
::
MainBuffer
()
:
_internalSamplingRate
(
0
)
MainBuffer
::
MainBuffer
()
:
_internalSamplingRate
(
800
0
)
{
{
mixBuffer
=
new
SFLDataFormat
[
STATIC_BUFSIZE
];
mixBuffer
=
new
SFLDataFormat
[
STATIC_BUFSIZE
];
}
}
...
...
sflphone-common/src/managerimpl.cpp
View file @
5413ba6a
...
@@ -2777,13 +2777,8 @@ void ManagerImpl::selectAudioDriver (void) {
...
@@ -2777,13 +2777,8 @@ void ManagerImpl::selectAudioDriver (void) {
numCardIn
=
getConfigInt
(
AUDIO
,
ALSA_CARD_ID_IN
);
numCardIn
=
getConfigInt
(
AUDIO
,
ALSA_CARD_ID_IN
);
numCardOut
=
getConfigInt
(
AUDIO
,
ALSA_CARD_ID_OUT
);
numCardOut
=
getConfigInt
(
AUDIO
,
ALSA_CARD_ID_OUT
);
numCardRing
=
getConfigInt
(
AUDIO
,
ALSA_CARD_ID_RING
);
numCardRing
=
getConfigInt
(
AUDIO
,
ALSA_CARD_ID_RING
);
// sampleRate = getConfigInt(AUDIO, AUDIO_SAMPLE_RATE);
sampleRate
=
getConfigInt
(
AUDIO
,
AUDIO_SAMPLE_RATE
);
sampleRate
=
_mainBuffer
.
getInternalSamplingRate
();
if
(
sampleRate
<=
0
||
sampleRate
>
48000
)
{
sampleRate
=
44100
;
}
frameSize
=
getConfigInt
(
AUDIO
,
ALSA_FRAME_SIZE
);
frameSize
=
getConfigInt
(
AUDIO
,
ALSA_FRAME_SIZE
);
/* Only for the ALSA layer, we check the sound card information */
/* Only for the ALSA layer, we check the sound card information */
...
@@ -2815,6 +2810,7 @@ void ManagerImpl::selectAudioDriver (void) {
...
@@ -2815,6 +2810,7 @@ void ManagerImpl::selectAudioDriver (void) {
/* Open the audio devices */
/* Open the audio devices */
_audiodriver
->
openDevice
(
numCardIn
,
numCardOut
,
numCardRing
,
sampleRate
,
frameSize
,
_audiodriver
->
openDevice
(
numCardIn
,
numCardOut
,
numCardRing
,
sampleRate
,
frameSize
,
SFL_PCM_BOTH
,
alsaPlugin
);
SFL_PCM_BOTH
,
alsaPlugin
);
/* Notify the error if there is one */
/* Notify the error if there is one */
if
(
_audiodriver
->
getErrorMessage
()
!=
-
1
)
if
(
_audiodriver
->
getErrorMessage
()
!=
-
1
)
...
@@ -2833,7 +2829,8 @@ void ManagerImpl::switchAudioManager (void) {
...
@@ -2833,7 +2829,8 @@ void ManagerImpl::switchAudioManager (void) {
type
=
_audiodriver
->
getLayerType
();
type
=
_audiodriver
->
getLayerType
();
samplerate
=
getConfigInt
(
AUDIO
,
AUDIO_SAMPLE_RATE
);
// samplerate = getConfigInt(AUDIO, AUDIO_SAMPLE_RATE);
samplerate
=
_mainBuffer
.
getInternalSamplingRate
();
framesize
=
getConfigInt
(
AUDIO
,
ALSA_FRAME_SIZE
);
framesize
=
getConfigInt
(
AUDIO
,
ALSA_FRAME_SIZE
);
_debug
(
"Mnager: samplerate: %i, framesize %i
\n
"
,
samplerate
,
framesize
);
_debug
(
"Mnager: samplerate: %i, framesize %i
\n
"
,
samplerate
,
framesize
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment