lcpz / lain

Awesome WM complements
GNU General Public License v2.0
1.06k stars 212 forks source link

Lain MPD widget slows down awesome #23

Closed XayOn closed 10 years ago

XayOn commented 10 years ago

Not sure how to debug this. I'll follow instructions if you think is relevant. I'm actually just filling the bug for reference, as I don't think is anything critical, but might be messing with someone else's brains

Having lain MPD widget makes awesome lag each X seconds (wich i assume is the plugin refresh rate). I tested it with and without mpd daemon running.

Disabling mpd widget solved all my issues, and I'm not even using it, just reporting it here in case someone else thinks that copycat-killer themes are slow. Nope, they're not, it's just this widget malfunctioning, remove it and stop whinning.

lcpz commented 10 years ago

Hi David, of course I think this is relevant, but are you really sure this is MPD widget related?

I'm asking because the normal widget timeou is 2 seconds, so you should freeze each couple of secs, if this is the cause.

First, git pull latest lain commit (I uploaded it yesterday), ensure your MPD configuration is correct and enable the widget again.

If the trouble is still there, then please try to measure the timeout (approximately, it's not necessary to be precise) and report to me. Oh, and also tell me which config you are using, or paste it here (from gist, pastebin or whatever) if you're using a custom version.


PS: If you find someone not happy with my work, you can invite him to contact me so we can improve and make it more portable together.

As I've written this for my machine before sharing it publicly, I cannot guarantee it will always work smoothly on everyone else's, though I put all efforts to achieve the objective.

There would be always issues for someone, this is free and open source software.

But hey, that's why bug trackers are made for.

XayOn commented 10 years ago

I'm using an out-of-the-box powerarrow-darker. I think I had MPD ok and well configured, but I'll re-do it again in a clean env in a few hours. The lag is about 3 seconds, when you drag a window you can clearly see it (it stops each 3 seconds).

I don't think at all the main real issue is with lain-mpd, but using it with the default configuration can cause awesome freezes. I've digged a bit, and found that it's a common problem in awesome 3.5+ that text widgets CAN freeze awesome (wich itself is catastrophic...).

Anyway, I'm not conflicted by this at all, I just posted to inform, and to have it recorded for reference, in case another user has the freezes/lags and does not know where to look. Maybe putting something in the readme like "Note: If you do not wish to use and configure MPD, disable the MPD widget, as an badly-configured MPD widget can cause awesome freezes" ?

I'm an opensource dev myself, I know how this stuff works and how sometimes bugreports themselves can be discouraging. I'll paste a better bug report later, but as said, I think it's more the kind of "bug" that just needs to be documented, as it can be helpful to some users, than a real bug.

I think your work on these themes are amazing, I'm a bit of a powerline fan (http://github.com/XayOn/prettierTerminal http://github.com/XayOn/nanobenv http://github.com/XayOn/X-VIM ;-) ) and this theme is just perfect for me. The only thing I've got right now that is not powerline-themed is chrome!

lcpz commented 10 years ago

David, I'm using powerarrow-darker right now, and I'm not experiencing the problem.

Can you test if you have the issue with any other theme of mine too?

blueluke commented 10 years ago

I'm using an out-of-the-box powerarrow-darker. I think I had MPD ok and well configured, but I'll re-do it again in a clean env in a few hours. The lag is about 3 seconds, when you drag a window you can clearly see it (it stops each 3 seconds).

I never noticed this myself as I usually don't move floating windows, but a quick test showed that this is indeed correct.

Adding...

require("lain")
mpdwidget = lain.widgets.mpd()

is enaugh to trigger this behaviour. You don't even have to add the widget anywhere. It doesn't matter if mpd is actually running, too.

EDIT: I just tested this with the default rc.lua. Same result.

lcpz commented 10 years ago

Help me to solve this.

Are you using the last lain commit?

Are you using Lua 5.2.3 and Awesome 3.5.2?

Do you have telnet support?

Paste me the output of

curl --version; echo -e "\n"; mpd --version
blueluke commented 10 years ago

Are you using the last lain commit?

Yes I am.

# luke at arch2 in ~ [19:50:34]
$ lua -v
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio

# luke at arch2 in ~ [19:50:46]
$ awesome -v                                   
awesome v3.5.2 (The Fox)
 o Build: Oct 13 2013 01:33:36 for x86_64 by gcc version 4.8.1 (nobody@)
 o Compiled against Lua 5.2.2 (running with Lua 5.2)
 o D-Bus support: ?

# luke at arch2 in ~ [19:51:05]
$ curl --version
curl 7.34.0 (x86_64-unknown-linux-gnu) libcurl/7.34.0 OpenSSL/1.0.1f zlib/1.2.8 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

# luke at arch2 in ~ [19:51:32]
$ mpd --version
Music Player Daemon 0.18.7 [...]

I'll mess around with mpd.lua and see if I can narrow it down to a specific code part.

lcpz commented 10 years ago

Both of you, please do this: comment lines 89, 90 and 94 here, and tell me if the problem persists.

(to comment a line in Lua, write "--" at the beginning)

blueluke commented 10 years ago

Both of you, please do this: comment lines 89, 90 and 94 here, and tell me if the problem persists.

(to comment a line in Lua, write "--" at the beginning)

No effect for me.

I tried some more:

I'm not really sure that it is actually a fault of the mpd code. Probably more related to the overall awesome performance under certain circumstances?

I don't think that it's really worth to continue this:

lcpz commented 10 years ago

I want to ensure if this is a lain problem, and eventually try to fix it.

Since I'm not experiencing the issue in any case, and can't find anything in my code that could lead to this, I need feedback from you.

Obviously I'm not forcing to continue, but every progress is welcome.

Although I really don't know what to think, right now.

EDIT: can you try with awesome-git instead?

lcpz commented 10 years ago

Beside trying with awesome-git version, can you try after disabling one of the third-party modules? Maybe they are incompatible with lain MPD widget on your machines.

XayOn commented 10 years ago

I'm quite busy at the moment, but I promise as soon as I can I'll have a more deep look onto this so I can help you solve this issue.

Also, I've detected that it keeps happening, at different frecuency (minutes, not seconds). I think the way awesome handles text widgets have something to do, so, yes, I'll upgrade to dev version as soon as I can, and post here results.

Btw, freedesktop has been disabled on my setup since the beginning, as I dont have a "Desktop", having a look at xsession-errors I saw errors concerning Desktop/ not being present, found freedesktop require, and commented it ;-)

