[HELP] Configure Mopidy to use ALSA USB Soundcard

Hi,

totally new to Mopidy, I try to set the Mopidy’s configuration file on my Ubuntu to use the SPDIF output of my USB card with ALSA.
So if I try gst-launch-1.0 audiotestsrc ! audioresample ! alsasink I can hear the sound through the HDMI but I don’t know what to write in the mopidy.conf file in order to use the USB -> SPDIF output
The output of aplay -L :

default:CARD=PCH
HDA Intel PCH, ALC262 Analog
Default Audio Device
sysdefault:CARD=PCH
HDA Intel PCH, ALC262 Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
Front speakers
surround21:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
HDA Intel PCH, HDMI 0
HDMI Audio Output
hdmi:CARD=PCH,DEV=1
HDA Intel PCH, HDMI 1
HDMI Audio Output
dmix:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
Direct sample mixing device
dmix:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct sample mixing device
dmix:CARD=PCH,DEV=7
HDA Intel PCH, HDMI 1
Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
Direct sample snooping device
dsnoop:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct sample snooping device
dsnoop:CARD=PCH,DEV=7
HDA Intel PCH, HDMI 1
Direct sample snooping device
hw:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
Direct hardware device without any conversions
hw:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct hardware device without any conversions
hw:CARD=PCH,DEV=7
HDA Intel PCH, HDMI 1
Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
HDA Intel PCH, ALC262 Analog
Hardware device with all software conversions
plughw:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Hardware device with all software conversions
plughw:CARD=PCH,DEV=7
HDA Intel PCH, HDMI 1
Hardware device with all software conversions
default:CARD=MicroII
Default Audio Device
sysdefault:CARD=MicroII
Default Audio Device
front:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
Front speakers
surround21:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
Direct sample mixing device
dsnoop:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
Direct sample snooping device
hw:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
Direct hardware device without any conversions
plughw:CARD=MicroII,DEV=0
Audio Advantage MicroII, USB Audio
Hardware device with all software conversions

Output of
cat /proc/asound/cards
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0x81c14000 irq 323
1 [MicroII ]: USB-Audio - Audio Advantage MicroII
C-Media INC. Audio Advantage MicroII at usb-0000:00:14.0-2.1, full speed

So what parameter should I use with audio/ output = alsasink parameter in order to select the USB -> SPDIF ?

Thank you !

Nevermind, solved myself. Thank you :wink: !

what did you do to fix it? i have same problem.

i have similar issue, Mopidy can play on my on-board sound card device, but when i set the alsa default to USB DAC, Mopdiy cannot play on it.
below is the warning i got.
2019-01-03 11:03:48,519 WARNING [1642:Audio-2] mopidy.audio.actor: Setting GStreamer state to GST_STATE_PLAYING failed

in mopidy.conf
i just set the audio/output to alsasink

what i am missing?
could you share your fix?
thanks!
Joseph

You can name your device and explicitly set it as per here. Or specify the device using the syntax device=hw:X,Y where X and Y can be found for your device using aplay -l.

Or you could take a look at using gst-launch-1.0 as per our documentation to debug what’s going on. i.e.

gst-launch-1.0 audiotestsrc ! audioresample ! alsasink device=hw:1,0

Or you could provide a better explanation of exactly what you are doing as this is much too vague.

  • Output of aplay -l
  • Output of cat /etc/asound.conf
  • Output of sudo mopidyctl config