Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpd widget doesn't show cover art. #227

Closed
Incognito4nonymous opened this issue Sep 19, 2016 · 29 comments
Closed

mpd widget doesn't show cover art. #227

Incognito4nonymous opened this issue Sep 19, 2016 · 29 comments
Labels

Comments

@Incognito4nonymous
Copy link

Incognito4nonymous commented Sep 19, 2016

So, I recently restarted to work on my awesome configuration since I'm soon gonna work on a Raspberry Pi project on which I will be ultra lightweight software.
Personal projects aside, I finally got the Mpd widget to work after a year (and I don't even know how)
But almost, since this one won't show any cover, even though readers such as Audacious or XMMS can see them.
After some investigations, I saw that /tmp/mpdcover.png is missing.
I have Imagemagick installed on my computer.
My question is, how do I create that file ?
EDIT.
Mmmmh, Curiously it displays something when a assign a picture to the
local default_art = args.default_art or ""
Function.
I wonder where could be the problem.

@lcpz
Copy link
Owner

lcpz commented Sep 22, 2016

  1. Do you have a cover image in the album folders, like specified here?
  2. If you create a placeholder image as /tmp/mpdcover.png, does it show up in the notification?
  3. Can you run lain/scripts/mpdcover? Check if it has the right execution permission.

@Incognito4nonymous
Copy link
Author

Incognito4nonymous commented Sep 22, 2016

  1. Do you have a cover image in the album folders, like specified here?

Yup.

  1. If you create a placeholder image as /tmp/mpdcover.png, does it show up in the notification?

Yup, it just vanishes.

3.Can you run lain/scripts/mpdcover? Check if it has the right execution permission.

Runs, tried to run it as root, nothing, it runs correctly but displays no image.

@lcpz
Copy link
Owner

lcpz commented Sep 22, 2016

  1. Let's assume mycover.jpg is the album cover image in your current working directory. Run this command:

    $ convert "mycover.jpg" -scale "100x100" -gravity "center" -background "none" test.jpg 

    and check if test.jpg has been created and is the shrinked version of mycover.jpg.

  2. If it works, probably it's the /tmp path causing issues. By "vanishes" do you mean that as soon as the file is being put in /tmp, it gets deleted?

Why don't you try another path? Modify this line and the spawn mpdcover from the shell to see if it depends on this.

@Incognito4nonymous
Copy link
Author

Incognito4nonymous commented Sep 22, 2016

Okay, giving it a try

By "vanishes" do you mean that as soon as the file is being put in /tmp, it gets deleted?

Yup, but only when the music player is launched, it stays when not playing anything.

@Incognito4nonymous
Copy link
Author

Incognito4nonymous commented Sep 22, 2016

Let's assume mycover.jpg is the album cover image in your current working directory. Run this command:
$ convert "mycover.jpg" -scale "100x100" -gravity "center" -background "none" test.jpg
and check if test.jpg has been created and is the shrinked version of mycover.jpg

Ok, gave it a try with a picture in my music directory, which I named mycover.jpg just to make myself sure, and it worked.

@lcpz
Copy link
Owner

lcpz commented Sep 22, 2016

Do this.

Why don't you try another path? Modify this line and the spawn mpdcover from the shell to see if it depends on this.

Choose a local user path.

@Incognito4nonymous
Copy link
Author

Done, nothing changed.

@lcpz
Copy link
Owner

lcpz commented Sep 22, 2016

So, you spawned mpdcover from command line, changing the output path, and it's still not working.

But its main command works, and the problem seems unrelated to the output path.

Somehow this script doesn't work with your system. Are you able to modify these lines in order to make it run the convert command above, instead of mpdcover? Give it a try.

@Incognito4nonymous
Copy link
Author

I'll try to see if there isn't some problem in the widget or in the script, it just ain't possible it doesn't work with my system.
If I find a solution I'll just come back here.

@lcpz
Copy link
Owner

lcpz commented Sep 23, 2016

This is unlikely, but try the following and see if /tmp/mpdcover.png is correctly created:

$ cd $HOME/.config/awesome/lain/scripts
$ lua
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> os.execute("./mpdcover $HOME/Music album 100x100")
true    exit    0
> 

replace second argument path with actual music directory, and album with a relative album path. The correct output should be true exit 0.

@Incognito4nonymous
Copy link
Author

Incognito4nonymous commented Sep 23, 2016

Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> os.execute("./mpdcover /ntfs/Users/Incognito/Music /Analog Dementia - Delusional Reruns 100x100")
convert: invalid argument for option `-scale': DementiaxDementia @ error/convert.c/ConvertImageCommand/2655.

@lcpz
Copy link
Owner

lcpz commented Sep 24, 2016

The error is caused by the fact that you did not escape the whitespace in your album.

Come on, I'd espect that from a Slack user. :neckbeard:

Try quoting the album path with single quotes:

os.execute("./mpdcover /ntfs/Users/Incognito/Music 'Analog Dementia - Delusional Reruns' 100x100")

PS: Also, It'd be a good thing inf you update Lua (5.1.5 older than this project) and other awesome dependecies.

@Incognito4nonymous
Copy link
Author

Heh heh, we all forget some stuff sometimes. 😄
Well, there is absolutely no output. ( ͡° _ʖ ͡°)

@lcpz
Copy link
Owner

lcpz commented Sep 24, 2016

You mean Lua doesn't output true exit 0?

Please update Lua to v. 5.3.3 and retry.

PS2: Thanks, you made me discover hardvapour. While I don't like its genesis, it's always interesting to discover new subgeneres. Sadly, these cultures rise and die very fast, just like the trends they reflect in the modern ages.

@Incognito4nonymous
Copy link
Author

Incognito4nonymous commented Sep 24, 2016

Heh heh, Wolfenstein OS X made really awesome albums, such as Deep Web Rising or End of the world Rave, I really recommend them, as for hardvapour, it is a quite special subgenre I have to admit.
I like how each song seems to tell a little story, sticking with an obscure theme.
Okay, gonna update my lua, I'll come back here as soon as it is finished.

@Incognito4nonymous
Copy link
Author

true exit 0 ! 😃

@lcpz
Copy link
Owner

lcpz commented Sep 24, 2016

If it now outputs that, then the widget should work correctly. I really can't see why it should be otherwise.

PS: Listening to 2814.

@Incognito4nonymous
Copy link
Author

Aaaahh, 2 8 1 4 is one of my favorites in Vaporwave, I like the Cyberpunk Dystopic vibes coming out of it.
Erh, now after the lua update, Awesome does not longer work, but I'm sure the widget will work after I find some way to start it up.

@lcpz
Copy link
Owner

lcpz commented Sep 24, 2016

Update each awesome dependency and let me know.

@Incognito4nonymous
Copy link
Author

It seems related lo LGI, I'm gonna try to build it from source.

@Incognito4nonymous
Copy link
Author

Incognito4nonymous commented Sep 24, 2016

Oh blast, I recompiled everything, awesome to the dependencies, it does not longer work.
Dammit. Awesome just refuses to launch, and and when I try to compile it, it just days:

lua: (command line):1: module 'lgi' not found:
        no field package.preload['lgi']
        no file '/usr/share/lua/5.3/lgi.lua'
        no file '/usr/share/lua/5.3/lgi/init.lua'
        no file '/usr/lib64/lua/5.3/lgi.lua'
        no file '/usr/lib64/lua/5.3/lgi/init.lua'
        no file './lgi.lua'
        no file './lgi/init.lua'
        no file '/usr/lib64/lua/5.3/lgi.so'
        no file '/usr/lib64/lua/5.3/loadall.so'
        no file './lgi.so'
stack traceback:
        [C]: in function 'require'
        (command line):1: in main chunk
        [C]: in ?


       WARNING
       =======

 The lgi check failed.
 The Lua GObject introspection package is just a runtime dependency, so it is not
 necessary for building awesome. However, awesome needs it to run.
 Add AWESOME_IGNORE_LGI=1 to your environment to continue.


CMakeFiles/lgi-check.dir/build.make:57: recipe for target 'CMakeFiles/lgi-check' failed
make[2]: *** [CMakeFiles/lgi-check] Error 1
CMakeFiles/Makefile2:205: recipe for target 'CMakeFiles/lgi-check.dir/all' failed
make[1]: *** [CMakeFiles/lgi-check.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error

Uuuuuuuhggggggggghhhhhnnnnn....
I even deleted all the related packages, it just doesnt work. 😞
I'll try tomorrow after a good night of sleep.

@Incognito4nonymous
Copy link
Author

The problem is indeed linked to my lgi package, it installs libraries for the 5.1.x version of Lua, heh, you're indeed an arch linux user...

@lcpz
Copy link
Owner

lcpz commented Sep 25, 2016

Even if it installs 5.1 branch libs, you should still be able to install a full Lua 5.3+ too.

EDIT: Actually, you don't need to update awesome, you just need to install Lua 5.3+.

@Incognito4nonymous
Copy link
Author

Lua has been successfully installed already, it's just that awesome doesn't longer detect lgi, I just recompiled the package to see if if detected where the issue was coming from.
As a matter of fact I'm pretty much out of ideas for now, but I'll find a solution in due time.
In the meantime, I have to withstand KDE, aaaarrrrrrhhhhh....

@Incognito4nonymous
Copy link
Author

It seems I'm stuck with Lua 5.1.5, the repos doesn't have the latest version of lgi, and all build attempts failed.
Dammit, I guess I'll have to wait for a newer release then...
Hopefully Raspbian will have the latest version.
If I'm getting adventurous I'll try other alternatives, in the meantime, falling back to 5.1...
You don't have an older version of the script running on that version of Lua ?

@lcpz lcpz added the invalid label Sep 26, 2016
@lcpz
Copy link
Owner

lcpz commented Sep 26, 2016

Aren't you building from source? Or you meant slackbuilds? Because installing from (real) source should let you avoid stucking with 5.1.5.

You don't have an older version of the script running on that version of Lua?

This project started after 2012 and v.5.1.5, so unfortunately no.

We've explored the problem enough.

You know how to solve it, so when you'll be able to do it, reply back here if some other weird behaviour should appear.

@lcpz lcpz closed this as completed Sep 26, 2016
@lcpz
Copy link
Owner

lcpz commented Sep 26, 2016

Uhm, there's a last, very simple check.

Until now I assumed you set everything properly; as a last attempt I'll assume the contrary.

Did you set music_dir in your widget?

mpdwidget = lain.widgets.mpd({
    music_dir = "/path/to/music/dir",
    -- [...]
})

@Incognito4nonymous
Copy link
Author

Incognito4nonymous commented Sep 26, 2016

Okay awesome, thanks for the help ! Whenever that lua problem is solved I'll come back to tell if it worked or not.
Aaaaand yup, my music directory is well set, I checked many times before posting here 😉 Let's be honest it would have been dum to forget that.
Really big thumbs up, now as it seems I have solved any bug that could potentially happen to me if I port this to a five inch touchscreen on a Raspberry Pi, thanks again Master Luke.
If I succeed in my project I'll give you my fork. 😃

@Incognito4nonymous
Copy link
Author

Sooo, I came back to this, aand it is Indeed a lua version problem, everything works perfectly to bits on my Raspbian and the code doesn't even needs any modifications, even on a 3.5 inch screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants