首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用aplay并在卡上选择要使用的输出。

使用aplay并在卡上选择要使用的输出。
EN

Unix & Linux用户
提问于 2016-03-16 00:04:27
回答 1查看 28.3K关注 0票数 5

我有一个xmos-200板,可以记录8个频道,并通过8个渠道推动输出。我要把重点放在输出上。

对于输出,有4个3.5mm千斤顶,每个通道2个。这个板是Linux认可的,播放-L显示

代码语言:javascript
复制
sysdefault:CARD=x20
    xCORE USB Audio 2.0, USB Audio
    Default Audio Device
front:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    Front speakers
surround40:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    Direct sample mixing device
dsnoop:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    Direct sample snooping device
hw:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    Direct hardware device without any conversions
plughw:CARD=x20,DEV=0
    xCORE USB Audio 2.0, USB Audio
    Hardware device with all software conversions

我可以播放来自所有输出端口和所有通道的音频文件

代码语言:javascript
复制
aplay --device plughw:CARD=x20,DEV=0 camera.wav

我想选择哪一个的4立体声输出是使用。对我怎么做有帮助吗?

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2016-03-16 08:10:14

这四个插孔在物理上是分开的,但是软件只看到一个8通道的设备。

您可以使用ALSA插件拆分此设备:

代码语言:javascript
复制
pcm_slave.eightchannels {
    pcm "hw:x20,0"
    channels 8
    rate 48000     # or whatever
}

pcm.stereo1 {
    type plug
    slave.pcm {
        type dshare
        ipc_key 20160316     # any random but unique number
        slave eightchannels
        bindings [ 0 1 ]
    }
}
pcm.stereo2 {
    type plug
    slave.pcm {
        type dshare
        ipc_key 20160316
        slave eightchannels
        bindings [ 2 3 ]
    }
}
pcm.stereo3 {
    type plug
    slave.pcm {
        type dshare
        ipc_key 20160316
        slave eightchannels
        bindings [ 4 5 ]
    }
}
pcm.stereo4 {
    type plug
    slave.pcm {
        type dshare
        ipc_key 20160316
        slave eightchannels
        bindings [ 6 7 ]
    }
}

若要允许多个应用程序使用相同的立体声设备,请将dshare替换为dmix

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

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

复制
相关文章

相似问题

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