sdushantha / kunst

Download and display album art or display embedded album art

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connection refused mpd error

vaskark opened this issue · comments

I've installed kunst on my Ubuntu 19.04 laptop with mpd 0.21.4 (not a service). MPD works fine the majority of the time, as does ncmpcpp. However, running kunst produces (over and over; even ctrl-c won't stop it):

mpd error: Connection reset by peer
mpd error: Connection refused

I've had this problem before so it can't be specific to kunst. I can use mpc to access some music info at the CLI alright, but putting it into a script just gives me 'Connection refused' again. It's weird.

MPD config:

bind_to_address  "127.0.0.1"
port   "6601"

Any help would be appreciated. You don't know how long I've wanted an app like this:)

You don't know how long I've wanted an app like this:)

Thank you so much, I really appreciate it!

What version of mpd are you using? I am currently using 0.21.11.

Could you show me your ẁhole mpd and ncmpcpp config?
Also, could you tell me the version of mpd, and mpc you are using?

mpd: 0.21.4 (conf)
mpc: 0.31
ncmpcpp: 0.8.2 (conf)

As I mentioned, this problem has been happening for awhile. I recall not being allowed to use port 6600 for some reason. But mostly it's worked ok.

Thanks for responding.

@vaskark I dont really know what is wrong, but all I know is that there is something wrong with your config files. I tried them and I got connection refused when trying to run ncmpcpp

Try my configs:
mpd - https://github.com/sdushantha/dotfiles/blob/master/mpd/.mpd/mpd.conf
ncmpcpp - https://github.com/sdushantha/dotfiles/blob/master/ncmpcpp/.ncmpcpp/config

You might need to edit some of the paths when use my config

Still getting the same mesages :( Oh, well. Not the biggest problem. Music still works.

@sdushantha: Ok, I went back to my own configs and am now getting a new kunst error message:

kunst: inspecting /home/vaskark/Music/.
error: file does not have an album art
kunst: unable to check online for the album art
kunst: swapped album art to

I should mention I have art embedded in my music files, and each album has a folder.jpg, too.

What file format is your music? Because I have only tested kunst with mp3 files.


Can you do this for me?

  1. Play a song.
  2. Then run this command:
$ ffmpeg -i "/home/vaskark/Music/$(mpc current -f %file%)" cover.png -y

Do you see the extracted album cover in cover.png?

If not, could you send me the output of the command above?

My music is mostly in mp3 format. Although I do have a few m4a's that I haven't converted yet.

I ran the above command (on an mp3) and I do see the extracted album cover in cover.png. \o/

@vaskark could you run that command with a m4a file?

If it works, then I honestly have no idea what is wrong because everything works for me and I havent anyone else having a similar problem.

@sdushantha Yeah it works for the m4a file, too.
Yeah, it's weird that this isn't working.
Question: do you by any chance know why I can't use port 6600? I get an error message about mpd.socket already in use (or something like that)?
Anyway, I thank you for your time. It just sucks that I won't be able to use your amazing app for now.

@sdushantha Hi, again.
I tried getting kunst working on my Arch VM guest (on Windows 10).
I got a different error message this time:

kunst: inspecting /home/vaskark/music/Pink Floyd/Brussels Affair (Brussels BE, 5 December 1972)
error: file does not have an album art
kunst: unable to check online for the album art
kunst: swapped album art to Pink Floyd - Childhood's End

The ffmpeg command did produce cover.png.
Notice music is not capitalized.
Blank sxiv window opens.

Anyhoo, that's all for now.

@vaskark
I have made a change in kunst. Now you can configure it.
Here is how you can configure it: https://github.com/sdushantha/kunst#configure


Notice music is not capitalized.

Since you are having a problem with your music directory, add this to your bashrc or zshrc:

export KUNST_MUSIC_DIR="/home/vaskark/Music/"

Question: do you by any chance know why I can't use port 6600? I get an error message about mpd.socket already in use (or something like that)?

That is because some service is using that port.
Run this command and see if port 6600 is actually being used:

ss -lntu

@sdushantha

ss -lntu

Port 6600 is not being used.

I made the changes you suggested to my zshrc. Still getting Connection refused errors.
Also, the previous ffmpeg command not longer even works:

Vangelis//1.09 - Opening Titles from The Bounty.mp3: No such file or directory

Even removing the extra / didn't help.
This is all so frustrating. Although it's people like you that make the internet great, taking time like this. Many thanks.

Still getting Connection refused errors.

I dont really know why this is happening. Is this happening on both Arch and Ubuntu? You could try reinstalling mpd and ncmpcpp or try upgrading those packages.

Also, the previous ffmpeg command not longer even works:

You might need to have the file name in quotes (") because it contains spaces.

$ ffmpeg -i  "Vangelis/1.09 - Opening Titles from The Bounty.mp3" cover.png -y

Although it's people like you that make the internet great, taking time like this.
Many thanks.

Thank you for your kind words, you made my day :)

you may have mpd running elsewhere on your network, if so edit the script with any mention of mpc & mpc current and change it to mpc -h INTERNAL IP and mpc current -h INTERNAL IP -f foo
also bind_to_address "INTERNAL IP" might help