Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8b296c8f
Commit
8b296c8f
authored
Jan 21, 2010
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'alsa/devel' into topic/misc
parents
88501ce1
c91a988d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
include/sound/pcm.h
include/sound/pcm.h
+3
-2
sound/core/pcm.c
sound/core/pcm.c
+1
-0
sound/core/pcm_lib.c
sound/core/pcm_lib.c
+10
-10
sound/core/pcm_native.c
sound/core/pcm_native.c
+3
-0
No files found.
include/sound/pcm.h
View file @
8b296c8f
...
@@ -311,8 +311,9 @@ struct snd_pcm_runtime {
...
@@ -311,8 +311,9 @@ struct snd_pcm_runtime {
struct
snd_pcm_mmap_control
*
control
;
struct
snd_pcm_mmap_control
*
control
;
/* -- locking / scheduling -- */
/* -- locking / scheduling -- */
unsigned
int
nowake
:
1
;
/* no wakeup (data-copy in progress) */
unsigned
int
twake
:
1
;
/* do transfer (!poll) wakeup */
wait_queue_head_t
sleep
;
wait_queue_head_t
sleep
;
/* poll sleep */
wait_queue_head_t
tsleep
;
/* transfer sleep */
struct
fasync_struct
*
fasync
;
struct
fasync_struct
*
fasync
;
/* -- private section -- */
/* -- private section -- */
...
...
sound/core/pcm.c
View file @
8b296c8f
...
@@ -894,6 +894,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
...
@@ -894,6 +894,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
memset
((
void
*
)
runtime
->
control
,
0
,
size
);
memset
((
void
*
)
runtime
->
control
,
0
,
size
);
init_waitqueue_head
(
&
runtime
->
sleep
);
init_waitqueue_head
(
&
runtime
->
sleep
);
init_waitqueue_head
(
&
runtime
->
tsleep
);
runtime
->
status
->
state
=
SNDRV_PCM_STATE_OPEN
;
runtime
->
status
->
state
=
SNDRV_PCM_STATE_OPEN
;
...
...
sound/core/pcm_lib.c
View file @
8b296c8f
...
@@ -285,8 +285,8 @@ int snd_pcm_update_state(struct snd_pcm_substream *substream,
...
@@ -285,8 +285,8 @@ int snd_pcm_update_state(struct snd_pcm_substream *substream,
return
-
EPIPE
;
return
-
EPIPE
;
}
}
}
}
if
(
!
runtime
->
nowake
&&
avail
>=
runtime
->
control
->
avail_min
)
if
(
avail
>=
runtime
->
control
->
avail_min
)
wake_up
(
&
runtime
->
sleep
);
wake_up
(
runtime
->
twake
?
&
runtime
->
tsleep
:
&
runtime
->
sleep
);
return
0
;
return
0
;
}
}
...
@@ -1706,7 +1706,7 @@ static int wait_for_avail_min(struct snd_pcm_substream *substream,
...
@@ -1706,7 +1706,7 @@ static int wait_for_avail_min(struct snd_pcm_substream *substream,
long
tout
;
long
tout
;
init_waitqueue_entry
(
&
wait
,
current
);
init_waitqueue_entry
(
&
wait
,
current
);
add_wait_queue
(
&
runtime
->
sleep
,
&
wait
);
add_wait_queue
(
&
runtime
->
t
sleep
,
&
wait
);
for
(;;)
{
for
(;;)
{
if
(
signal_pending
(
current
))
{
if
(
signal_pending
(
current
))
{
err
=
-
ERESTARTSYS
;
err
=
-
ERESTARTSYS
;
...
@@ -1749,7 +1749,7 @@ static int wait_for_avail_min(struct snd_pcm_substream *substream,
...
@@ -1749,7 +1749,7 @@ static int wait_for_avail_min(struct snd_pcm_substream *substream,
break
;
break
;
}
}
_endloop:
_endloop:
remove_wait_queue
(
&
runtime
->
sleep
,
&
wait
);
remove_wait_queue
(
&
runtime
->
t
sleep
,
&
wait
);
*
availp
=
avail
;
*
availp
=
avail
;
return
err
;
return
err
;
}
}
...
@@ -1808,7 +1808,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
...
@@ -1808,7 +1808,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
goto
_end_unlock
;
goto
_end_unlock
;
}
}
runtime
->
no
wake
=
1
;
runtime
->
t
wake
=
1
;
while
(
size
>
0
)
{
while
(
size
>
0
)
{
snd_pcm_uframes_t
frames
,
appl_ptr
,
appl_ofs
;
snd_pcm_uframes_t
frames
,
appl_ptr
,
appl_ofs
;
snd_pcm_uframes_t
avail
;
snd_pcm_uframes_t
avail
;
...
@@ -1830,7 +1830,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
...
@@ -1830,7 +1830,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
if
(
frames
>
cont
)
if
(
frames
>
cont
)
frames
=
cont
;
frames
=
cont
;
if
(
snd_BUG_ON
(
!
frames
))
{
if
(
snd_BUG_ON
(
!
frames
))
{
runtime
->
no
wake
=
0
;
runtime
->
t
wake
=
0
;
snd_pcm_stream_unlock_irq
(
substream
);
snd_pcm_stream_unlock_irq
(
substream
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -1869,7 +1869,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
...
@@ -1869,7 +1869,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
}
}
}
}
_end_unlock:
_end_unlock:
runtime
->
no
wake
=
0
;
runtime
->
t
wake
=
0
;
if
(
xfer
>
0
&&
err
>=
0
)
if
(
xfer
>
0
&&
err
>=
0
)
snd_pcm_update_state
(
substream
,
runtime
);
snd_pcm_update_state
(
substream
,
runtime
);
snd_pcm_stream_unlock_irq
(
substream
);
snd_pcm_stream_unlock_irq
(
substream
);
...
@@ -2030,7 +2030,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
...
@@ -2030,7 +2030,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
goto
_end_unlock
;
goto
_end_unlock
;
}
}
runtime
->
no
wake
=
1
;
runtime
->
t
wake
=
1
;
while
(
size
>
0
)
{
while
(
size
>
0
)
{
snd_pcm_uframes_t
frames
,
appl_ptr
,
appl_ofs
;
snd_pcm_uframes_t
frames
,
appl_ptr
,
appl_ofs
;
snd_pcm_uframes_t
avail
;
snd_pcm_uframes_t
avail
;
...
@@ -2059,7 +2059,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
...
@@ -2059,7 +2059,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
if
(
frames
>
cont
)
if
(
frames
>
cont
)
frames
=
cont
;
frames
=
cont
;
if
(
snd_BUG_ON
(
!
frames
))
{
if
(
snd_BUG_ON
(
!
frames
))
{
runtime
->
no
wake
=
0
;
runtime
->
t
wake
=
0
;
snd_pcm_stream_unlock_irq
(
substream
);
snd_pcm_stream_unlock_irq
(
substream
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -2092,7 +2092,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
...
@@ -2092,7 +2092,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
xfer
+=
frames
;
xfer
+=
frames
;
}
}
_end_unlock:
_end_unlock:
runtime
->
no
wake
=
0
;
runtime
->
t
wake
=
0
;
if
(
xfer
>
0
&&
err
>=
0
)
if
(
xfer
>
0
&&
err
>=
0
)
snd_pcm_update_state
(
substream
,
runtime
);
snd_pcm_update_state
(
substream
,
runtime
);
snd_pcm_stream_unlock_irq
(
substream
);
snd_pcm_stream_unlock_irq
(
substream
);
...
...
sound/core/pcm_native.c
View file @
8b296c8f
...
@@ -919,6 +919,7 @@ static void snd_pcm_post_stop(struct snd_pcm_substream *substream, int state)
...
@@ -919,6 +919,7 @@ static void snd_pcm_post_stop(struct snd_pcm_substream *substream, int state)
runtime
->
status
->
state
=
state
;
runtime
->
status
->
state
=
state
;
}
}
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
tsleep
);
}
}
static
struct
action_ops
snd_pcm_action_stop
=
{
static
struct
action_ops
snd_pcm_action_stop
=
{
...
@@ -1004,6 +1005,7 @@ static void snd_pcm_post_pause(struct snd_pcm_substream *substream, int push)
...
@@ -1004,6 +1005,7 @@ static void snd_pcm_post_pause(struct snd_pcm_substream *substream, int push)
SNDRV_TIMER_EVENT_MPAUSE
,
SNDRV_TIMER_EVENT_MPAUSE
,
&
runtime
->
trigger_tstamp
);
&
runtime
->
trigger_tstamp
);
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
tsleep
);
}
else
{
}
else
{
runtime
->
status
->
state
=
SNDRV_PCM_STATE_RUNNING
;
runtime
->
status
->
state
=
SNDRV_PCM_STATE_RUNNING
;
if
(
substream
->
timer
)
if
(
substream
->
timer
)
...
@@ -1061,6 +1063,7 @@ static void snd_pcm_post_suspend(struct snd_pcm_substream *substream, int state)
...
@@ -1061,6 +1063,7 @@ static void snd_pcm_post_suspend(struct snd_pcm_substream *substream, int state)
runtime
->
status
->
suspended_state
=
runtime
->
status
->
state
;
runtime
->
status
->
suspended_state
=
runtime
->
status
->
state
;
runtime
->
status
->
state
=
SNDRV_PCM_STATE_SUSPENDED
;
runtime
->
status
->
state
=
SNDRV_PCM_STATE_SUSPENDED
;
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
tsleep
);
}
}
static
struct
action_ops
snd_pcm_action_suspend
=
{
static
struct
action_ops
snd_pcm_action_suspend
=
{
...
...
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