Page 1 of 1

MPD httpd Streaming issue

Posted: May 3rd, 2020, 8:21 pm
by redstar
I have MPD setup and working with MPDroid on my phone as well as outputting through ALSA locally on my Arch desktop (not enabled in config below, just did this to test).

However, both ympd the web GUI and persephone the GUI player on my MacOS are not outputting audio. I am not getting any errors. I have tried different web browsers and operating systems for ympd but something tells me its an MPD issue as persephone wasn't working either. I have also tried mixer_type "software" in MPD conf which opens up volume control on persephone and ympd but still no audio output. Any ideas?

MPD config:

Code: Select all

music_directory         "~/music"
playlist_directory              "~/.config/mpd/playlists"
db_file                 "~/.config/mpd/database"
log_file                        "syslog"
pid_file                        "~/.config/mpd/pid"
state_file                      "~/.config/mpd/state"
sticker_file                    "~/.config/mpd/sticker.sql"
bind_to_address         "any"
port                            "6600"
restore_paused "yes"
save_absolute_paths_in_playlists        "no"
auto_update     "yes"
input {
    plugin "curl"
}
audio_output {
    type            "httpd"
    name            "HTTP Stream"
    encoder         "lame"          # optional, vorbis or lame
port                "8000"
    bitrate         "128"                   # do not define if quality is defined

    format          "44100:16:1"
always_on   "yes"
mixer_type  "software"
}
replaygain                      "auto"
Logs

Code: Select all

$ mpd --no-daemon --stdout --verbose
config_file: loading file /home/adam/.config/mpd/mpd.conf
exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.6
opus: libopus 1.3.1
sndfile: libsndfile-1.0.28
hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled
exception: Decoder plugin 'wildmidi' is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
simple_db: reading DB
exception: Input plugin 'tidal' is unavailable: No Tidal application token configured
exception: Input plugin 'qobuz' is unavailable: No Qobuz app_id configured
curl: version 7.69.1
curl: with OpenSSL/1.1.1g
avahi: Initializing interface
exception: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
avahi: Client changed to state 101
avahi: Client is CONNECTING
state_file: Loading state file /home/adam/.config/mpd/state
inotify: initializing inotify
inotify: watching music directory
mpd --version

Code: Select all

Database plugins:
 simple proxy upnp

Storage plugins:
 local smbclient udisks nfs curl

Neighbor plugins:
 smbclient upnp udisks

Decoders plugins:
 [mad] mp3 mp2
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [faad] aac
 [mpcdec] mpc
 [wavpack] wv
[modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
 [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
 [wildmidi] mid
 [fluidsynth] mid
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe alsa ao oss openal solaris pulse jack httpd recorder

Encoder plugins:
 null vorbis opus lame twolame wave flac

Archive plugins:
 [bz2] bz2
 [zzip] zip
 [iso] iso

Input plugins:
 file archive alsa tidal qobuz curl ffmpeg smbclient nfs mms cdio_paranoia

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// alsa:// tidal:// qobuz:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// smb:// nfs:// mms:// mmsh:// mmst:// mmsu:// cdda://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

Re: MPD httpd Streaming issue

Posted: May 4th, 2020, 10:41 am
by max
Your "mpd --version" output doesn't show a version number, you omitted it.
Your log shows that MPD never played anything, and no client was ever connected.

Re: MPD httpd Streaming issue

Posted: May 8th, 2020, 2:30 am
by redstar
Oops, mistake on the mpd --version.

Code: Select all

$ mpd --version
Music Player Daemon 0.21.23 (0.21.23)
  Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
  Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  Database plugins:
   simple proxy upnp
  
  Storage plugins:
   local smbclient udisks nfs curl
  
  Neighbor plugins:
   smbclient upnp udisks
  
  Decoders plugins:
   [mad] mp3 mp2
   [mpg123] mp3
   [vorbis] ogg oga
   [oggflac] ogg oga
   [flac] flac
   [opus] opus ogg oga
   [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
   [audiofile] wav au aiff aif
   [dsdiff] dff
   [dsf] dsf
   [hybrid_dsd] m4a
   [faad] aac
   [mpcdec] mpc
   [wavpack] wv
   [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
   [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
   [wildmidi] mid
   [fluidsynth] mid
   [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dx  a eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve m  vi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid   uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
   [gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
   [pcm]

Filters:
   libsamplerate soxr
  
  Tag plugins:
   id3tag
  
  Output plugins:
   shout null fifo pipe alsa ao oss openal solaris pulse jack httpd recorder
  
  Encoder plugins:
   null vorbis opus lame twolame wave flac
  
  Archive plugins:
   [bz2] bz2
   [zzip] zip
   [iso] iso
  
  Input plugins:
   file archive alsa tidal qobuz curl ffmpeg smbclient nfs mms cdio_paranoia
  
  Playlist plugins:
   extm3u m3u pls xspf asx rss soundcloud flac cue embcue
  
  Protocols:
   file:// alsa:// tidal:// qobuz:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// smb:// nfs:// mms:// mmsh:// mmst:// mmsu:// cdda://
  
  Other features:
   avahi dbus udisks epoll icu inotify ipv6 systemd tcp un
Regarding the logs, I had just posted those thinking the settings would be a good indication of any possible issue but I didn't even think to show logs from connection. So sorry, I appreciate your patience and corrections!

logs:

Code: Select all

$ mpd --no-daemon --stdout --verbose
config_file: loading file /home/adam/.config/mpd/mpd.conf
exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.6
opus: libopus 1.3.1
sndfile: libsndfile-1.0.28
hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled
exception: Decoder plugin 'wildmidi' is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
simple_db: reading DB
exception: Input plugin 'tidal' is unavailable: No Tidal application token configured
exception: Input plugin 'qobuz' is unavailable: No Qobuz app_id configured
curl: version 7.69.1
curl: with OpenSSL/1.1.1g
avahi: Initializing interface
exception: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
avahi: Client changed to state 101
avahi: Client is CONNECTING
state_file: Loading state file /home/adam/.config/mpd/state
decoder_thread: probing plugin mad
playlist: queue song 0:"Animal Collective/Merriweather Post Pavilion/02 My Girls.mp3"
inotify: initializing inotify
decoder: audio_format=44100:24:2, seekable=true
inotify: watching music directory
exception: OutputThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
exception: bind to '0.0.0.0:8000' failed (continuing anyway, because binding to '[::]:8000' succeeded): Failed to bind socket: Address already in use
client: [0] opened from 127.0.0.1:53794
client: [0] process command "outputs"
client: [0] command returned 0
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "outputs"
client: [0] command returned 0
client: [0] process command "pause"
output: opened "HTTP Stream" (httpd) audio_format=44100:16:2
output: converting in=44100:24:2 -> f=44100:16:2 -> out=44100:16:2
client: [0] command returned 0
replay_gain: replay gain mode has changed off->album
replay_gain: scale=1.000000
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "outputs"
client: [0] command returned 0
^Cstate_file: Saving state file /home/adam/.config/mpd/state
avahi: Shutting down interface
player: played "Animal Collective/Merriweather Post Pavilion/02 My Girls.mp3"

Re: MPD httpd Streaming issue

Posted: May 9th, 2020, 2:07 pm
by max
Which program will connect to that stream?
Note that a MPD client only controls playback; it is not supposed to do the actual audio playback.

Re: MPD httpd Streaming issue

Posted: May 9th, 2020, 5:53 pm
by redstar
The logs above are ympd connecting. They both connect and receive the database info. They both control playback. However, ympd has a http stream option and audio is not output when enabled. I understand mpd is not necessarily intended for use as a streaming server so maybe I should look into an alternative, but I thought the httpd function would be perfect for my needs. I would seek help from one of those two clients but I'm not receiving audio from either one so I thought it might be an mpd issue. When I navigate to localhost:8000 I can output audio so maybe it is a client issue and not an mpd issue. What do you think?

Re: MPD httpd Streaming issue

Posted: May 10th, 2020, 8:24 am
by max
If you receive audio from port 8000, but not from ympd, then this is a ympd problem which I cannot help with.
But I would seriously suggest not using streaming for your own personal use. That's up to you, of course.

Re: MPD httpd Streaming issue

Posted: May 12th, 2020, 4:19 am
by redstar
Okay, I appreciate your help! Thank you.

Re: MPD httpd Streaming issue

Posted: May 20th, 2020, 4:41 pm
by langrock
max wrote:
May 10th, 2020, 8:24 am
If you receive audio from port 8000, but not from ympd, then this is a ympd problem which I cannot help with.
But I would seriously suggest not using streaming for your own personal use. That's up to you, of course.
I am in the same boat as the original poster, but using the ympd fork myMPD instead. Same outcome, it somehow doesn't connect to the HTTPD stream. Could you elaborate on your comment advising to NOT use mpd to stream audio? What's the point of the HTTPD output option then?

Thanks

Re: MPD httpd Streaming issue

Posted: May 20th, 2020, 6:52 pm
by max
The point of all of MPD's streaming features is to run some kind of (public?) radio station. Make music available to others.

But it is an inferior solution for listening to your own music files. Because streaming reduces audio quality, increases latency, increases CPU usage, increases memory usage, adds complexity and brings you lots of annoynances.
As I said, it's up to you, MPD gives you the freedom to do that in spite of all the disadvantage and in spite of all the superior solutions.

I keep wondering about people choosing MPD because they want to stream between their own hardware. That's not what MPD is about. MPD isn't particularly good at streaming - it has lots of strengths, and there are good reasons to use it, but streaming is not one.

Re: MPD httpd Streaming issue

Posted: May 21st, 2020, 6:17 pm
by skidoo
Nowadays, streaming is synonymous with playing music on a PC. I like MPDs streaming feature capabilities for Sonos, Chromecast Audio an maybe other hardware. Adding some more features would be cool eg keep multiple outputs in sync, adding and removing outputs during runtime, routing audio and of course faster and fancier clients ;)

In the meantime I enjoy a rocksolid Music Player Daemon.