Re: Howto: MPD

The file in /etc/default is mpd, not mpd.conf.  But thanks for updating the instructions!

while ( ! ( succeed = try() ) );

Re: Howto: MPD

sorted smile

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

Hi,
I haven't been around much, but that doesn't mean that I've not been using #! big_smile

Thanks to the nice tutorials and hints in this thread, and others, I just got mpd player to run using Sonata as a client and have the display in conky! big_smile

This really is a great distro!

Last edited by Kyte (2009-11-22 00:41:29)

Kyte: Always flittin' around with his head in the clouds!

Re: Howto: MPD

This script works perfectly, and displays the album cover in my conky.

But the script sends a traceback to the terminal where I have started conky when a song is stopped:

Traceback (most recent call last):
  File "/home/jostein/bin/mpd-albumart.py", line 17, in <module>
    artist = song['artist']
KeyError: 'artist'
Traceback (most recent call last):
  File "/home/jostein/bin/mpd-albumart.py", line 17, in <module>
    artist = song['artist']
KeyError: 'artist'

Can this error be stopped?

Re: Howto: MPD

jostber wrote:

This script works perfectly, and displays the album cover in my conky.

But the script sends a traceback to the terminal where I have started conky when a song is stopped:

Traceback (most recent call last):
  File "/home/jostein/bin/mpd-albumart.py", line 17, in <module>
    artist = song['artist']
KeyError: 'artist'
Traceback (most recent call last):
  File "/home/jostein/bin/mpd-albumart.py", line 17, in <module>
    artist = song['artist']
KeyError: 'artist'

Can this error be stopped?