Thanks

lcpz commented 10 years ago

Xay, can you give me update on this? Thanks.

mrcloudhacker commented 10 years ago

freedesktop is the main culprit for me and not MPD, disabling freedesktop my awesome became lightning fast.

lcpz commented 10 years ago

@codingenesis I think this was your issue, not the one we're trying to investigate here.

sqozz commented 10 years ago

Hello everyone.. Even if this thread is slightly old i can contribute some informations to this problem and it also exists in the newest version of lain. I have noticed that when no MPD is availible awesome gots incredible slow. I don't know exactly why, because memory as well as cpu usage keeping at a normal level. But after disabling the MPD widget everything works fine again. Some small researches have adduced that the timeout of curl is to high (1 second) but 1 second is also the lowest timeout curl can handle. Because i don't want to rewrite the fetching of MPD-infos i added a MPD server detection by connected network. And now i can use multiple MPD's and when i'm in another place where no MPD is availible, awesome still works.

If someone wants this mod i can send it to you - just write me. And if you - copycat-killer - if you want to add it to lain i can make a push request.

greetings sqozz!

lcpz commented 10 years ago

Let me understand.

You're saying that the widget slows down Awesome... when MPD is not present.

Is it correct?

sqozz commented 10 years ago

Yeah, that is at least my experience. Also a friend of mine had the same issue.

lcpz commented 10 years ago

Then what do you expect?

If you have a function asking for a specific thing you're actually missing, of course there might be some issues. @XayOn, this is your exact case.

So we finally determined that the problem is not mine.

Moreover, this issue was raised for a template configuration, which has to be customized before use.

Now, I'm not sure having to burden the MPD widget to avoid this situation, when the user can disable it just like the battery widget in desktop environment...

@Sqozz feel free to submit a pull request with your patch, it might be useful in case you could connect to different networks with several music servers and I'll consider adding it if it's not too complicated.

In any case, disable widgets if you don't use them!

This issue is closed.