MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.2k stars 351 forks source link

Browsing does not work with database upnp plugin: Bad resource exception #851

Closed t0phr closed 4 years ago

t0phr commented 4 years ago

Bug report

Describe the bug

When using the database plugin upnp, browsing of several UPnP servers does not work. The servers are listed, but when a server is selected for browsing an empty screen is shown and "exception: Bad resource" appears in the logs.

In a little more detail, I tried to connect MPD to the Plex Media Server DLNA server as well as the foobar2000 UPnP Plugin Server. I added database { plugin "upnp" } to mpd.conf as required and restarted MPD. Then, using ncmpc, I can select both, the foobar server as well as the Plex server. But except for this top-level server entry nothing is shown.

This happens with the current Arch Linux package, the current Debian Buster package and when building from source.

Expected Behavior

When selecting a upnp server for browsing, the contents of that server should be listed.

Actual Behavior

Nothing is listed after selecting a server for browsing. The log message exception: Bad resource is logged.

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 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

Log

sudo ./mpd --no-daemon --stderr --verbose /etc/mpd.conf
config_file: loading file /etc/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
output: No 'audio_output' defined in config file
output: Attempt to detect audio output device
output: Attempting to detect a sndio audio device
output: Successfully detected a sndio audio device
exception: Input plugin 'tidal' is not configured: No Tidal application token configured
exception: Input plugin 'qobuz' is not configured: No Qobuz app_id configured
curl: version 7.69.1
curl: with OpenSSL/1.1.1g
avahi: Initializing interface
avahi: Client changed to state 101
avahi: Client is CONNECTING
state_file: Loading state file /var/lib/mpd/mpdstate
client: [0] opened from [::1]:54444
client: [0] process command list
client: process command "tagtypes "clear""
client: command returned 0
client: process command "tagtypes enable Artist Album AlbumArtist Title Track Name Genre Date Composer Performer Comment Disc"
client: command returned 0
client: [0] process command list returned 0
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "playlistinfo"
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "lsinfo """
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "lsinfo "foobar2000 Media Server (topher) [M8]""
exception: Bad resource
client: [0] command returned 3
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "lsinfo """
client: [0] command returned 0
client: [0] process command "idle"
client: [0] command returned 1
client: [0] process command "lsinfo "foobar2000 Media Server (topher) [M8]""
exception: Bad resource

I add a pcap of the communication between the MPD server and the Plex DLNA server, maybe that helps. I restarted Plex and MPD during that capture to make sure the relevant messages are exchanged. plex-pcap.zip

MaxKellermann commented 4 years ago

Your log shows only access to foobar2000, but your packet capture is only about Plex. This doesn't match, and I can't analyze your capture file. I don't even know if the capture file shows anything that has failed. MPD works well with accessing a Gerbera daemon, but I have access to neither a foobar2000 server nor a Plex server.

t0phr commented 4 years ago

You are right, I made new captures for Plex and foobar2000 with separate, matching log files. With Gerbera browsing works for me, too.

upnp-issue.zip