首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用和配置用于立体声播放和捕捉的ALSA插件dmix和dsnoop

使用和配置用于立体声播放和捕捉的ALSA插件dmix和dsnoop
EN

Unix & Linux用户
提问于 2019-04-08 08:01:15
回答 1查看 4K关注 0票数 0

我在我的电脑上安装了一个新的基于PCI的声卡。它有8个S/PDIF的I/O对,每一行1到8作为输入和输出。我尝试使用3-8行作为输入(mics),3-8行用于输出(播放),其中:

  • 第3行+第4行=通道1(输入和输出),
  • 第5行+第6行=通道2(输入和输出),
  • 第7行+第8行=通道3(输入和输出)。

因此,我创建了以下.asoundrc

代码语言:javascript
复制
pcm.!default {
    type plug
    slave {
       pcm "hw:1,0"
    }
}

ctl.!default {
    type hw
    card 1
}


pcm.play_out_44 {
    type dmix
    ipc_key 1201
    ipc_key_add_uid true
    slave {
        pcm "hw:1,0"
        channels 2
        rate 44100
        format S32_LE
        buffer_size 4096
        period_size 1024
    }
}

pcm.rec_in_44 {
    type dsnoop
    ipc_key 1210
    slave {
        pcm "hw:1,0"
        channels 2
        rate 44100
        buffer_size 4096
        period_size 1024
    }
}


pcm.outch1 {
    type plug
    slave {
        pcm "play_out_44"
        bindings { 
            2 2
            3 3
        }
        hint.description "PCI Card Stereo output/playback channel 1 (from output ports 3 & 4)"
    }
}

pcm.inch1 {
    type plug
    slave {
        pcm "rec_in_44"
        bindings { 
            2 2
            3 3
        }
        hint.description "PCI Card Stereo input/capture channel 1 (from input ports 3 & 4)"
    }
}

pcm.outch2 {
    type plug
    slave {
        pcm "play_out_44"
        bindings { 
            4 4
            5 5
        }
        hint.description "PCI Card Stereo output/playback channel 2 (from output ports 5 & 6)"
    }
}

pcm.inch2 {
    type plug
    slave {
        pcm "rec_in_44"
        bindings { 
            4 4
            5 5
        }
        hint.description "PCI Card Stereo input/capture channel 2 (from input ports 5 & 6)"
    }
}

pcm.outch3 {
    type plug
    slave {
        pcm "play_out_44"
        bindings { 
            6 6
            7 7
        }
        hint.description "PCI Card Stereo output/playback channel 3 (from output ports 7 & 8)"
    }
}

pcm.inch3 {
    type plug
    slave {
        pcm "rec_in_44"
        bindings { 
            6 6
            7 7
        }
        hint.description "PCI Card Stereo input/capture channel 3 (from input ports 7 & 8)"
    }
}

正如前面提到的这里,我创建了一个新的dmix类型以适应我的配置。但是,当我试图打开Audacity来尝试播放和捕捉时,录音设备或播放设备列表中没有inch1inch2inch3outch1outch2outch3

如何在设备上修改或创建立体声播放和立体声捕捉的.asoundrc

EN

回答 1

Unix & Linux用户

发布于 2019-04-14 12:45:22

我用传统的立体声卡复制了outch插头的问题。我认为inch插件也有类似的问题。

问题是:这些plugs不接受字段bindingshint。我想你并不真的需要hintbindings进入dmixdsnooper (参见这里)

我想要更快地调试您的设置,而不必每次都开始大胆,下面是我要做的事情(以及我如何诊断您的问题):

  • 给您的pcms名称,是很容易的grep。我把你的名字改名了,所以它们总是以"xx“开头。
  • 运行aplay -L | grep xx。那么你至少应该看看你的pcms。我看到你剥去衣服的.asoundrc

代码语言:javascript
复制
   xxplay_out_44
   xxoutch1
  • 查找一些wav文件,例如使用locate *.wav | head
  • 使用上一步中发现的pcms之一播放wav文件。

代码语言:javascript
复制
    > aplay -D xxoutch1  /usr/share/sounds/sound-icons/xylofon.wav 
    ALSA lib pcm.c:7448:(snd_pcm_slave_conf) Unknown field bindings

现在您有了一条不错的错误消息。如果删除bindings,您将看到它抱怨hint字段。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/511175

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档