我使用的是外置声卡 (Aureon 7.1 USB)。在该声卡上,我通过数字 SPDIF 输入接收音频,我想将该音频重新路由到同一张卡上的 5.1 PCM 输出。
我正在尝试使用 JACK 和 Alsa 作为后端来实现这一点,但有点迷茫。
我可以使用 aplay 播放 6 通道 WAV 文件,没有任何问题,并且每个通道都是正确的。
~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
[...]
card 1: USB [Aureon 7.1 USB], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 2: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #
我的 PCM 输出在卡 1 上并且运行正常。
~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: USB [Aureon 7.1 USB], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
而且我也将该卡视为一个捕获设备。
USB 混音器信息中报告了这一点:
Unit: 16
Control: name="IEC958 In Capture Switch", index=0
Info: id=16, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
我相信这是我的数字输入。不过我有点担心频道=1。
然后我启动一个 jack deamon:
~$ jackd -n jack-server --no-realtime -d alsa -d hw:1 --duplex
jackdmp 1.9.17
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2021 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in non-realtime mode
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio1
creating alsa driver ... hw:1|hw:1|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 2 periods for playback
我使用 --no-realtime,因为我的操作系统似乎不支持它,hw:1 作为硬件设备并使用双工进行输入/输出。
现在我可以列出端口:
~ $ jack_lsp -s jack-server -tAc
system:capture_1
alsa_pcm:hw:1:out1
32 bit float mono audio
system:capture_2
alsa_pcm:hw:1:out2
32 bit float mono audio
system:playback_1
alsa_pcm:hw:1:in1
32 bit float mono audio
system:playback_2
alsa_pcm:hw:1:in2
32 bit float mono audio
system:playback_3
alsa_pcm:hw:1:in3
32 bit float mono audio
system:playback_4
alsa_pcm:hw:1:in4
32 bit float mono audio
system:playback_5
alsa_pcm:hw:1:in5
32 bit float mono audio
system:playback_6
alsa_pcm:hw:1:in6
32 bit float mono audio
system:playback_7
alsa_pcm:hw:1:in7
32 bit float mono audio
system:playback_8
alsa_pcm:hw:1:in8
32 bit float mono audio
我在这里卡住了。下一步是什么?看起来好像每个单独的 PCM 通道都单独列出,但我只有两个输入捕获端口(其中一个可能是我不使用的线路输入)。
将数字输入连接到 PCM 输出的下一步是什么?