云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > alsa声卡dev_snd_pcmC0D0p的open打开流程

alsa声卡dev_snd_pcmC0D0p的open打开流程

  • 62 次阅读
  • 3 次下载
  • 2025/6/20 18:37:35

cnt = igetdword(chip, ICHREG(ALI_SCR)); cnt &= ~ICH_ALI_SC_PCM_246_MASK; if (runtime->channels == 4 || dbl) cnt |= ICH_ALI_SC_PCM_4; else if (runtime->channels == 6) cnt |= ICH_ALI_SC_PCM_6;

iputdword(chip, ICHREG(ALI_SCR), cnt); break;

case DEVICE_SIS:

cnt = igetdword(chip, ICHREG(GLOB_CNT)); cnt &= ~ICH_SIS_PCM_246_MASK; if (runtime->channels == 4 || dbl) cnt |= ICH_SIS_PCM_4;

else if (runtime->channels == 6) cnt |= ICH_SIS_PCM_6;

iputdword(chip, ICHREG(GLOB_CNT), cnt); break; default:

cnt = igetdword(chip, ICHREG(GLOB_CNT));

cnt &= ~(ICH_PCM_246_MASK | ICH_PCM_20BIT); if (runtime->channels == 4 || dbl) cnt |= ICH_PCM_4;

else if (runtime->channels == 6) cnt |= ICH_PCM_6;

else if (runtime->channels == 8) cnt |= ICH_PCM_8;

if (chip->device_type == DEVICE_NFORCE) {

/* reset to 2ch once to keep the 6 channel data in alignment, * to start from Front Left always */

if (cnt & ICH_PCM_246_MASK) {

iputdword(chip, ICHREG(GLOB_CNT), cnt & ~ICH_PCM_246_MASK); spin_unlock_irq(&chip->reg_lock);

msleep(50); /* grrr... */

spin_lock_irq(&chip->reg_lock); }

} else if (chip->device_type == DEVICE_INTEL_ICH4) { if (runtime->sample_bits > 16) cnt |= ICH_PCM_20BIT; }

iputdword(chip, ICHREG(GLOB_CNT), cnt); break; }

spin_unlock_irq(&chip->reg_lock);

}

ioctl(SNDRV_PCM_IOCTL_START) ==> snd_pcm_playback_ioctl ==> snd_pcm_playback_ioctl1 ==> snd_pcm_common_ioctl1

==> snd_pcm_action_lock_irq(&snd_pcm_action_start, substream, SNDRV_PCM_STATE_RUNNING); ==> snd_pcm_action_single // state等于SNDRV_PCM_STATE_RUNNING static struct action_ops snd_pcm_action_start = { .pre_action = snd_pcm_pre_start, .do_action = snd_pcm_do_start,

.undo_action = snd_pcm_undo_start,

.post_action = snd_pcm_post_start };

ops->pre_action(substream, state); ops->do_action(substream, state); ops->post_action(substream, state);

上面ops就是之前提到的snd_pcm_action_start

==> snd_pcm_do_start

==> substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START);即snd_intel8x0_playback_ops.trigger

==> snd_intel8x0_pcm_trigger启动ac97数据传输

以上都只是执行一次[luther.gliethttp]

只要发送音频数据,就会执行该ioctl更新pointer

ioctl(SNDRV_PCM_IOCTL_HWSYNC) ==> snd_pcm_playback_ioctl ==> snd_pcm_playback_ioctl1 ==> snd_pcm_common_ioctl1 ==> snd_pcm_hwsync

case SNDRV_PCM_STATE_RUNNING:

if ((err = snd_pcm_update_hw_ptr(substream)) < 0)

break;

==> snd_pcm_update_hw_ptr

==> snd_pcm_update_hw_ptr_post ==> snd_pcm_update_hw_ptr_pos

==> substream->ops->pointer(substream);即snd_intel8x0_playback_ops.pointer

==> snd_intel8x0_pcm_pointer // 更新dma缓冲区数据最后可用数据索引值[luther.gliethttp]

搜索更多关于: alsa声卡dev_snd_pcmC0D0p的open打开流 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

cnt = igetdword(chip, ICHREG(ALI_SCR)); cnt &= ~ICH_ALI_SC_PCM_246_MASK; if (runtime->channels == 4 || dbl) cnt |= ICH_ALI_SC_PCM_4; else if (runtime->channels == 6) cnt |= ICH_ALI_SC_PCM_6; iputdword(chip, ICHREG(ALI_SCR), cnt); break; case DEVICE_SIS: cnt = igetdword(chip, ICHREG(GLOB_CNT)

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com