Printable Version of Topic

Click here to view this topic in its original format

AMIP Community _ SDK Support _ Getting started with the SDK

Posted by: DJMatty Aug 14 2006, 08:08 AM

Hi

I've just started to play with the AMIP SDK and I'm having problems getting it to do anything.

I have AMIP running in winamp, its changing my Messenger np message, and also creating a file, so it's running ok. I can also telnet to port 60333 on my pc and that gets connected, but doesn't do much else when I type stuff.

However when I use the SDK the ac_init_client returns 1, but the ac_eval returns 3 (CONNECTIONFAILED).

Here is the code i am using, this was built using VS2005, it's simple console app.

CODE
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include "ac.h"

#pragma comment(lib, "ac.lib")


int _tmain(int argc, _TCHAR* argv[])
{
    int err = ac_init_client("127.0.0.1", 60333, 1000, 5, 1);

    if(err == 1)
    {
        char np[2048];

        err = ac_eval("var_name",np);

        if(err == AC_ERR_NOERROR)
        {
            printf("Now playing %s\n", np);
        }
        else
        {
            printf("Error: %d\n", err);
        }
    }

    ac_uninit();

    _getch();

    return 0;
}


Can anyone see anything obviously wrong? Do I need a specific version of AMIP to work with the SDK? (I'm using 2.53 beta at present)

I've also downloaded the java sdk and tried the example bat file, that also throws a ConnectionFailedException so I'm guessing it's not to do with my code but how I've got AMIP set up or how the SDK is set up... can anyone point me in the right direction?

Thanks

Matt

Posted by: Serge Aug 14 2006, 10:39 AM

Please check that you have latest AMIP beta running, the file date (amip.dll or gen_irc.dll) should be 2006-07-24.

Also get some tool like netstat and check that it's AMIP lisening on port 60333, not some other application.

Posted by: DJMatty Aug 14 2006, 04:34 PM

Hi Serge

I only have the gen_irc.dll in my plugins folder, it's date is 17-04-2006 and version is '2.5.3.0'.

I've used the TCPView tool from sysinternals, I can see winamp.exe listening on 60333, and when I telnet to it I can see the connection is created, however when I run my app, nothing is connected when I execute ac_init_client, and nothing is connected when i execute ac_eval... ac_eval returns immediately with an error.

I'll re-download the beta and try that.

Thanks

Matt

QUOTE(Serge @ Aug 14 2006, 11:39 AM) *

Please check that you have latest AMIP beta running, the file date (amip.dll or gen_irc.dll) should be 2006-07-24.

Also get some tool like netstat and check that it's AMIP lisening on port 60333, not some other application.


Posted by: DJMatty Aug 14 2006, 04:44 PM

Hi Serge

Just to let you know, i've downloaded the latest beta, gen_irc.dll is now 24/07/2006, but I'm still getting the same problem.

ac_init_client returns 1 and ac_eval returns 3...

Is there anything else I can try?

Thanks

Matt

Posted by: Serge Aug 14 2006, 06:57 PM

Your sample works fine on my PC. Please try the attached version that I've compiled. Just unpack and use with the supplied ac.dll.


Attached File(s)
Attached File  actest.zip ( 228.81k ) Number of downloads: 1484

Posted by: DJMatty Aug 15 2006, 01:14 PM

Hi Serge

That works great here on my work PC... I'll try it at home tonight and that will see if I have got a problem trying to build it in VS2005... or a problem with my install of winamp\amip at home...

Thanks for your help!

Matt

Posted by: DJMatty Aug 16 2006, 12:34 AM

Hi Serge

Just to let you know I've got it going on my PC at home with VS2005. I ended up removing the shoutcast dsp from winamp, and reinstalling that (not sure if it is a red herring), I also have some odd things going on with the ip addresses.

If amip API is running on 0.0.0.0 (as set in the configurator) I can only init the client on 127.0.0.1 for it to work... if I try to use my actual IP address 192.168.7.20 this fails with error code 3. And it seems to fail with this error code in any other combination that I have tried, like setting it to listen on 192.168.7.20 in the configurator and connecting my client to it on that address. Strange.

Anyway, its working ok now, and I'm reading playlists and getting events etc.

Oh and if anyone is interested in a C# wrapper for the SDK then let me know as I've built one for it.

Cheers

Matt

Posted by: Serge Aug 16 2006, 10:10 AM

Thanks for the information, such problem may be caused by a firewall.
If you want, I can include your C# wrapper in the AMIP SDK distribution.

Posted by: DJMatty Aug 16 2006, 04:57 PM

Hi Serge

Good point. I checked that windows firewall is disabled and I don't run any other personal firewall software so it should be ok... oh well.

I'll tidy up the c# wrappers and the example app and attach it to this thread for you.

Cheers

Matt

Posted by: DJMatty Aug 16 2006, 11:33 PM

Hi Serge

Here's the .NET wrapper and an example project that uses it.

Cheers

Matt



Attached File(s)
Attached File  AMIPClient.zip ( 209.21k ) Number of downloads: 1589

Posted by: Serge Aug 17 2006, 12:04 AM

Thank you!

Posted by: xxpor Sep 4 2006, 03:34 PM

could you repost that file, it is corrupted

Posted by: DJMatty Sep 4 2006, 05:53 PM

PM me your email and I will mail it directly... not sure why it would be corrupted though, i've just downloaded it and opened it in powerarchiver and it's fine.

Matt

Posted by: Serge Sep 25 2006, 01:29 PM

As for the IP binding problem, it's fixed in the recent beta released 24 September 2006. Due to a bug the binding worked only on 127.0.0.1.

Posted by: DJMatty Sep 26 2006, 01:55 PM

Great!

I'll download it and try it out when i'm back on a quick connection.

Thanks for letting me know!

Matt

Powered by Invision Power Board
© Invision Power Services