You are not logged in.

#201 2013-11-13 18:56:15

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Lyvi - command-line lyrics (and more!) viewer

RMorel wrote:

Hi OK100,

First of, thank you for the great program. I love the convenience of it when used alongside a CLI based mpd setup.

I recently switched to the 'lyvi-git' AUR package and I feel as if it is significantly faster on startup/shutdown.

Today though I am experiencing some problems with lyvi. It would seem to be a bug in lyvi.

My keyboard shortcuts for mpd stopped working, but only while lyvi was running. These shortcuts are just wrappers around mpc.
So I tied mpc in the shell, which gave either 'error: Connection closed by the server' or an error about max connections exceeded.
Following this I checked the open file descriptors of mpd and of lyvi. lyvi appears to open a whole mess of connections to mpd and it is aggregating more and more of them over time.

I have mpd setup to it's default port 6600.
Here some information on the open connections:
Without lyvi running:

% lsof -i :6600
COMMAND   PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
mpd     20092 rolf    7u  IPv4 15373313      0t0  TCP *:mshvlm (LISTEN)

Directly after starting lyvi:

% lsof -i :6600
COMMAND   PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
mpd     20092 rolf    7u  IPv4 15373313      0t0  TCP *:mshvlm (LISTEN)
mpd     20092 rolf   12u  IPv4 15911157      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:54275 (ESTABLISHED)
mpd     20092 rolf   14u  IPv4 15911148      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:54269 (ESTABLISHED)
lyvi    24054 rolf    7u  IPv4 15909271      0t0  TCP localhost.localdomain:54269->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   10u  IPv4 15906386      0t0  TCP localhost.localdomain:54275->localhost.localdomain:mshvlm (ESTABLISHED)

Here it is already using two connections where only one is required.
Important to note though is that it first opens a connection on FD 7 then opens two FIFOs/pipes on FD 8 and 9 and from FD 10 onwards new connections.

And after a few minutes I have as many as a hundred open connections from lyvi to mpd.

% lsof -i :6600
COMMAND   PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
mpd     20092 rolf    7u  IPv4 15373313      0t0  TCP *:mshvlm (LISTEN)
mpd     20092 rolf   12u  IPv4 15989431      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55977 (ESTABLISHED)
mpd     20092 rolf   14u  IPv4 15911148      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:54269 (ESTABLISHED)
mpd     20092 rolf   15u  IPv4 15989432      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55979 (ESTABLISHED)
mpd     20092 rolf   16u  IPv4 15989433      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55981 (ESTABLISHED)
mpd     20092 rolf   17u  IPv4 15949652      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55983 (ESTABLISHED)
mpd     20092 rolf   18u  IPv4 15949653      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55985 (ESTABLISHED)
mpd     20092 rolf   19u  IPv4 15949654      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55987 (ESTABLISHED)
mpd     20092 rolf   20u  IPv4 15949658      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55989 (ESTABLISHED)
mpd     20092 rolf   21u  IPv4 15949659      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55991 (ESTABLISHED)
mpd     20092 rolf   22u  IPv4 15949660      0t0  TCP localhost.localdomain:mshvlm->localhost.localdomain:55993 (ESTABLISHED)
lyvi    24054 rolf    7u  IPv4 15909271      0t0  TCP localhost.localdomain:54269->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   10u  IPv4 15986658      0t0  TCP localhost.localdomain:54847->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   11u  IPv4 15986663      0t0  TCP localhost.localdomain:54849->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   12u  IPv4 15987729      0t0  TCP localhost.localdomain:54851->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   13u  IPv4 15986807      0t0  TCP localhost.localdomain:54853->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   14u  IPv4 15986812      0t0  TCP localhost.localdomain:54855->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   15u  IPv4 15986817      0t0  TCP localhost.localdomain:54857->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   16u  IPv4 15986822      0t0  TCP localhost.localdomain:54859->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   17u  IPv4 15986828      0t0  TCP localhost.localdomain:54861->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   18u  IPv4 15986837      0t0  TCP localhost.localdomain:54863->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   19u  IPv4 15948200      0t0  TCP localhost.localdomain:54867->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   20u  IPv4 15948226      0t0  TCP localhost.localdomain:54901->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   21u  IPv4 15948231      0t0  TCP localhost.localdomain:55429->localhost.localdomain:mshvlm (CLOSE_WAIT)
...
lyvi    24054 rolf   68u  IPv4 15948483      0t0  TCP localhost.localdomain:55973->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   69u  IPv4 15948488      0t0  TCP localhost.localdomain:55975->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   70u  IPv4 15948493      0t0  TCP localhost.localdomain:55977->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   71u  IPv4 15948498      0t0  TCP localhost.localdomain:55979->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   72u  IPv4 15948503      0t0  TCP localhost.localdomain:55981->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   73u  IPv4 15948508      0t0  TCP localhost.localdomain:55983->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   74u  IPv4 15948513      0t0  TCP localhost.localdomain:55985->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   75u  IPv4 15948518      0t0  TCP localhost.localdomain:55987->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   76u  IPv4 15948523      0t0  TCP localhost.localdomain:55989->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   77u  IPv4 15948548      0t0  TCP localhost.localdomain:55991->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   78u  IPv4 15948553      0t0  TCP localhost.localdomain:55993->localhost.localdomain:mshvlm (ESTABLISHED)
lyvi    24054 rolf   79u  IPv4 15948558      0t0  TCP localhost.localdomain:55995->localhost.localdomain:mshvlm (CLOSE_WAIT)
lyvi    24054 rolf   80u  IPv4 15948563      0t0  TCP localhost.localdomain:55997->localhost.localdomain:mshvlm (CLOSE_WAIT)
...

My lyvi config:

% cat ~/.config/lyvi/rc 
mpd_config_file=/home/rolf/.config/mpd/mpd.conf

As for version information:
'pacman -Qii mpd' gives version '0.18.3-2'. Version 0.18 (2013/10/31) did entail a major rewrite to C++.
'pacman -Qii lyvi-git' gives version '55.4088e32-1'.
'pacman -Qii python' gives version '3.3.2-2'.

If you need any additional information to get comprehensive view on what is going on I would be happy to do so.

Hi,
Thanks for the report. Today I'm also experiencing some weird issues with Lyvi, although I don't have multiple connection problem. I don't have time to look into it right now but i'll do so as soon as possible.
By the way, the new version moved configuration file to ~/.config/lyvi/lyvi.conf (check out man lyvi)

EDIT: added a screencast

Last edited by OK100 (2013-11-13 19:03:26)

Offline

#202 2013-11-13 20:53:20

RMorel
Member
Registered: 2013-10-05
Posts: 10

Re: Lyvi - command-line lyrics (and more!) viewer

Thanks for pointing out the new configuration file, I just changed to it.

I have fixed the problem. See the pull request on Github.

The reason for the many, many connections was because you use a main loop which checks every second if the player is still running.
For mpd the recent commit changed it to trying if lyvi can create a new connection to mpd with Telnet(), but if it succeeded it never closed the connection.
This explains also why it was aggregating more connections over time.

Anyway thanks for the quick reply.

Offline

#203 2013-12-13 20:38:59

eayin
Member
Registered: 2013-12-13
Posts: 2

Re: Lyvi - command-line lyrics (and more!) viewer

Hi,
I noticed that xmms2 isn't supported yet. I tried to write a python file for it, but it's not working: http://paste.ofcode.org/gyedeEccChZRQBnsdVQVkJ
I put latter code in players/xmms2.py and added xmms2 to the players in players/__init__.py. Not sure what I am missing. It would be great, if lyvi supports xmms2 too.

Last edited by eayin (2013-12-13 20:41:51)

Offline

#204 2013-12-13 21:57:32

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Lyvi - command-line lyrics (and more!) viewer

eayin wrote:

Hi,
I noticed that xmms2 isn't supported yet. I tried to write a python file for it, but it's not working: http://paste.ofcode.org/gyedeEccChZRQBnsdVQVkJ
I put latter code in players/xmms2.py and added xmms2 to the players in players/__init__.py. Not sure what I am missing. It would be great, if lyvi supports xmms2 too.

Hi, the main problem with your code is you are using getattr instead of setattr wink. The plugin is now in the master branch. Thanks!

Offline

#205 2013-12-13 22:01:35

eayin
Member
Registered: 2013-12-13
Posts: 2

Re: Lyvi - command-line lyrics (and more!) viewer

Thank you for the hint, it works now fine: http://paste.ofcode.org/d2tgEPixqUHzBXdDPEujqd
I converted the time from the string to an integer in seconds to have the same format that cmus.py has for the duration time.

