Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15358670
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: LINUX

2009-11-19 14:05:50

snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, const void __user *buf, snd_pcm_uframes_t size)
{
    struct snd_pcm_runtime *runtime;
    int nonblock;
    int err;

    err = pcm_sanity_check(substream);
    if (err < 0)
        return err;
    runtime = substream->runtime;
    nonblock = !!(substream->f_flags & O_NONBLOCK);

    if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED &&
        runtime->channels > 1)
        return -EINVAL;
    // 调用snd_pcm_lib_write_transfer将buf中的size大小音频数据发送到外围音频硬件[luther.gliethttp]
    return snd_pcm_lib_write1(substream, (unsigned long)buf, size, nonblock,
                  snd_pcm_lib_write_transfer); 《浅析alsa声卡驱动snd_pcm_lib_write1函数》
}
阅读(3782) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~