0

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:

enter image description here

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?

8
  • Does aplay with that device work? What users are allowed to access the device nodes in /dev/snd/? What user does mpd run as?
    – CL.
    Dec 2, 2016 at 7:43
  • @CL. That generated way too much information for a comment, so I added it to the question.
    – AaronD
    Dec 2, 2016 at 19:54
  • --format has no effect; the actual format of the .wav file is used. Try plughw instead of hw. Use ls -l /dev/snd/.
    – CL.
    Dec 2, 2016 at 20:07
  • @CL. I think we're getting closer, but not quite there yet. I updated the question again. Please don't tell me that /etc/mpd.conf requires a numbered device because I've seen them swap.
    – AaronD
    Dec 2, 2016 at 20:40
  • I guess mpd plays to the wrong channels, or some mixer control is not set correctly.
    – CL.
    Dec 2, 2016 at 21:56

1 Answer 1

1

The only format supported by the device is S32_LE. If mpd is not able to convert from the file's sample format to that, then you have to use an ALSA device that can do the conversion, if needed; i.e., replace hw with plughw.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.