PDA

View Full Version : Help needed...trying to get RealSlim working with 6.x



gsamsa
2005-05-14, 16:48
I spent a little time recently trying to get RealSlim (the Rhapsody plugin) working with 6.1, and discovered some interesting things, but I'm not sure where to go from here. Maybe people here already understand why it stopped working as of version 5.4.1...but I don't think I've seen any thorough discussion of it. Anyway, I'm hoping someone might be able to help.

It was trivial to make the plugin superficially 6.1 compatible, and I was able to replace a line or two that wasn't working (cacheEntry stuff) with non-functional code. At that point, everything actually seemed to work just fine when I ran 6.1 from the commandline with "slimserver.pl". But it didn't work running as a service, or running "slim.exe" from the commandline. When I went back to 5.4.1, I saw the same thing -- but the problem didn't occur with 5.4.0.

At any rate, I was able to narrow down the problem a bit. receiveCookies() is never called when running the .exe, and I believe it's related to the failure of this (modified) line in initPlugin():

setsockopt($cookieSocket,
IP_LEVEL,
IP_ADD_MEMBERSHIP,
$ip_mreq)
or warn "Couldn't setsockopt: $!\n";

Running the .pl file (for 5.4.0, 5.4.1, 6.1), or the 5.4.0 .exe, that works fine, but running the 5.4.1.exe prints "Unknown error".

I found a recent bug on the activestate website that I assume is relevant:

http://bugs.activestate.com/show_bug.cgi?id=37890

"In Perl 5.8.3, calling setsockopt() with IPPROTO_IP (which equals 0) and IP_ADD_MEMBERSHIP (which equals 5) arguments causes an IGMP multicast join message to be sent on the network. This is the desired and expected behavior.

However, in Perl 5.8.6, the same call to setsockopt() will return undef (ie. setsockopt() failed), and no IGMP multicast join messages are sent on the network".

I happen to have 5.8.4 installed at home.

Now, I'd normally assume that the 5.4.0 and 5.4.1 binaries were compiled with the same version of Perl, but is this a possible explanation? If it is, can anyone think of any workarounds?

I'm an experienced software developer, but know virtually nothing about network programming or Perl. I don't mind taking the time and learning some stuff, but I wonder if anyone has any suggestions on where to begin with this problem.

Incidentally, I'm surprised that getting SlimServer to work with the various subscription services (Rhapsody/Napster/Yahoo) isn't a higher priority. Seems like even basic UPnP support would be very useful.

I'm attaching my modified version of the Plugin.pm file from RealSlim, in case anyone is interested.

JimB
2005-05-14, 17:04
I sadly have no programming abilty but I think your efforts are really great. If there is anything a lay person can do to help, let me know.

Could you post the unzipped version of your file. For some reason as I pull it down it says its corrupt.

Dont get surprised by slow response time to your questions. This question has been around a long time.

gsamsa
2005-05-14, 17:16
The .zip attachment looks ok to me when I re-download it from the forum, but anyway, I'm reattaching the file Plugin.pm as Plugin.pm.txt here.

CouchPotatoe
2005-05-15, 09:10
Hi,

This is great news and I am glad that someone is having a go at
getting Rhapsody working again with Slim as for me it is one of the most
important plugins ever released. It may also be worth noting that the
Rhapsody client was recently updated to v3 and I believe that causes yet
another set of issues for the plugin. No doubt at some stage Rhapsody
will enforce an update of their clients to v3
..
I hope you do persevere with this, could you also perhaps drop me an
email with your email address so I could send you an offlist reply.

slimdev <at> ukusa <dot> co <dot> uk

Thanks Kevin



gsamsa wrote:

>I spent a little time recently trying to get RealSlim (the Rhapsody
>plugin) working with 6.1, and discovered some interesting things, but
>I'm not sure where to go from here.
>

kdf
2005-05-16, 16:03
I just thought I'd give your updated plugin a test run to see if I can offer any
insights. I just discovered again why I never cared about Rhapsody support
being updated before. Not only is it not available to Linux users, its not
available to Canadians either.

So, all I can say is good luck. If you run into specific error messages, I will
try to offer help when I can.

-kdf

gsamsa
2005-05-18, 01:59
If you run into specific error messages, I will
try to offer help when I can.

