Forum OpenACS Q&A: MP3 Jukebox Perl Dependancy

Collapse
Posted by David Newhook on
Hi,

I've been trying to get the OpenACS jukebox up and running.  I
confess to knowing nothing about PERL.  I'm unable to run the root
commands specified in the documentation to install the perl CPAN
module "MPEG::MP3Info" as I don't have FTP access to the outside
world.  Is there anyway of using the "MP3::Info" module that came
with the jukebox module for the original ACS instead?  I tried
changing the perl script "mp3_file_scan" to use the old module, but I
get the error:

Can't locate MP3/Info.pm in @INC (@INC
contains: /usr/lib/perl5/5.00503/i386-
linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-
linux /usr/lib/perl5/site_perl/5.005 .)
at /disk2/shrubweb/tss/packages/mp3-jukebox/bin/mp3_file_scan line 5.
    BEGIN failed--compilation aborted
at /disk2/shrubweb/tss/packages/mp3-jukebox/bin/mp3_file_scan line 5.
        while executing
    "exec "[acs_root_dir]/packages/mp3-jukebox/bin/mp3_file_scan"
$target_filename"

Can someone tell a no-clue-perl-user how to get this module installed
properly?

I'm running my server on port 80 by starting it as root and switching
the process to nsadmin.  Also using the latest AOLServer (3.4.2) +
patches from Mat Kovach against a recent OpenACS tarball (4th April
2002).

Many Thanks,

Dave Newhook

Collapse
Posted by defunct defunct on
Hi Dave,

How are you mate? Not seen you for a while. I hope you'll be joining us for OpenMSG's first birthday drink today??

Anyway, I assume this means you got a pretty good setup for OACS now?? Does this mean I can persuade you to help out with some testing 😉

Are you also running the oracle version at the moment? I'm trying to get a few more people who have oracle available. (I do have the disks if you want to borrow them)

If not I have a publicly visible server available you could do some testing on.... awww go on... you know you want to

Cheers
Simon

Collapse
Posted by David Cohen on
The short answer: you can put put the module in a directory that you can write to and then tell Perl where it is.

Read about it here

In this case, I think you should create a subdirectory called MP3 somewhere, put Info.pm in it and then tell Perl where to start looking for the MP3 sub-directory. So, if you set things up like this:

/home/newhook/MP3/Info.pm

you would say:

use lib '/home/newhook';

and so when Perl went looking for library (i.e. module) directories where there was a subdirectory called MP3, it would now find it off of /home/newhook.

Of course, you want to make sure that the "use lib /home/newhook" line appears before the "use MP3::Info.pm" line in the code, since otherwise Perl will try to load the Info.pm module before you tell it that there's a new directory that it should use when looking for modules.

The article above, btw, doesn't mention that you can also add libraries by using the "-I" flag in the first line of the Perl file (i.e. the "shebang" line (shebang = hash-bang = #!)) like this:

#!/usr/bin/perl -I/home/newhook (I forget if you'd need to quote the directory path or not when using -I)

The rest of the error message, btw, tells you what library directories Perl does know about, that is, which directories are in the @INC array. By using one of the techniques above, you will add another directory to the @INC array and so Perl will be able to find Info.pm (btw, .pm = perl module = library).

Collapse
4: Another MP3 module! (response to 1)
Posted by Rocael Hernández Rizzardini on
Hi David, about the MP3 Jukebox I know nothing but maybe I can help you in other way if you are interested.

We made a MP3 list module in order to stream the files to the clients on demand, intregated to openacs 3.2.x, so you can have multiple list (in theory because I havent tried it to much, I just wanted a single list). Check the module in action!

The features are:
  • Multiple list
  • It register who are listening what
  • You can graphic the results of the actual list like in the Polls module
  • It reencodes the MP3 song, so if you upload a song encoded at 128kbps it can perform as many reencodings as you want. For instance, you would like to have a version for modem users (24kpbs), ADSL users (56kbps) and good connection users (128kbps), etc.
  • For reencoding we use LAME
  • For streaming ICECAST
  • You can order the songs position in the same way you order the questions in the Polls module
  • Its integrated with the bboard, so you can discuss about a song (the users really like it)
  • It also has a very specific requirement of our client for track songs position list
  • It could be also easily modified to download the MP3s
  • For some reason the most of the time it do not work on linux (in windows it start automaticly winamp for example, but in linux it start to download the file)


If you are really interested or SOMEONE else at the community I can prepare a release, because I should probably need to document it well and clean it up a little bit the code.
Collapse
Posted by Peter Vessenes on
Hi David,

I wrote that segment of the original MP3 Jukebox for ACS, although I haven't looked at the openACS module, so caveat reador.. Your problem is that you need to specify @INC to include a local directory (any one that you have write / read access to will do) which contains a directory named MPEG, and then MP3Info.pm in that directory.

The original MP3 jukebox uses the -I flag when calling perl to allow a user to specify a local directory in which modules are kept. This flag is set in the tcl file packages/mp3jukebox/www/scanner.tcl: it's the following line in the original module:

set file_info [exec "perl" -I[acs_root_dir]/packages/mp3jukebox/bin [acs_root_dir]/packages/mp3jukebox/bin/mp3_file_scan $target_filename]
You can either place the new module in the packages/mp3jukebox/bin directory, or change the location that you'd like perl to look for your module; either should work.

Collapse
Posted by Walter Smith on
Hey Rocael.  Another nice job!  So is the problem with streaming to a Linux client a local (Linux) environment configuration issue, or is it something happening on the server side?

Mark me down as interested in your module.  I've got more immediate need for the chat functionality, but your jukebox looks like it would be a great addition as well.

Thanks.

Collapse
Posted by Rocael Hernández Rizzardini on
Thanks Walter!
I guess, it is a Linux Configuration Issue, Linux should automaticly launch a mp3 player when it got a .m3u file, as it happen in windows, if you found the answer post it here or mail me!

Is someone else interested in this module? If you Walter are really interested please mail me in a week or two to remind me it. Right now I'll be concentrated with the jchat module.

Collapse
Posted by Walter Smith on
Good deal Rocael.  I'll be in touch....
Collapse
Posted by Roberto Mello on
Rocael, it's not a "Linux" configuration issue or an OS configuration at all, it's a browser configuration issue. The OS has nothing to do with your MP3 playing tastes. Go in the applications part of your browser's configuration and tell it which application to run when it finds mp3 files and off you go.