Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169503 - media-libs/libmpd-0.13.0 unable to connect to mpd-0.12.1 (via gmpc)
Summary: media-libs/libmpd-0.13.0 unable to connect to mpd-0.12.1 (via gmpc)
Status: VERIFIED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Andrej Kacian (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-05 21:02 UTC by Hanno Zysik (geki)
Modified: 2007-08-08 21:28 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hanno Zysik (geki) 2007-03-05 21:02:04 UTC
Downgrading to libmpd-0.12.0 and gmpc-0.13.0 helps to listen audio again. This is on amd64 arch.
Comment 1 Hanno Zysik (geki) 2007-03-05 22:00:04 UTC
If I merge libmpd-0.13.0 and gmpc-0.13.0 it neither connects. mpd log says on connect try:

interface 0: opened from 127.0.0.1

So mpd sees the connect and when I close gmpc mpd disconnects the client:

interface 0: closed

libmpd's connect routine seems broken.
Comment 2 Qball Cow 2007-03-05 22:22:23 UTC
(In reply to comment #1)
> If I merge libmpd-0.13.0 and gmpc-0.13.0 it neither connects. mpd log says on
> connect try:
> 
> interface 0: opened from 127.0.0.1
> 
> So mpd sees the connect and when I close gmpc mpd disconnects the client:
> 
> interface 0: closed
> 
> libmpd's connect routine seems broken.
> 

You can run gmpc with --debug-level=3 to get some more output. 
It would help if you could contact me directly via e-mail or irc (#mpd on irc.freenode.net).

Another useful test for me is if you can try the latest mpc (preferable from svn), this can help me pin-point the location of the error. (libmpd wraps around libmpdclient.[c|h] that is also (directly) used by mpc).

Qball
(author of gmpc.)


Comment 3 Hanno Zysik (geki) 2007-03-05 23:27:03 UTC
The error from gmpc:

ERROR:   libmpd.c mpd_check_error():#235:	Following error occured: 15: code: 0 msg: problems getting a response from "localhost" on port 6600 : Verbindungsaufbau abgelehnt
Comment 4 Hanno Zysik (geki) 2007-03-06 00:54:31 UTC
If I add -DMPD_NO_GAI to cflags it works. whee... ;)
Comment 5 Hanno Zysik (geki) 2007-03-07 11:48:41 UTC
The IPv6 entry causes the refused connection

# grep -v ^# /etc/hosts
127.0.0.1	ana.manna.org ana localhost
::1	localhost

If I comment the IPv6 entry it works.
Comment 6 Evert 2007-05-17 10:00:27 UTC
On my system, mpd would not start at all!
I checked it out and found it doesn't seem to work without the --no-daemon option (as in /etc/init.d/mpd)!


# /usr/bin/mpd --verbose --no-create-db /etc/mpd.conf
binding to address for localhost
setFsCharset: fs charset is: UTF-8
reading DB
opening pid file
# ps -fC mpd
UID        PID  PPID  C STIME TTY          TIME CMD
# 


# /usr/bin/mpd --no-daemon --verbose --no-create-db /etc/mpd.conf &
[1] 16127
# binding to address for localhost
setFsCharset: fs charset is: UTF-8
reading DB
opening pid file
writing pid file
# ps -fC mpd
UID        PID  PPID  C STIME TTY          TIME CMD
mpd      16127 19062 13 11:54 pts/0    00:00:00 /usr/bin/mpd --no-daemon --verbose --no-create-db /etc/mpd.conf
# 


# emerge --info
Portage 2.1.2.2 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.4-r4, 2.6.20.4 i686)
=================================================================
System uname: 2.6.20.4 i686 AMD Athlon(tm) XP 2600+
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 17 May 2007 03:00:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-java/java-config: 1.3.7, 2.0.31-r5
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -mtune=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -mtune=i686 -pipe"
DISTDIR="/data/linux/gentoo/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LINGUAS="en en_US en_GB nl de"
MAKEOPTS="-j2"
PKGDIR="/data/linux/gentoo/packages/amd_athlon-xp"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/compile"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac alsa apache2 apm berkdb bitmap-fonts cli cracklib crypt cups dri dvd dvdr dvdread encode esd fortran gdbm gif gnome gpm gstreamer gtk iconv imlib ipv6 isdnlog java jpeg ldap libg++ mad midi mikmod mmx mng mozilla mp3 mpeg mplayer ncurses nls nptl nptlonly nsplugin ogg opengl oss pam pcre pdf perl png ppds pppd python qt qt3 qt4 quicktime readline reflection samba sdl session spell spl sse ssl svg tcpd tiff truetype truetype-fonts type1-fonts unicode v4l v4l2 vcd vorbis wmf x86 xinerama xml xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US en_GB nl de" USERLAND="GNU" VIDEO_CARDS="vesa fbdev nv nvidia v4l"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 7 Andrej Kacian (RETIRED) gentoo-dev 2007-05-17 15:01:40 UTC
That sounds like you haven't let mpd create its database beforehand (mpd --create-db).
Comment 8 Evert 2007-05-17 15:41:12 UTC
No, without --no-daemon, mpd seems to die before "writing pid file", see here:

# rm /var/lib/mpd/database /var/lib/mpd/state

# mpd --verbose --no-daemon
binding to address for localhost
setFsCharset: fs charset is: UTF-8
unable open db file "/var/lib/mpd/database": No such file or directory
flushing warning messages
done flushing warning messages
explore: attempting to opendir: 
explore: 
[...]
removing empty directories from DB
sorting DB
writing DB
No "audio_output" defined in config file
Attempt to detect audio output device
Attempting to detect a alsa audio device
Successfully detected a alsa audio device
opening pid file
writing pid file

[here I pressed ctrl-c since it was started in the foreground]

# mpd --verbose
binding to address for localhost
setFsCharset: fs charset is: UTF-8
reading DB
opening pid file

# ps -fC mpd
UID        PID  PPID  C STIME TTY          TIME CMD
Comment 9 Gunnar Thielebein 2007-08-07 13:30:07 UTC
as stated in this thread you can comment out the localhost bind in mpd.conf.
It is in there by ebuild.

http://www.musicpd.org/forum/index.php?PHPSESSID=041bc5fba6be9bb4f0a8f9b2c742a2c3&topic=1287.0
Comment 10 Hanno Zysik (geki) 2007-08-07 14:16:02 UTC
For some reasons I dislike to unbind from localhost. ;)

