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
5cbfb31a
Commit
5cbfb31a
authored
17 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
hw params get local again
parent
678c9d2f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/audio/audiolayer.cpp
+10
-11
10 additions, 11 deletions
src/audio/audiolayer.cpp
src/audio/audiolayer.h
+0
-7
0 additions, 7 deletions
src/audio/audiolayer.h
with
10 additions
and
18 deletions
src/audio/audiolayer.cpp
+
10
−
11
View file @
5cbfb31a
...
...
@@ -299,17 +299,16 @@ AudioLayer::isCaptureActive(void) {
AudioLayer
::
open_device
(
std
::
string
pcm_p
,
std
::
string
pcm_c
,
int
flag
)
{
int
err
;
snd_pcm_hw_params_t
*
hwParams
;
snd_pcm_hw_params_t
*
hwParams
=
NULL
;
snd_pcm_sw_params_t
*
swparams
=
NULL
;
unsigned
int
rate_in
=
getSampleRate
();
unsigned
int
rate_out
=
getSampleRate
();
int
dir
=
0
;
snd_pcm_uframes_t
period_size_in
=
getFrameSize
()
*
getSampleRate
()
/
1000
;
snd_pcm_uframes_t
buffer_size_in
=
4096
;
snd_pcm_uframes_t
threshold
=
getFrameSize
()
*
getSampleRate
()
/
1000
*
2
;
snd_pcm_uframes_t
period_size_out
=
1024
;
//getFrameSize() * getSampleRate() / 1000 * 2 ;// 1024 ;
unsigned
int
period_time
=
20
;
snd_pcm_uframes_t
buffer_size_out
=
period_size_out
*
4
;
snd_pcm_sw_params_t
*
swparams
=
NULL
;
snd_pcm_uframes_t
period_size_out
=
1024
;
snd_pcm_uframes_t
buffer_size_out
=
period_size_out
*
8
;
if
(
flag
==
SFL_PCM_BOTH
||
flag
==
SFL_PCM_CAPTURE
)
{
...
...
@@ -388,9 +387,9 @@ AudioLayer::open_device(std::string pcm_p, std::string pcm_c, int flag)
int
AudioLayer
::
write
(
void
*
buffer
,
int
length
)
{
if
(
snd_pcm_state
(
_PlaybackHandle
)
==
SND_PCM_STATE_XRUN
)
handle_xrun_playback
();
_debugAlsa
(
"avail = %d - toWrite = %d
\n
"
,
snd_pcm_avail_update
(
_PlaybackHandle
)
,
length
/
2
);
//
if(snd_pcm_state( _PlaybackHandle ) == SND_PCM_STATE_XRUN)
//
handle_xrun_playback();
//
_debugAlsa("avail = %d - toWrite = %d\n" , snd_pcm_avail_update( _PlaybackHandle ) , length / 2);
snd_pcm_uframes_t
frames
=
snd_pcm_bytes_to_frames
(
_PlaybackHandle
,
length
);
int
err
=
snd_pcm_writei
(
_PlaybackHandle
,
buffer
,
frames
);
...
...
@@ -413,9 +412,9 @@ AudioLayer::write(void* buffer, int length)
break
;
}
/*
if( err >=0 && err < frames )
_debugAlsa("Short write
- Frames remaining = %d\n", frames - err
);
*/
if
(
err
>=
0
&&
err
<
frames
)
_debugAlsa
(
"Short write
: %d out of %d
\n
"
,
err
,
frames
);
return
(
err
>
0
)
?
err
:
0
;
}
...
...
This diff is collapsed.
Click to expand it.
src/audio/audiolayer.h
+
0
−
7
View file @
5cbfb31a
...
...
@@ -289,13 +289,6 @@ class AudioLayer {
snd_pcm_t
*
_PlaybackHandle
;
snd_pcm_t
*
_CaptureHandle
;
/*
* Handles to manipulate capture and playback hardware configuration
* ALSA Library API
*/
snd_pcm_hw_params_t
*
_PlaybackHwParams
;
snd_pcm_hw_params_t
*
_CaptureHwParams
;
/*
* Handle on asynchronous event
*/
...
...
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