Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
abcbed04
Commit
abcbed04
authored
Mar 02, 2015
by
Simon Morlat
Browse files
try to open alsa only once, to avoid spamming the logs when alsa is not working
parent
71043425
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
src/audiofilters/alsa.c
src/audiofilters/alsa.c
+9
-5
src/audiofilters/devices.c
src/audiofilters/devices.c
+1
-0
No files found.
src/audiofilters/alsa.c
View file @
abcbed04
...
...
@@ -753,13 +753,13 @@ struct _AlsaReadData{
int
nchannels
;
uint64_t
read_samples
;
MSTickerSynchronizer
*
ticker_synchronizer
;
bool_t
read_started
;
bool_t
write_started
;
#ifdef THREADED_VERSION
ms_thread_t
thread
;
ms_mutex_t
mutex
;
MSBufferizer
*
bufferizer
;
bool_t
read_started
;
bool_t
write_started
;
#endif
};
...
...
@@ -895,6 +895,7 @@ void alsa_read_postprocess(MSFilter *obj){
#endif
ms_ticker_set_time_func
(
obj
->
ticker
,
NULL
,
NULL
);
if
(
ad
->
handle
!=
NULL
)
snd_pcm_close
(
ad
->
handle
);
ad
->
read_started
=
FALSE
;
ad
->
handle
=
NULL
;
}
...
...
@@ -919,7 +920,8 @@ void alsa_read_process(MSFilter *obj){
int
samples
=
(
128
*
ad
->
rate
)
/
8000
;
int
err
;
mblk_t
*
om
=
NULL
;
if
(
ad
->
handle
==
NULL
&&
ad
->
pcmdev
!=
NULL
){
if
(
ad
->
handle
==
NULL
&&
ad
->
pcmdev
!=
NULL
&&
!
ad
->
read_started
){
ad
->
read_started
=
TRUE
;
ad
->
handle
=
alsa_open_r
(
ad
->
pcmdev
,
16
,
ad
->
nchannels
==
2
,
ad
->
rate
);
if
(
ad
->
handle
){
ad
->
read_samples
=
0
;
...
...
@@ -1036,6 +1038,7 @@ void alsa_write_init(MSFilter *obj){
void
alsa_write_postprocess
(
MSFilter
*
obj
){
AlsaReadData
*
ad
=
(
AlsaReadData
*
)
obj
->
data
;
if
(
ad
->
handle
!=
NULL
)
snd_pcm_close
(
ad
->
handle
);
ad
->
write_started
=
FALSE
;
ad
->
handle
=
NULL
;
}
...
...
@@ -1079,7 +1082,8 @@ void alsa_write_process(MSFilter *obj){
int
size
;
int
samples
;
int
err
;
if
(
ad
->
handle
==
NULL
&&
ad
->
pcmdev
!=
NULL
){
if
(
ad
->
handle
==
NULL
&&
ad
->
pcmdev
!=
NULL
&&
!
ad
->
write_started
){
ad
->
write_started
=
TRUE
;
ad
->
handle
=
alsa_open_w
(
ad
->
pcmdev
,
16
,
ad
->
nchannels
==
2
,
ad
->
rate
);
#ifdef EPIPE_BUGFIX
alsa_fill_w
(
ad
->
pcmdev
);
...
...
src/audiofilters/devices.c
View file @
abcbed04
...
...
@@ -121,6 +121,7 @@ static SoundDeviceDescription devices[]={
{
"Enspert"
,
"IGGY"
,
""
,
0
,
320
,
0
},
/*Wiko iggy*/
{
"Yota Devices Limited"
,
"YD201"
,
"msm8974"
,
DEVICE_HAS_BUILTIN_AEC
|
DEVICE_HAS_BUILTIN_OPENSLES_AEC
,
0
,
48000
},
/* Yotaphone 2 */
{
"Sony"
,
"D6503"
,
"msm8974"
,
DEVICE_HAS_BUILTIN_AEC_CRAPPY
,
280
},
{
"Sony"
,
"D6603"
,
"msm8974"
,
DEVICE_HAS_BUILTIN_AEC_CRAPPY
,
280
},
{
NULL
,
NULL
,
NULL
,
0
,
0
,
0
}
};
...
...
Write
Preview
Markdown
is supported
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