Here are my available cards (extra newline added between commands for readability):
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:~$
The on-board sunxicodec
is not used, the USB CODEC
is completely occupied for a different function, and I want mpd
to play on the USB X18XR18
. No matter what I put in /etc/mpd.conf
, gmpc
always says:
I presently have this:
audio_output {
type "alsa"
name "XR18"
device "hw:2,0"
# format "48000:32:2"
}
It does the same thing with "hw:1,0"
(CODEC
), but it does play with "hw:0,0"
(sunxicodec
). Unfortunately, that card requires some extra configuration to make it use analog instead of HDMI, so I haven't actually heard it to see if it sounds okay.
I know that the two USB cards work because CODEC
's function is flawless using its software, because audacious
plays on X18XR18
, and because I can simultaneously 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
I also tried the "hw:CARD=X18XR18,DEV=0"
format in /etc/mpd.conf
, instead of "hw:2,0"
, but it did the same thing.
aplay
does this:
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:~$
The reason to not stick with audacious
, even though it works, is that it relies on VNC for control (this player/recorder is headless) and the VNC server hangs up after a while and requires a reboot. Since the jukebox is the only thing that really needs GUI control and mpd
appears to do everything I need, I'd rather have that than audacious
.
Any ideas to make it work, beyond what I've tried so far?
aplay
with that device work? What users are allowed to access the device nodes in/dev/snd/
? What user doesmpd
run as?--format
has no effect; the actual format of the .wav file is used. Tryplughw
instead ofhw
. Usels -l /dev/snd/
./etc/mpd.conf
requires a numbered device because I've seen them swap.