Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
8b296c8f
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8b296c8f
编写于
1月 21, 2010
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'alsa/devel' into topic/misc
上级
88501ce1
c91a988d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
12 deletion
+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
未找到文件。
include/sound/pcm.h
浏览文件 @
8b296c8f
...
...
@@ -311,8 +311,9 @@ struct snd_pcm_runtime {
struct
snd_pcm_mmap_control
*
control
;
/* -- locking / scheduling -- */
unsigned
int
nowake
:
1
;
/* no wakeup (data-copy in progress) */
wait_queue_head_t
sleep
;
unsigned
int
twake
:
1
;
/* do transfer (!poll) wakeup */
wait_queue_head_t
sleep
;
/* poll sleep */
wait_queue_head_t
tsleep
;
/* transfer sleep */
struct
fasync_struct
*
fasync
;
/* -- private section -- */
...
...
sound/core/pcm.c
浏览文件 @
8b296c8f
...
...
@@ -894,6 +894,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
memset
((
void
*
)
runtime
->
control
,
0
,
size
);
init_waitqueue_head
(
&
runtime
->
sleep
);
init_waitqueue_head
(
&
runtime
->
tsleep
);
runtime
->
status
->
state
=
SNDRV_PCM_STATE_OPEN
;
...
...
sound/core/pcm_lib.c
浏览文件 @
8b296c8f
...
...
@@ -285,8 +285,8 @@ int snd_pcm_update_state(struct snd_pcm_substream *substream,
return
-
EPIPE
;
}
}
if
(
!
runtime
->
nowake
&&
avail
>=
runtime
->
control
->
avail_min
)
wake_up
(
&
runtime
->
sleep
);
if
(
avail
>=
runtime
->
control
->
avail_min
)
wake_up
(
runtime
->
twake
?
&
runtime
->
tsleep
:
&
runtime
->
sleep
);
return
0
;
}
...
...
@@ -1706,7 +1706,7 @@ static int wait_for_avail_min(struct snd_pcm_substream *substream,
long
tout
;
init_waitqueue_entry
(
&
wait
,
current
);
add_wait_queue
(
&
runtime
->
sleep
,
&
wait
);
add_wait_queue
(
&
runtime
->
t
sleep
,
&
wait
);
for
(;;)
{
if
(
signal_pending
(
current
))
{
err
=
-
ERESTARTSYS
;
...
...
@@ -1749,7 +1749,7 @@ static int wait_for_avail_min(struct snd_pcm_substream *substream,
break
;
}
_endloop:
remove_wait_queue
(
&
runtime
->
sleep
,
&
wait
);
remove_wait_queue
(
&
runtime
->
t
sleep
,
&
wait
);
*
availp
=
avail
;
return
err
;
}
...
...
@@ -1808,7 +1808,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
goto
_end_unlock
;
}
runtime
->
no
wake
=
1
;
runtime
->
t
wake
=
1
;
while
(
size
>
0
)
{
snd_pcm_uframes_t
frames
,
appl_ptr
,
appl_ofs
;
snd_pcm_uframes_t
avail
;
...
...
@@ -1830,7 +1830,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
if
(
frames
>
cont
)
frames
=
cont
;
if
(
snd_BUG_ON
(
!
frames
))
{
runtime
->
no
wake
=
0
;
runtime
->
t
wake
=
0
;
snd_pcm_stream_unlock_irq
(
substream
);
return
-
EINVAL
;
}
...
...
@@ -1869,7 +1869,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
}
}
_end_unlock:
runtime
->
no
wake
=
0
;
runtime
->
t
wake
=
0
;
if
(
xfer
>
0
&&
err
>=
0
)
snd_pcm_update_state
(
substream
,
runtime
);
snd_pcm_stream_unlock_irq
(
substream
);
...
...
@@ -2030,7 +2030,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
goto
_end_unlock
;
}
runtime
->
no
wake
=
1
;
runtime
->
t
wake
=
1
;
while
(
size
>
0
)
{
snd_pcm_uframes_t
frames
,
appl_ptr
,
appl_ofs
;
snd_pcm_uframes_t
avail
;
...
...
@@ -2059,7 +2059,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
if
(
frames
>
cont
)
frames
=
cont
;
if
(
snd_BUG_ON
(
!
frames
))
{
runtime
->
no
wake
=
0
;
runtime
->
t
wake
=
0
;
snd_pcm_stream_unlock_irq
(
substream
);
return
-
EINVAL
;
}
...
...
@@ -2092,7 +2092,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
xfer
+=
frames
;
}
_end_unlock:
runtime
->
no
wake
=
0
;
runtime
->
t
wake
=
0
;
if
(
xfer
>
0
&&
err
>=
0
)
snd_pcm_update_state
(
substream
,
runtime
);
snd_pcm_stream_unlock_irq
(
substream
);
...
...
sound/core/pcm_native.c
浏览文件 @
8b296c8f
...
...
@@ -919,6 +919,7 @@ static void snd_pcm_post_stop(struct snd_pcm_substream *substream, int state)
runtime
->
status
->
state
=
state
;
}
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
tsleep
);
}
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)
SNDRV_TIMER_EVENT_MPAUSE
,
&
runtime
->
trigger_tstamp
);
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
tsleep
);
}
else
{
runtime
->
status
->
state
=
SNDRV_PCM_STATE_RUNNING
;
if
(
substream
->
timer
)
...
...
@@ -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
->
state
=
SNDRV_PCM_STATE_SUSPENDED
;
wake_up
(
&
runtime
->
sleep
);
wake_up
(
&
runtime
->
tsleep
);
}
static
struct
action_ops
snd_pcm_action_suspend
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录