Home Assistant and remote MPD player not sound

Hello,
My configuration:
VPS on Debian 10
Home Assistant 0.116.4
Docker 19.03.13
Installed addon Mopidy and create media player:

media_player:

  • platform: mpd
    host: IP_my_server

I install MPD client for Android(Mpdroid, M.A.L.P) and set IP my VPS in settings and try run service from example:

entity_id: media_player.mpd
media_content_id: ‘https://mydomain.tld/local/1.mp3
media_content_type: music

MPD client get my request and i see url and filename, but when he running, then my android device do not playing sound
As if this file is empty, but in reality it is not.
The volume in android is at maximum and I have tried several android devices, the problem is the same everywhere.
Can you help me?
Mopidy conf:

local_scan: true
options:

  • name: http/enabled
    value: ‘true’
  • name: stream/enabled
    value: ‘true’
  • name: stream/protocols
    value: http
  • name: stream/protocols
    value: https
  • name: local/media_dir
    value: /share/mopidy/media
Full log Mopidy:

INFO Starting Mopidy 2.2.2
INFO Loading config from builtin defaults
INFO Loading config from /var/lib/mopidy/.config/mopidy/mopidy.conf
INFO Loading config from command line options
INFO Enabled extensions: iris, mpd, http, file, stream, m3u, softwaremixer, moped, local-images, local, local-sqlite
INFO Disabled extensions: spotify, gmusic
WARNING Found gmusic configuration errors, the extension has been automatically disabled:
WARNING gmusic/username must be set.
WARNING gmusic/password must be set.
WARNING Found spotify configuration errors, the extension has been automatically disabled:
WARNING spotify/username must be set.
WARNING spotify/client_secret must be set.
WARNING spotify/password must be set.
WARNING spotify/client_id must be set.
WARNING Please fix the extension configuration errors or disable the extensions to silence these messages.
INFO Starting Mopidy mixer: SoftwareMixer
INFO Starting Mopidy audio
INFO Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend
WARNING Local media dir /share/mopidy/media does not exist or we lack permissions to the directory or one of its parents
INFO Loaded 0 local tracks using sqlite
INFO Starting Mopidy core
INFO Audio output set to “autoaudiosink”
INFO Starting Mopidy frontends: IrisFrontend, MpdFrontend, HttpFrontend
INFO MPD server running at [::ffff:0.0.0.0]:6600
INFO Starting Iris 3.33.0
INFO Starting GLib mainloop
INFO HTTP server running at [::ffff:0.0.0.0]:6680
INFO New MPD connection from [::ffff:X.X.X.X]:6600

I see the cover of the song, the time that the track is running. But there is no sound.

Better late than never!

I had the same issue, the root cause is that entry for hardware is not correct for your mpd player and hence not pointing to speakers.

So on the machine where mpd is installed, edit the /etc/mpd.conf file and look for line under “audio_output” for ALSA that reads:

device “hw:0,0”

The first “0” is for the sound card number and the second “0” is for the position of speaker on the sound card. Most likely (0,0) should work for most cases but that does not seem to be your case.

From command line run “aplay -l” to list all the cards and devices attached to it. In my case the speakers are attached at (1,0) which solved the problem for me.

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD1984A Analog [AD1984A Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: AD1984A Alt Analog [AD1984A Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: AUDIO [USB  AUDIO], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Hope this helps others who may have the same problem

1 Like