Instead, I changed it to this below and works, too, with IPv6 entry in /etc/hosts.

bind_to_address                 "127.0.0.1"

Still, that are just workarounds to the problem.
Comment 11 Andrej Kacian (RETIRED) gentoo-dev 2007-08-07 18:38:36 UTC
(In reply to comment #10)
> For some reasons I dislike to unbind from localhost. ;)
> 
> Instead, I changed it to this below and works, too, with IPv6 entry in
> /etc/hosts.
> 
> bind_to_address                 "127.0.0.1"
> 
> Still, that are just workarounds to the problem.
> 

Well, yes - and this problem can only be fixed in the upstream code. As upstream is already well aware of this and are (eventually) planning to rewrite the socket binding code, I'm closing this as UPSTREAM. Feel free to provide patches. :)
Comment 12 Gunnar Thielebein 2007-08-08 12:11:48 UTC
> For some reasons I dislike to unbind from localhost. ;)
> 
> Instead, I changed it to this below and works, too, with IPv6 entry in
> /etc/hosts.
> 
> bind_to_address                 "127.0.0.1"
> 
> Still, that are just workarounds to the problem.
> 

this is content of my /etc/hosts.
I think 2# is ipv6 entry so why is it still not working?

127.0.0.1       localhost.localdomain   localhost
::1     localhost
Comment 13 Andrej Kacian (RETIRED) gentoo-dev 2007-08-08 21:28:28 UTC
Try either pointing your clients to 127.0.0.1 instead of localhost, or commenting out the ipv6 localhost entry, so "localhost" resolves to 127.0.0.1.