Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
65ee2ba3
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
65ee2ba3
编写于
7月 05, 2010
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'devel' of
git://git.alsa-project.org/alsa-kernel
into topic/misc
上级
b415ec70
08b45098
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
16 deletion
+25
-16
include/sound/pcm.h
include/sound/pcm.h
+1
-1
sound/core/pcm_lib.c
sound/core/pcm_lib.c
+15
-8
sound/pci/sis7019.c
sound/pci/sis7019.c
+9
-7
未找到文件。
include/sound/pcm.h
浏览文件 @
65ee2ba3
...
...
@@ -317,7 +317,7 @@ struct snd_pcm_runtime {
struct
snd_pcm_mmap_control
*
control
;
/* -- locking / scheduling -- */
unsigned
int
twake
:
1
;
/* do transfer (!poll) wakeup
*/
snd_pcm_uframes_t
twake
;
/* do transfer (!poll) wakeup if non-zero
*/
wait_queue_head_t
sleep
;
/* poll sleep */
wait_queue_head_t
tsleep
;
/* transfer sleep */
struct
fasync_struct
*
fasync
;
...
...
sound/core/pcm_lib.c
浏览文件 @
65ee2ba3
...
...
@@ -287,8 +287,11 @@ int snd_pcm_update_state(struct snd_pcm_substream *substream,
return
-
EPIPE
;
}
}
if
(
avail
>=
runtime
->
control
->
avail_min
)
wake_up
(
runtime
->
twake
?
&
runtime
->
tsleep
:
&
runtime
->
sleep
);
if
(
runtime
->
twake
)
{
if
(
avail
>=
runtime
->
twake
)
wake_up
(
&
runtime
->
tsleep
);
}
else
if
(
avail
>=
runtime
->
control
->
avail_min
)
wake_up
(
&
runtime
->
sleep
);
return
0
;
}
...
...
@@ -1707,7 +1710,7 @@ EXPORT_SYMBOL(snd_pcm_period_elapsed);
* The available space is stored on availp. When err = 0 and avail = 0
* on the capture stream, it indicates the stream is in DRAINING state.
*/
static
int
wait_for_avail
_min
(
struct
snd_pcm_substream
*
substream
,
static
int
wait_for_avail
(
struct
snd_pcm_substream
*
substream
,
snd_pcm_uframes_t
*
availp
)
{
struct
snd_pcm_runtime
*
runtime
=
substream
->
runtime
;
...
...
@@ -1757,7 +1760,7 @@ static int wait_for_avail_min(struct snd_pcm_substream *substream,
avail
=
snd_pcm_playback_avail
(
runtime
);
else
avail
=
snd_pcm_capture_avail
(
runtime
);
if
(
avail
>=
runtime
->
control
->
avail_min
)
if
(
avail
>=
runtime
->
twake
)
break
;
}
_endloop:
...
...
@@ -1820,7 +1823,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
goto
_end_unlock
;
}
runtime
->
twake
=
1
;
runtime
->
twake
=
runtime
->
control
->
avail_min
?
:
1
;
while
(
size
>
0
)
{
snd_pcm_uframes_t
frames
,
appl_ptr
,
appl_ofs
;
snd_pcm_uframes_t
avail
;
...
...
@@ -1833,7 +1836,9 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(struct snd_pcm_substream *substream,
err
=
-
EAGAIN
;
goto
_end_unlock
;
}
err
=
wait_for_avail_min
(
substream
,
&
avail
);
runtime
->
twake
=
min_t
(
snd_pcm_uframes_t
,
size
,
runtime
->
control
->
avail_min
?
:
1
);
err
=
wait_for_avail
(
substream
,
&
avail
);
if
(
err
<
0
)
goto
_end_unlock
;
}
...
...
@@ -2042,7 +2047,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
goto
_end_unlock
;
}
runtime
->
twake
=
1
;
runtime
->
twake
=
runtime
->
control
->
avail_min
?
:
1
;
while
(
size
>
0
)
{
snd_pcm_uframes_t
frames
,
appl_ptr
,
appl_ofs
;
snd_pcm_uframes_t
avail
;
...
...
@@ -2060,7 +2065,9 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(struct snd_pcm_substream *substream,
err
=
-
EAGAIN
;
goto
_end_unlock
;
}
err
=
wait_for_avail_min
(
substream
,
&
avail
);
runtime
->
twake
=
min_t
(
snd_pcm_uframes_t
,
size
,
runtime
->
control
->
avail_min
?
:
1
);
err
=
wait_for_avail
(
substream
,
&
avail
);
if
(
err
<
0
)
goto
_end_unlock
;
if
(
!
avail
)
...
...
sound/pci/sis7019.c
浏览文件 @
65ee2ba3
...
...
@@ -264,11 +264,13 @@ static void sis_update_voice(struct voice *voice)
* if using small periods.
*
* If we're less than 9 samples behind, we're on target.
* Otherwise, shorten the next vperiod by the amount we've
* been delayed.
*/
if
(
sync
>
-
9
)
voice
->
vperiod
=
voice
->
sync_period_size
+
1
;
else
voice
->
vperiod
=
voice
->
sync_period_size
-
4
;
voice
->
vperiod
=
voice
->
sync_period_size
+
sync
+
10
;
if
(
voice
->
vperiod
<
voice
->
buffer_size
)
{
sis_update_sso
(
voice
,
voice
->
vperiod
);
...
...
@@ -736,7 +738,7 @@ static void sis_prepare_timing_voice(struct voice *voice,
period_size
=
buffer_size
;
/* Initially, we want to interrupt just a bit behind the end of
* the period we're clocking out. 1
0
samples seems to give a good
* the period we're clocking out. 1
2
samples seems to give a good
* delay.
*
* We want to spread our interrupts throughout the virtual period,
...
...
@@ -747,7 +749,7 @@ static void sis_prepare_timing_voice(struct voice *voice,
*
* This is all moot if we don't need to use virtual periods.
*/
vperiod
=
runtime
->
period_size
+
1
0
;
vperiod
=
runtime
->
period_size
+
1
2
;
if
(
vperiod
>
period_size
)
{
u16
tail
=
vperiod
%
period_size
;
u16
quarter_period
=
period_size
/
4
;
...
...
@@ -776,7 +778,7 @@ static void sis_prepare_timing_voice(struct voice *voice,
*/
timing
->
flags
|=
VOICE_SYNC_TIMING
;
timing
->
sync_base
=
voice
->
ctrl_base
;
timing
->
sync_cso
=
runtime
->
period_size
-
1
;
timing
->
sync_cso
=
runtime
->
period_size
;
timing
->
sync_period_size
=
runtime
->
period_size
;
timing
->
sync_buffer_size
=
runtime
->
buffer_size
;
timing
->
period_size
=
period_size
;
...
...
@@ -1047,7 +1049,7 @@ static int sis_chip_free(struct sis7019 *sis)
/* Reset the chip, and disable all interrputs.
*/
outl
(
SIS_GCR_SOFTWARE_RESET
,
sis
->
ioport
+
SIS_GCR
);
udelay
(
10
);
udelay
(
25
);
outl
(
0
,
sis
->
ioport
+
SIS_GCR
);
outl
(
0
,
sis
->
ioport
+
SIS_GIER
);
...
...
@@ -1083,7 +1085,7 @@ static int sis_chip_init(struct sis7019 *sis)
/* Reset the audio controller
*/
outl
(
SIS_GCR_SOFTWARE_RESET
,
io
+
SIS_GCR
);
udelay
(
10
);
udelay
(
25
);
outl
(
0
,
io
+
SIS_GCR
);
/* Get the AC-link semaphore, and reset the codecs
...
...
@@ -1096,7 +1098,7 @@ static int sis_chip_init(struct sis7019 *sis)
return
-
EIO
;
outl
(
SIS_AC97_CMD_CODEC_COLD_RESET
,
io
+
SIS_AC97_CMD
);
udelay
(
1
0
);
udelay
(
25
0
);
count
=
0xffff
;
while
((
inw
(
io
+
SIS_AC97_STATUS
)
&
SIS_AC97_STATUS_BUSY
)
&&
--
count
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录