change lines 16-18 of the script to this (if you don't use python normally make sure you use the correct indentation, i think its 4 spaces, but it could be a tab)

try:
    song = client.currentsong()
    artist = song['artist']
    album = song['album']
except KeyError:
    artist = ' '
    album = ' '

it wont 'fix' anything but it will stop you getting the error messages.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

Thanks, that worked fine. Another error message that is coming now is this:

Unable to load image '/home/jostein/tmp/mpd.jpg'

Is it possible to supress this too?

Last edited by jostber (2010-01-24 23:22:36)

Re: Howto: MPD

jostber wrote:

Thanks, that worked fine. Another error message that is coming now is this:

Unable to load image '/home/jostein/tmp/mpd.jpg'

Is it possible to supress this too?

could it be that the path in mpd-albumart.py (/tmp/mpd.jpg) doesn't match that in conky? (${image /tmp/mpd.jpg -s 80x80 -p 100,349 })?

failing that:
is the image actually showing?
is it python giving this error?

is there a reason why its in your home folder ? i realise the other paths were hard coded using my paths(now fixed), this can just stay in tmp, ie 'tmp/mpd.jpg', i can't see that being the the problem tho.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

The image is showing and the message seems to be coming from Conky.

I changed the tmp location back to the original. First it works fine, but when I start a new song from another album the message reappears.

Last edited by jostber (2010-01-25 00:28:01)

Re: Howto: MPD

if it were the python script it would be giving you a traceback error, so im guessing its conky, i don't know why its looking in your home directory for a home file, (its definitely '/tmp/mpd.jpg', not 'tmp/mpd.jpg'?), you could post the relevant part of your conky script, but if its working I would just leave it.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

Is there a way to let ncmpcpp or mpd itself order tracks by their tracknumber?
My songs show like this at the moment, when looking into any album:

05 - name - trackname
08 - name - trackname
01 - name - trackname
...

What i want:

01 - name - trackname
02 - name - trackname
...

The tracks don't have the tracknumber in their title, but in their id3-tags.
Any help?

*edit* forgot to mention: Tracks are ordered alphabetically right now.

Last edited by regular (2010-02-08 09:19:23)

Re: Howto: MPD

Having some strange problems... I followed this to the letter and it all worked great, until I tried to run mpd and mpc ls

Here is information that I believe is relevant:
http://pastebin.com/CJ0u0Z5d

Re: Howto: MPD

did you try

sudo killall mpd

try that, they try running mpd normally again.

if that fails try changing .mpdconf
this line
log_file                        "/var/log/mpd/mpd.log"
to
log_file                        "~/.mpd/mpd.log"

or

sudo chmod go+w /var/log/mpd/mpd.log

assuming its a permissions issue

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

Thanks, I was able to resolve that issue, as well as a few others that came up. Now, however, I can run mpd without any errors, but mpc ls returns nothing, even though there is music in my music directory. Also, mpc ls | mpc add and mpc play do not return anything other than volume:100%   repeat: off   random: off   single: off   consume: off.

I would like to thank you for your help so far. An updated version of my .mpdconf file is located at: http://pastebin.com/KW8BmeuE

benj1 wrote:

did you try

sudo killall mpd

try that, they try running mpd normally again.

if that fails try changing .mpdconf
this line
log_file                        "/var/log/mpd/mpd.log"
to
log_file                        "~/.mpd/mpd.log"

or

sudo chmod go+w /var/log/mpd/mpd.log

assuming its a permissions issue

Re: Howto: MPD

i guess its this line

db_file                 "/var/lib/mpd/tag_cache"

try changing it to ~/.mpd/tag_cache

you may then need to run 'mpd --create-db' afterwards.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

I have made the changes and mpd --create-db. Now this is my terminal session afterwards.

on3iropolos@on3inet:~$ mpd
listen: Failed to listen on localhost (line 69): Address already in use
Aborted
on3iropolos@on3inet:~$ mpd --create-db
listen: Failed to listen on localhost (line 69): Address already in use
Aborted
on3iropolos@on3inet:~$ mpc ls
on3iropolos@on3inet:~$ gksu gedit ~/.mpdconf
on3iropolos@on3inet:~$ sudo killall mpd
on3iropolos@on3inet:~$ sudo killall mpc
mpc: no process found
on3iropolos@on3inet:~$ mpd
Failed to load database: Failed to open database file "/home/on3iropolos/.mpd/tag_cache": No such file or directory
on3iropolos@on3inet:~$ mpc ls
The Shins
Death Cab For Cutie
Pink Floyd
on3iropolos@on3inet:~$ mpc ls | mpc add
on3iropolos@on3inet:~$ mpc play
Death Cab For Cutie - Marching Bands Of Manhattan
[playing] #1/212   0:00/4:13 (0%)
volume:100%   repeat: off   random: off   single: off   consume: off

It remains at 0:00/4:13 and no music. Please stay with me a while longer so I can get this fixed! I don't understand why I would be having so many problems with it... I installed a fresh copy of Statler Alpha 2 just a few days ago. Thank you for your help so far.

Re: Howto: MPD

sorry i haven't got back to you, ive been away for the weekend, anyway by default mpc will start playing a file and exit, so you won't get a continual updating of playtime etc

mpc

on its own should give you the current status, if this is increasing the song should be playing you just can't hear it so it may be your sound setup .
if thats not it im not sure

creating a file /home/on3iropolos/.mpd/tag_cache, if it hasn't already being created would be a good idea, though i doubt its the problem.

also

mpd --create-db

gives me a load of
"added ~/music/foo/bar.ogg"
and

mpc ls | mpc add

gives me a load of
"adding ~/music/foo/bar.ogg"

i assume youre getting that and just edited them from your post?

last thing i can think of, i noticed you

gksu gedit ~/.mpdconf

you shouldn't need to use sudo to do this, check you are the owner of .mpdconf and .mpd/* files

ls -l ~/.mp*

all of them should be owned by you, not root ie look like
- rwx --- --- yourusername yourusername date time file/path

if not

sudo chown yourusername:yourusername /home/yourusername/.mp*

will change the permissions

Last edited by benj1 (2010-07-04 18:30:45)

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

Special thanks for the smart keybindings!

I made an XFCE version based on the Openbox keybindings. Add these lines to ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml among the custom shortcuts (mine are added after the line "<property name="Print" type="string" value="xfce4-screenshooter"/>" and before the line "</property>" that concludes the section):

      <property name="&lt;Super&gt;Up" type="string" value="mpc toggle"/>
      <property name="&lt;Super&gt;Down" type="string" value="mpc stop"/>
      <property name="&lt;Super&gt;Left" type="string" value="mpc prev"/>
      <property name="&lt;Super&gt;Right" type="string" value="mpc next"/>

Log out and in and these shortcuts should work in an XFCE session.

Last edited by Piraja (2010-07-22 15:54:44)

––––––––––––––––––––––––––––––––––––––––––––––––––––––––
I never use smilies, but there are exceptions that prove the rule wink
Now playing: Last.fm

Re: Howto: MPD

cool ill add a link in the original post.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

great HOWTO!

I always forgot how to install mpd, this howto is like a god's gift big_smile

Re: Howto: MPD

benj1 wrote:

cool ill add a link in the original post.

That's kind of you, benj1. Just one thing: now the original post says the link leads to "Openbox keybindings", while it should of course say "XFCE keybindings" (or "XFCE4 keybindings"). These happen to me all the time.

––––––––––––––––––––––––––––––––––––––––––––––––––––––––
I never use smilies, but there are exceptions that prove the rule wink
Now playing: Last.fm

Re: Howto: MPD

thanks for pointing that out. roll

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Howto: MPD

mpd-albumart.py has been updated on the OP and should now be working again, amazon have updated their file paths so the script was pulling in some random piece of scenery rather than something useful (you'd think they don't like screen scraping albumart grabbers or something).

deleting empty jpgs from your albumart file (ones that won't open or give you a thumbnail) should mean theyre redownloaded and actually work now.

let me know if you have any probs

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts