这是我可用的卡片(在命令之间添加了额外的换行符以提高可读性):
audiohub@DYM-Portable-AudioHub:~$ sudo aplay -l
[sudo] password for audiohub:
**** List of PLAYBACK Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: X18XR18 [X18/XR18], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
audiohub@DYM-Portable-AudioHub:~$ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=sunxicodec
sunxi-CODEC, sunxi PCM
Default Audio Device
dmix:CARD=sunxicodec,DEV=0
sunxi-CODEC, sunxi PCM
Direct sample mixing device
dsnoop:CARD=sunxicodec,DEV=0
sunxi-CODEC, sunxi PCM
Direct sample snooping device
hw:CARD=sunxicodec,DEV=0
sunxi-CODEC, sunxi PCM
Direct hardware device without any conversions
plughw:CARD=sunxicodec,DEV=0
sunxi-CODEC, sunxi PCM
Hardware device with all software conversions
sysdefault:CARD=CODEC
USB Audio CODEC, USB Audio
Default Audio Device
front:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
Front speakers
surround40:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
Direct sample mixing device
dsnoop:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
Direct sample snooping device
hw:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
Direct hardware device without any conversions
plughw:CARD=CODEC,DEV=0
USB Audio CODEC, USB Audio
Hardware device with all software conversions
sysdefault:CARD=X18XR18
X18/XR18, USB Audio
Default Audio Device
front:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
Front speakers
surround40:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
Direct sample mixing device
dsnoop:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
Direct sample snooping device
hw:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
Direct hardware device without any conversions
plughw:CARD=X18XR18,DEV=0
X18/XR18, USB Audio
Hardware device with all software conversions
audiohub@DYM-Portable-AudioHub:~$
板载sunxicodec
没用,USBCODEC
完全被占用了,为了一个不同的功能,我想mpd
在USB上玩X18XR18
。不管我放什么/etc/mpd.conf
,gmpc
总是说:
我目前有这个:
audio_output {
type "alsa"
name "XR18"
device "hw:2,0"
# format "48000:32:2"
}
它与 ( ) 做同样的事情"hw:1,0"
,CODEC
但它确实与"hw:0,0"
( sunxicodec
) 一起玩。不幸的是,那张卡需要一些额外的配置才能使用模拟而不是 HDMI,所以我还没有真正听到它,看看它是否听起来还不错。
我知道这两张 USB 卡可以工作,因为CODEC
它的功能使用它的软件是完美的,因为audacious
可以播放X18XR18
,因为我可以同时arecord
X18XR18
:
#!/bin/sh
REC_PATH=/home/audiohub/Recordings
arecord --device=hw:CARD=X18XR18,DEV=0 --channels=18 --file-type=wav --format=S32_LE --rate=48000 --buffer-time=20000000 --max-file-time 300 "$REC_PATH/all_tracks.wav" &
# Force a filesystem sync every 1 second to keep the buffer small enough to write without missing samples
while true
do
sleep 1
sync
done
我也尝试了, 而不是的"hw:CARD=X18XR18,DEV=0"
格式,但它做了同样的事情。/etc/mpd.conf
"hw:2,0"
aplay
做这个:
audiohub@DYM-Portable-AudioHub:~$ aplay --device=hw:CARD=X18XR18,DEV=0 --format=S32_LE --rate=48000 "/home/audiohub/Music/Waterlines/05 - Take Your Time.wav"
Playing WAVE '/home/audiohub/Music/Waterlines/05 - Take Your Time.wav' : Float 32 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1233: Sample format non available
Available formats:
- S32_LE
audiohub@DYM-Portable-AudioHub:~$
不坚持使用的原因audacious
,即使它有效,是它依赖 VNC 进行控制(这个播放器/记录器是无头的)并且 VNC 服务器在一段时间后挂断并需要重新启动。由于点唱机是唯一真正需要 GUI 控制并且mpd
似乎可以完成我需要的一切的东西,因此我宁愿拥有它而不是audacious
.
除了我迄今为止尝试过的之外,有什么想法可以让它发挥作用吗?
设备支持的唯一格式是 S32_LE。如果 mpd 无法从文件的示例格式转换为该格式,那么您必须使用可以进行转换的 ALSA 设备(如果需要);即,替换
hw
为plughw
.