Well, here's a specific question, which you may be able to answer: Was the win32 executable of 5.4.0 currently downloadable from slimdevices created with a different version of perlsvc than 5.4.1 and later versions? As I mentioned, there's a problem with one specific line, and it may be related to a perl bug. If that's the case, it may be a waste of time for me to try to fix it.

Also, if you understand Perl networking (which I imagine you do), do you have any idea why that line would be failing? This should be a general multicast issue, not a rhapsody specific one. The specific error message is unfortunately "Unknown Error" -- if you know how I can get more useful diagnostic information, that would also be helpful. Thanks.

gsamsa
2005-05-18, 03:20
Never mind the previous message. Think I figured out the problem now, more or less.

This page:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q257460

suggests that there are potential mismatches between versions of winsock and different header files. There must be a mismatch in perlsvc or something, which explains both the realslim error and the activestate perl bug I originally linked to.

Changing this:

setsockopt($cookieSocket,
IP_LEVEL,
IP_ADD_MEMBERSHIP, # IP_ADD_MEMBERSHIP = 5
$ip_mreq)
or warn "Couldn't setsockopt: $!\n";

to this:

setsockopt($cookieSocket,
IP_LEVEL,
12,
$ip_mreq)
or warn "Couldn't setsockopt: $!\n";

seems to fix the problems. At least, everything appears to work for me now.

I'm attaching the modified plugin.pm file both zipped and renamed as a .txt file, if anyone wants to check it out.

kdf
2005-05-18, 09:52
Quoting gsamsa <gsamsa.1p7ze0 (AT) no-mx (DOT) forums.slimdevices.com>:

>
> kdf Wrote:
> > If you run into specific error messages, I will
> > try to offer help when I can.
>
> Well, here's a specific question, which you may be able to answer: Was
> the win32 executable of 5.4.0 currently downloadable from slimdevices
> created with a different version of perlsvc than 5.4.1 and later
> versions?

This would be the kind of question I cannot answer. Not being at Slim Devices,
I dont have the kind of inside knowledge of knowing which version of PerlDev is
being used, or when upgrades are done (except for when the upgrade goes wrong,
and I catch a few comments i the checkins ;)

Glad you got it working, though. A lot of users will be very pleased.

-kdf

gkokinos
2005-05-19, 19:31
First off, thanks for getting this working again!

I've installed and managed to get the plugin loaded in v6, but have a quick question. Have you tested with version 2 or version 3 or rhapsody (or both)? I just tried with the realslim service and version 3 which didn't work. I'm going to rollback to version 2.x and see if that works as before.

gkokinos
2005-05-19, 19:40
Just answered my own question here, have everything working properly with 6.02 and Rhapsody 2.1.

Chris Wood
2005-05-20, 20:12
This is fantastic news, thank you so much for taking the time to do this!

Please continue on and try getting Slimserver 6.x to work on Rhapsody version 3.x.

On a side note I totally agree with the other poster's comment that Slim Devices should make subscription music service support a major priority. I pay Rhapsody $10/month for streaming music to my pc but I want to play it back in my living room on my hi-fi. Viddur's excellent RealSlim plugin was the reason I bought a squeezebox, and for a while things were great. Gsamsa just fixed what no one else managed to do in 6 months.

With the continuing music industry legal efforts I think that many people have decided to go-legal and give up on illegal mp3 downloading. The number of people with Napster/Rhapsody/Yahoo/Musicmatch subscriptions at $10-$15/month is growing and it is these people Slim Devices could have as new customers, people want music in their living room, not just on their mp3 player or pc. If you don't do it others will.

I saw a commercial on tv the other day for Rhapsody, and it made mention of streaming music to your living room hi-fi, I was very surprised to notice the guy talking about this as a Roku Soundbridge played in the background. These are the players that also are/were using the Slimserver software. The commercial features Rhapsody version 3 software. So, intrigued, I just looked at Roku's website and see a press release dated October 12,2004 that proves that I am out-of-the-loop. It is too long to post here but here a few highlights and the link to the full version...

Roku SoundBridge can now play any song in Windows Media Audio (WMA) format, including protected WMA content from music services like Napster, MSN Music, Musicmatch and Wal-Mart. Roku SoundBridge will also be part of the PlaysForSure logo program, which gives consumers an easy way to identify devices and services verified to work together.