Edit: This morning I've seen that you already fixed the time in the master yesterday. Pretty neat how you improved the general code style (much shorter and better).

Last edited by eayin (2013-12-14 10:59:10)

Offline

#206 2013-12-28 20:09:59

huseyin
Member
Registered: 2013-12-28
Posts: 7

Re: Lyvi - command-line lyrics (and more!) viewer

Hi,

I'm using cmus and trying to fetch lyrics with lyvi. When I run lyvi it does the search for the current song. But doesn't show the lyrics. Pressing "a" key shows information but nothing further.
I'm on xubuntu 13.10 by the way. I can post more information if I know what to post smile

Thanks in advance.

huseyin

Offline

#207 2013-12-28 20:53:32

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: Lyvi - command-line lyrics (and more!) viewer

huseyin, 
Welcome to the Arch Linux forums.  it is unambiguous that we can only support Arch Linux here.  Of course, everyone is welcome to use the forums as a resource, even if one is not using Arch.  I realize that this is a special case where you have found an application that is only supported here (Arch Linux Community Contributions).  Thank you for being forthcoming that you are running Xubuntu.  I am going to allow this to proceed as this is OK100's thread and this is where he has set up his support.  But...  If this thread starts into the quirks of Xubuntu vs Arch, the moderators will cut it off.  We cannot permit the topic to become muddied for Arch users.

OK100,
You may want to contact Huseyin outside of these forums

Last edited by ewaller (2013-12-28 20:53:56)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#208 2013-12-29 11:28:23

huseyin
Member
Registered: 2013-12-28
Posts: 7

Re: Lyvi - command-line lyrics (and more!) viewer

update:

I've figured out that the main problem was with glyrc. I was using version 1.0.1 and upgraded to 1.0.2 and now, I can retrieve lyrics using glyrc. But, I still cannot get the lyrics with lyvi. When I run lyvi it figures out the current song from cmus and I get the text about search info on the lyrics screen but no lyrics.

Offline

#209 2013-12-29 21:25:08

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Lyvi - command-line lyrics (and more!) viewer

huseyin wrote:

update:

I've figured out that the main problem was with glyrc. I was using version 1.0.1 and upgraded to 1.0.2 and now, I can retrieve lyrics using glyrc. But, I still cannot get the lyrics with lyvi. When I run lyvi it figures out the current song from cmus and I get the text about search info on the lyrics screen but no lyrics.

Does Lyvi show "No lyrics found" or nothing at all? Also, did you recompile plyr after upgrading glyr?

Offline

#210 2013-12-29 21:46:34

huseyin
Member
Registered: 2013-12-28
Posts: 7

Re: Lyvi - command-line lyrics (and more!) viewer

Hi OK100. Thanks for your reply.

Lyvi finds out the currently playing song and starts searching for it. I see some search text including site names like Amazon, Last.fm, Pandora, etc. (I cannot select/copy text). I also see "lyrics  All" text on the right lower corner. When I press "a" I see text about the artist. Pressing "a" second time tells me that "no guitar tabs found", third time brings me back to the search screen. When song changes the text on the search/lyrics screen changes accordingly.

I have recompiled lyvi and cmus player as well after I have upgraded glyrc to 1.0.2. Do you mean player by plyr or there is something I am missing?

Another thing is that I saw some discussions about lyvi.conf file which I don't have. I couldn't find an example about a standard lyvi.conf file. Do I really need it?

Thanks again.

Offline

#211 2013-12-29 22:18:42

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Lyvi - command-line lyrics (and more!) viewer

Hi,

huseyin wrote:

Lyvi finds out the currently playing song and starts searching for it. I see some search text including site names like Amazon, Last.fm, Pandora, etc. (I cannot select/copy text). I also see "lyrics  All" text on the right lower corner. When I press "a" I see text about the artist. Pressing "a" second time tells me that "no guitar tabs found", third time brings me back to the search screen. When song changes the text on the search/lyrics screen changes accordingly.

If the text looks like this, pressing the R key might help. However, for some songs I'm getting this text even with latest libglyr. One of the glyr providers seems to be broken again.

I have recompiled lyvi and cmus player as well after I have upgraded glyrc to 1.0.2. Do you mean player by plyr or there is something I am missing?

I meant plyr - python bindings for libglyr. There is no need to recompile cmus wink

Another thing is that I saw some discussions about lyvi.conf file which I don't have. I couldn't find an example about a standard lyvi.conf file. Do I really need it?

You don't need the configuration file necessarily, although you might want to change some options (see Configuration section in mal lyvi for details).

Offline

#212 2013-12-29 23:00:44

huseyin
Member
Registered: 2013-12-28
Posts: 7

Re: Lyvi - command-line lyrics (and more!) viewer

I have installed the latest version of libglyr (I've finally figured out) and recompiled plyr smile But, didn't help.

Indeed I see a similar text as in the link you've posted but pressing the R key didn't help either.

I can download the lyrics using glyrc. I think i have to be happy with that at the moment smile May be I'll try to write a small script using 'cmus-remote -Q' command and download the currently playing song's lyrics without typing whole artist/title manually.

Thanks for the help.

Offline

#213 2013-12-30 10:13:07

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Lyvi - command-line lyrics (and more!) viewer

huseyin wrote:

I have installed the latest version of libglyr (I've finally figured out) and recompiled plyr smile But, didn't help.

Indeed I see a similar text as in the link you've posted but pressing the R key didn't help either.

I can download the lyrics using glyrc. I think i have to be happy with that at the moment smile May be I'll try to write a small script using 'cmus-remote -Q' command and download the currently playing song's lyrics without typing whole artist/title manually.

Thanks for the help.

Just for sure,  did you press "R" (Shift + r) and not "r" key? wink

Offline

#214 2013-12-30 10:36:09

huseyin
Member
Registered: 2013-12-28
Posts: 7

Re: Lyvi - command-line lyrics (and more!) viewer

Indeed I pressed R (Reload metadata for current view) smile
It reloads the current view meaning; you see the screen clearing, "searching..." text appearing and going back to the screen similar to the one in your link.

I've had a look at the python code actually. I'm not that good at python (me an old Fortran programmer) but I can give it a try as a fun project and make sure I just download the lyrics for currently playing song for cmus.

Thanks again.

Offline

#215 2013-12-31 00:18:56

huseyin
Member
Registered: 2013-12-28
Posts: 7

Re: Lyvi - command-line lyrics (and more!) viewer

ok, here is my humble tcsh script to download lyrics of the currently playing song in cmus player: smile

ARTIST=`cmus-remote -Q | grep "tag artist " | cut -d " " -f 3-`
TITLE=`cmus-remote -Q | grep "tag title " | cut -d " " -f 3-` 

glyrc lyrics -a "$ARTIST" -t "$TITLE"

Offline

#216 2013-12-31 09:52:07

huseyin
Member
Registered: 2013-12-28
Posts: 7

Re: Lyvi - command-line lyrics (and more!) viewer

I correct myself smile The above script is not tcsh. Here is an updated one in bash:

#!/bin/bash

ARTIST=$(cmus-remote -Q | grep "tag artist " | cut -d " " -f 3-)
TITLE=$(cmus-remote -Q | grep "tag title " | cut -d " " -f 3-) 

FILE='/home/user/lyrics/'"$ARTIST"'__'"$TITLE"'_lyrics_1.txt'

if [ -e "$FILE" ]
then
  echo lyric already exists $FILE
else
  glyrc lyrics -a "$ARTIST" -t "$TITLE"
fi

Offline

#217 2014-08-15 15:15:35

rogorido
Member
Registered: 2009-08-17
Posts: 111

Re: Lyvi - command-line lyrics (and more!) viewer

I can not start lyvi. It ends with the following error message

Traceback (most recent call last):
  File "/usr/bin/lyvi", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 2876, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 449, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 745, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 639, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Pillow

Any ideas?

UPDATE: I had to install the package python-pillow and it seems to work. Sorry for the noise

Last edited by rogorido (2014-08-15 16:12:03)

Offline

#218 2015-05-21 02:37:45

yefi
Member
Registered: 2015-03-22
Posts: 8

Re: Lyvi - command-line lyrics (and more!) viewer

Is it possible to edit the lyrics/guitartabs lyvi fetches?

I've noticed that lyvi is caching locally what glyr fetches (or maybe glyr is doing the caching also, I'm not sure). I was wondering then if there's any way possible to edit this info, even if it's a big hassle, because then this service would be perfect.

Offline

Board footer

Powered by FluxBB