Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

AIMP

Questions and comments specific to a particular plugin should go here.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

AIMP

Post by Pako »

It seems that AIMP player is becoming more and more popular.
That's why I thought it was lacking EventGhost plugin for it.

ATTENTION:
For proper function of this EventGhost plugin it is required the Web Control Plugin
(aimp_web_ctl.dll) from Vitaly Dyatlov to be installed to AIMP !

Note:
This plugin works even if AIMP is installed on a different computer than EventGhost
(but it must be connected to the same local network).

Download here.

Pako
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: AIMP

Post by igvk »

This is great to have plugin to control AIMP!

But - I noticed that when AIMP is shut down, this plugin prints error:

Code: Select all

Traceback (most recent call last) (1600):
  File "C:\Program Files (x86)\EventGhost\eg\Classes\Scheduler.py", line 137, in MainLoop
    func(*args, **kwargs)
  File "C:\Program Files (x86)\EventGhost\plugins\AIMP\__init__.py", line 279, in Polling
    song = self.MakeRequest("get_song_current", "json")
  File "C:\Program Files (x86)\EventGhost\plugins\AIMP\__init__.py", line 223, in MakeRequest
    self.con.request("GET", "/?action=%s" % name)
  File "httplib.pyc", line 910, in request
  File "httplib.pyc", line 927, in _send_request
  File "httplib.pyc", line 814, in putrequest
CannotSendRequest
[/color]

And it doesn't recover even when AIMP is started again.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: AIMP

Post by Pako »

Thank you for reporting this issue.
It has long seemed that no one ever used this plugin.
I'm currently working on something. Once that is done, I will return to AIMP.

Pako
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: AIMP

Post by Pako »

You can download the corrected version.

Pako
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: AIMP

Post by igvk »

Thanks!
It's working now.

Is it possible to add commands such as "stop playback after current file"?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: AIMP

Post by Pako »

igvk wrote:Is it possible to add commands such as "stop playback after current file"?
Unfortunately, the current version, it would be very unreliable.
It's because this (EG) plugin is based on the use (AIMP3) aimp-web-ctl plugin (that creates web server).
I can only offer such a feature, that offered aimp-web-ctl plugin.
It is true, that something more I could invent, but just something simple.
What you want to do I can not sufficiently comfortable, yet reliable.

Pako
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: AIMP

Post by igvk »

Ok, I underdastand this is a limitation of aimp-web-ctl.

And here is a small bug report for the EG plugin:

I have the following Python command in one of macros, and it can be autorepeated 20 times per second:
vol = eg.plugins.AIMP.get_volume(); eg.plugins.AIMP.set_volume(int(vol)-1)

Sometimes, I get the following error in logs:

Code: Select all

Error in Action: "vol = eg.plugins.AIMP.get_volume(); eg.plugins.AIMP.set_volume(int(vol)-1)"
Traceback (most recent call last) (1610):
  File "<string>", line 1, in <module>
  File "C:\Program Files (x86)\EventGhost\plugins\AIMP\__init__.py", line 420, in __call__
    return self.plugin.MakeRequest(self.__class__.__name__, self.value)
  File "C:\Program Files (x86)\EventGhost\plugins\AIMP\__init__.py", line 237, in MakeRequest
    self.con.request("GET", "/?action=%s" % name)
  File "httplib.pyc", line 910, in request
  File "httplib.pyc", line 927, in _send_request
  File "httplib.pyc", line 814, in putrequest
CannotSendRequest
Is it something that can be fixed?
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: AIMP

Post by igvk »

I have also noticed the following strange behaviour:
When AIMP isn't running, this plugins unsuccessfully tries to connect to TCP port 38475, and it repeats this process until source port of the outgoing connection also becomes 38475 - and it somehow establishes this connection.
After that, it's impossible to run AIMP with web-ctl.

I have never seen this with ZoomPlayer plugins.
That plugin manages to establish connection only when ZoomPlayer is running, and I don't see its unsuccessful attempts to connect in netstat or Process Hacker.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: AIMP

Post by Pako »

igvk wrote:I have the following Python command in one of macros, and it can be autorepeated 20 times per second:
vol = eg.plugins.AIMP.get_volume(); eg.plugins.AIMP.set_volume(int(vol)-1)
I am afraid that with it we can not do anything.
Only create a new plugin, for which would have not needed aimp-web-ctl.dll.
I think that communication based on the web server has too much overhead and therefore sometimes not manage.
igvk wrote:I have also noticed the following strange behaviour:
When AIMP isn't running, this plugins unsuccessfully tries to connect to TCP port 38475, and it repeats this process until source port of the outgoing connection also becomes 38475 - and it somehow establishes this connection.
After that, it's impossible to run AIMP with web-ctl.
Oh, that's interesting. With that, I'll hopefully be able to do something.
igvk wrote:I have never seen this with ZoomPlayer plugins.
That plugin manages to establish connection only when ZoomPlayer is running, and I don't see its unsuccessful attempts to connect in netstat or Process Hacker.
I also do not know Zoom Player plugin. However, the problem here is that we can also control AIMP, which is installed on another PC (than EventGhost). In this case, we can hardly determine if AIMP is running.

I see one possible way (I currently excludes the possibility to create a new plugin that does not need aimp-web-ctl.dll):
when AIMP is installed on the same PC as EventGhost, I can do some routines differently.

Pako
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: AIMP

Post by igvk »

It would be nice to fix this.
Is it possible to make only one persistent connection to aimp-web-ctl server?
P.S. With Zoomplayer plugin it is also possible to connect to ZP instance running on different computer.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: AIMP

Post by Pako »

igvk wrote:Is it possible to make only one persistent connection to aimp-web-ctl server?
This (EventGhost) plugin is done in such a way as to establish and maintain one connection for as long as possible.
igvk wrote:I have never seen this with ZoomPlayer plugins.
That plugin manages to establish connection only when ZoomPlayer is running, and I don't see its unsuccessful attempts to connect in netstat or Process Hacker.
igvk wrote:P.S. With Zoomplayer plugin it is also possible to connect to ZP instance running on different computer.
That's interesting. I have to see how this plugin can do that. To me it seems impossible.

Pako
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: AIMP

Post by igvk »

Pako wrote:This (EventGhost) plugin is done in such a way as to establish and maintain one connection for as long as possible.
I noticed with Process Hacker and also see with RawCap that it always establishes and quickly closes the connection - and does it very often
(several times a second).
Does it depend on the version of webctl plugin?

As for Zoomplayer, I looked at the plugin code, but couldn't find anything special at first glance - but that's probably because I don't know python.
It seems to connect to ZP in __init__ here:

Code: Select all

        # create and connect a socket
        self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
        eg.RestartAsyncore()
        self.settimeout(1.0)
        try:
            self.connect(address)
        except:
            pass
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: AIMP

Post by Pako »

There is a fundamental difference between AIMP and Zoom player plugins.
It can not be compared:
1) AIMP (through aimp-web-ctl.dll) creates a web (HTTP) server
(you can use your browser with the address localhost:38475 to control of AIMP)

2) Zoom player communicates via TCP socket (and without the need for further support plugin).

Unfortunately I can not try it, because there in the free version of Zoom player I can not use the TCP remote control.
Or am I doing something wrong.

Pako
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: AIMP

Post by igvk »

Isn't it possible to set up persistent connection to AIMP?
O.K., the protocol is HTTP, but is it possible to use an already established TCP connection without closing it (and use HTTP/1.1 persistent connection)?
Or aimp-web-ctl doesn't support it?
igvk
Experienced User
Posts: 60
Joined: Wed Jan 09, 2013 7:22 pm

Re: AIMP

Post by igvk »

I noticed that the problem with never-ending frequent connections is due to the fact that events triggering options were set.
I have switched them all off, and now it doesn't show itself the way it used to.
Post Reply