"Roku is releasing its free 2.0 software update for all Roku SoundBridge network music players today."...
...“With the increasing popularity of online music and video services, Windows Media Connect overcomes a key hurdle for consumers by making protected content that is purchased or rented via a subscription service available to any connected device in the home,” said Jonathan Usher, director of the Windows Digital Media Division at Microsoft. “Roku’s support of Windows Media Connect and PlaysForSure allows consumers to easily identify services that will work with SoundBridge, ensuring enjoyment of all digital music stored on Windows-based PCs throughout the home.”

Here's the link... http://www.rokulabs.com/about/press/wmc.php

Dean and others at Slim Devices I hope you are reading this ! As a consumer, this press release makes me want to buy their player. I have a Squeezebox so won't be doing that. This is doubly aggravating because Roku kind of just stepped in and took the open-source software to use on their own player. Which is their right. It would be nice if they decided to support Squeezebox with their "free 2.0 software" in return though and give us the same Windows Media protected content playback ability that their customers apparently now enjoy.

Someone let me know if I am getting all of this wrong. I'd love it if I could playback protected wma on my Squeezebox, I haven't figured out a way to do it. It would open up new possibilities because I can download an infinite number of protected non-burnable wma files onto my harddisk under rhapsody's subscription plan for $10/month. If I get Rhapsody-to-go for $15/month I can then transfer them to the mp3 player I don't yet own. I'd pay this if it would let me stream them to my Squeezebox without me having to jump through hoops and climb mountains to get everything working and stable. I'm reasonably technically minded but the hopeless millions are more lost than me when it comes to all this. It should be easy, please help to make it so.

Again, thankyou gsamsa.

[sorry for the extra long post - i've a lot to get off my chest here, and accept my apology if this seems like thread hijacking, this just seems related.]



Never mind the previous message. Think I figured out the problem now, more or less.

This page:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q257460

suggests that there are potential mismatches between versions of winsock and different header files. There must be a mismatch in perlsvc or something, which explains both the realslim error and the activestate perl bug I originally linked to.

Changing this:

setsockopt($cookieSocket,
IP_LEVEL,
IP_ADD_MEMBERSHIP, # IP_ADD_MEMBERSHIP = 5
$ip_mreq)
or warn "Couldn't setsockopt: $!\n";

to this:

setsockopt($cookieSocket,
IP_LEVEL,
12,
$ip_mreq)
or warn "Couldn't setsockopt: $!\n";

seems to fix the problems. At least, everything appears to work for me now.

I'm attaching the modified plugin.pm file both zipped and renamed as a .txt file, if anyone wants to check it out.

GreenMan
2005-07-30, 17:15
Hello all! This is my first post.

Well, yes I have my new Squeezebox2 and had high hopes for listening to Rhapsody through it, but alas, it seems not to be. Not yet at any rate.

I attempted to use the plugin, but it simply seems to stall SlimServer. I am using:

SlimServer Version: 6.1.1 - 3774 - Windows XP - EN - cp1252

I of course installed the plugin update posted in this forum, but to no avail. When I start the server, it just hangs until I right click on slim.exe in the WindowsXP task manager process list and 'end process tree'. Then I can manually restart the service.

Is the plugin effort dead at this point? I'm not a software developer. I'm on the QA side of the house. :-)

GreenMan

kdf
2005-07-30, 21:05
On 30-Jul-05, at 5:15 PM, GreenMan wrote:

>
> Hello all! This is my first post.
>
> Well, yes I have my new Squeezebox2 and had high hopes for listening to
> Rhapsody through it, but alas, it seems not to be. Not yet at any rate.
>
>
Rhapsody support via realslim as seen better days, that's for sure.
Search the forum; there was a user who did some updates to get basic
function for working with slimserver 6.0+. try to find that, it should
help a lot versus the latest on sourceforge.

-kdf

GreenMan
2005-07-31, 00:14
On 30-Jul-05, at 5:15 PM, GreenMan wrote:

>
> Hello all! This is my first post.
>
> Well, yes I have my new Squeezebox2 and had high hopes for listening to
> Rhapsody through it, but alas, it seems not to be. Not yet at any rate.
>
>
Rhapsody support via realslim as seen better days, that's for sure.
Search the forum; there was a user who did some updates to get basic
function for working with slimserver 6.0+. try to find that, it should
help a lot versus the latest on sourceforge.

-kdf

I noticed that GSAMA posted 05-18-2005, 10:20 AM saying he had a fix, but that's the one I tried that hung my Slimserver service. (It acutally hangs anyway on the original Rhapsody plugin). Is this the one you are aluding to when you say someone got it working? Hope not :-(

kdf
2005-07-31, 00:33
Quoting GreenMan <GreenMan.1t0vuz (AT) no-mx (DOT) forums.slimdevices.com>:

>
> kdf Wrote:
> > On 30-Jul-05, at 5:15 PM, GreenMan wrote:
> >
> > >
> > > Hello all! This is my first post.
> > >
> > > Well, yes I have my new Squeezebox2 and had high hopes for listening
> > to
> > > Rhapsody through it, but alas, it seems not to be. Not yet at any
> > rate.
> > >
> > >
> > Rhapsody support via realslim as seen better days, that's for sure.
> > Search the forum; there was a user who did some updates to get basic
> > function for working with slimserver 6.0+. try to find that, it should
> >
> > help a lot versus the latest on sourceforge.
> >
> > -kdf
>
> I noticed that GSAMA posted 05-18-2005, 10:20 AM saying he had a fix,
> but that's the one I tried that hung my Slimserver service. (It
> acutally hangs anyway on the original Rhapsody plugin). Is this the one
> you are aluding to when you say someone got it working? Hope not :-(

well, I wasnt tracking when, but I'll trust you on that. I have little to say
about rhapsody support; the arguement has been done, but also I'm in canada and
not using windows so I'm barred from even trying to use rhapsody. Isn't the
internet just such a wonder, no more borders....

-kdf

gsamsa
2005-07-31, 23:55
I noticed that GSAMA posted 05-18-2005, 10:20 AM saying he had a fix, but that's the one I tried that hung my Slimserver service. (It acutally hangs anyway on the original Rhapsody plugin). Is this the one you are aluding to when you say someone got it working? Hope not :-(

I haven't looked at this for a while -- haven't had the time -- but the version I posted works for me with 6.1. (Actually, sometimes it doesn't seem to recognize my library unless I stop and restart slimserver...not sure what's up with that.)

I did once post a note to the realslim forums on sourceforge explaining another thing I had to do to get things working...and that was actually causing slimserver to hang.


After installing RealSlim, I was unable to restart SlimServer on my windows XP pro box, either as a service or running manually (or running from the perl source code). It started OK as a service (manually or automatically) when I booted up, but it was hanging pretty much all other times I tried to start it.

I crudely traced the problem (using lots of print statements -- I barely know Perl) to the UPnP/Common.pm file, and this line:

my $peer = recv($listenSocket, $buf, 2048, 0);

I assume it's just waiting endlessly to get something from the socket.

If anyone else is having the same problem, my very crude fix was as follows:

Since this code just seemed to be about getting the local IP address, I commented out that line and the following one and replaced

$consts .= "use constant LOCAL_IP => \'" . inet_ntoa($addr) . "\';\n";

a few lines later with

$consts .= "use constant LOCAL_IP => \'" . xxx.xxx.xxx.xxx . "\';\n";

where xxx.xxx.xxx.xxx is my actual local IP (which I got using ipconfig).

You might want to give that a shot. The file in question is in Plugins/Rhapsody/CPAN/UPnP. Let me know if that helps.

gsamsa
2005-08-07, 13:47
After claiming that the version I posted worked with 6.1, I realized that it didn't didn't actually work with official 6.1. It had worked with an earlier beta, but in the more recent version it let you browse but not actually play.

Changing one line in the plugin.pm file seemed to fixed it.

# the original line
# Slim::Display::Animation::showBriefly($client, Slim::Display::Display::renderOverlay($line1, $line2, undef, Slim::Hardware::VFD::symbol('notesymbol')),undef,1 );

# the new line
$client->showBriefly($client->renderOverlay($line1, $line2, undef, Slim::Display::Display::symbol('notesymbol')));

Attaching a zipped version of the new file, in case anyone is interested.