Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

phpRadio
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Tue Jan 17, 2006 4:56 am    Post subject: phpRadio Reply with quote

Hey all,

Forvige me that I'm new to the Icecast community, but I've been an avid Icecast user / developer for some time now. About a year ago I ventured into writing a personal PHP project that acts as a web jukebox, streaming to an icecast server. After some development, I thought it had some potential, so I began abstracting the code to work on other environments. I named the project phpRadio and submitted it to sourceforge (http://sourceforge.net/projects/phpradio). Check out my personal site at http://theholbrooks.org/phpRadio/ Beware, this is being hosted on DSL with only a 384K outgoing pipe, so I can only support 2 or 3 streams at a time :-/

phpRadio, ideally, is a fully functional jukebox. It currently uses a MySQL database to store information about configured streams and the songs associated with them. The general public can view basic information about each stream, and click links to download a playlist to listen. Users can be given a login and password, and after logged in, can execute more personal functions. They can browse a station's list of songs, queue songs to play next, and add songs to their list of favorites for one-click queueing, from any browser in the world. When given the privileges by an admin, users can also fast forward to the next song, restart the current song, and much more. Without queued songs to choose from, stations revert to a random selection of songs.

Site admins can execute more advanced functions, such as creating new stations, defining parameters such as Title, Genre, etc... adding and removing songs from a station, adding and removing Icecast servers that the station broadcasts to, etc...

Because of the custom features required for the Source Client (access MySQL for queued songs and intercept process signals to RW and FF), I couldn't use ices or another client, and no Shout bindings existed at the time for PHP, I wrote my own client in perl, using the Shout-perl libraries from icecast. However, this has always given phpRadio a "bastard child" feel to it, and I was never satisfied that my PHP project required perl as well.

So, about 2 weeks ago I started writing a PHP Extension (phpShout) that wraps libshout and provides PHP functions for creating, defining, and executing an icecast stream. Writing a PHP Extension has proven to be extremely painful and slow. I have successfully gotten the code to compile against libshout, but am still working on the interface. This project has been submitted to SourceForge as well, but I am still waiting for approval.

The reason for all this is that I feel my project(s) has reached the point where it is too big for me to maintain on my own, and would love to get the community involved in its further development and featureset. I am a big proponent of Open Source software, and know that my code needs many more eyes looking at it to find bugs, squash bugs, and develop new features. Also, since I have been isolated from the Icecast community, I fear I may have reproduced work already available from other projects. I have read up on the forums for the past couple days and have seen a few requests for just this type of project, with little response, so I hope phpRadio may be found to be a useful application. If there are other PHP jukebox applications out there, or especially a PHP Shout extension already written, please let me know so I can stop re-inventing the wheel and possibly merge our ideas together! Most importantly, if you enjoy PHP (or have experience writing PHP Extensions Wink ) and feel this is a project you would like to help develop, please let me know that too!

Sorry for the long post, but I hope to be an active member of the community in the future, and would like to inroduce myself with these projects!
Back to top
Anonymous
Guest





PostPosted: Thu Jan 19, 2006 6:34 am    Post subject: libShout lives! Reply with quote

w00t! Right now I am listening to music coming directly from my libshout PHP Extension! I have only implemented a small number of libshout functions so far... so far I have (PHP functions):

shout_create([host], [user], [password], [format], [protocol]) returns link_id
shout_open(link_id)
shout_send(link_id, buffer);
shout_sync(link_id)
shout_close(link_id)
shout_set_name(link_id, host)
shout_set_port(link_id, port)
shout_set_password(link_id, password)
shout_set_mount(link_id, mount)
shout_set_name(link_id, name)
shout_set_metadata(link_id, name, value)

All defaults can be set in php.ini I am still lacking a few set_ functions, all the get_ functions, and implementing the non-blocking IO. However, most of the remaining work will be copy-and-pasting my existing code. In shout_create(), the "host" parameter takes any of the following:

"host"
"host:port"
"host:port/mount"
"host/mount"
":port"
":port/mount"
"/mount"

With any unspecified coming from the defaults in php.ini I hope to have a release ready in the next week or so! Since this is all brand new, the functions can be anything we want them to be. I'd like some feedback if this looks a good, usable structure... if you'd like to see more parameters in shout_create()... or some new custom functions that wrap multiple libshout calls... etc...
Back to top
Anonymous
Guest





PostPosted: Wed Feb 15, 2006 5:35 am    Post subject: phpRadio-0.7 Reply with quote

I have released phpRadio-0.7. As stated in the release notes, there is no guarantee of operability, but I would love anybody interested in the project to download it, attempt an install, and (most importantly) let me know what doesn't work so I can fix it. Testers / Developers are wanted!
Back to top
Anonymous
Guest





PostPosted: Wed Mar 01, 2006 11:00 pm    Post subject: Reply with quote

I think your project seems sweet. I plan on testing/working with it as soon as I get a chance for the streaming projects I'm working on.

LAter,
Robb
Back to top
Anonymous
Guest





PostPosted: Tue Aug 15, 2006 10:59 pm    Post subject: Almost there!? Reply with quote

Hi Static, Robbt,

I'm trying out the 0.7 svn release, after some code tweaking and filling in some defaults in the database i finally got the (very nice!) interface working.
Now it seems it's connecting with my icecast2 server, but it dies with an 'Out of memory' error. Does one of you have any idea how to fix this? or how i could do some better debugging ..

my debug output:

Code:

DEBUG(4): ICServer->refresh() parsing version='2.3.1'
DEBUG(2): Executing command: '/usr/bin/php /var/www/phpradio/html/stream.php 2>/dev/null myradio'
DEBUG(2): Return Value: '0', Output: Array
(
    [0] =>
    [1] => Warning: shout_pcreate(): Error setting user to '(null)': Out of memory
    [2] =>  in /var/www/phpradio/lib/Shout.php on line 15
    [3] =>
    [4] => Warning: shout_pcreate(): Error setting password to '(null)': Out of memory
    [5] =>  in /var/www/phpradio/lib/Shout.php on line 15
    [6] =>
    [7] => Warning: shout_open(): Error Connecting: Out of memory in /var/www/phpradio/lib/Shout.php on line 166
)

DEBUG(3): ICStation->fetchPID(): Issuing CMD=ps -C php -o pid= -o args= | grep "stream.php myradio$"
DEBUG(3): ICStation->fetchPID(): OUTPUT=
DEBUG(4): GOOD MSG=Successfully Started: mynick
DEBUG(4): goto(): Redirecting to '/station.php'
DEBUG(6): FS_ROOT=/var/www/phpradio
DEBUG(6): HTML_ROOT=
DEBUG(2): cleanGPC(): Cleaning Array
(
)

DEBUG(2): cleanGPC(): Cleaning Array
(
)


Joost
Back to top
Anonymous
Guest





PostPosted: Thu Oct 19, 2006 10:00 pm    Post subject: Reply with quote

Hi Static,

you project is defenitely what i need , i will try to test it asap and let you know Wink
Back to top
Anonymous
Guest





PostPosted: Thu Oct 26, 2006 3:25 pm    Post subject: Re: Almost there!? Reply with quote

Joost wrote:

Now it seems it's connecting with my icecast2 server, but it dies with an 'Out of memory' error. Does one of you have any idea how to fix this? or how i could do some better debugging ..
]

Joost


i experienced the same error yesturday on debian , i try to change memory limit in the php.ini but still got the same error

so i manage to recompile php completelty but now i can't compile phpShout ;(

i get errors like

Code:

dir/php_shout.c:151: error: `shout_globals' undeclared (first use in this function)
Back to top
razametal



Joined: 03 Nov 2006
Posts: 24
Location: Manta - Ecuador

PostPosted: Fri Nov 03, 2006 2:49 am    Post subject: Debian Reply with quote

Hi all,

Quote:
i experienced the same error yesturday on debian ,


Can you post the steps required to install on Debian? I'm getting a lot of errors trying to view phpradio on my Debian Etch box:

Code:
Warning: Invalid argument supplied for foreach() in /home/gsalas/public_html/phpradio/lib/common.php on line 5


Code:
Warning: require_once(config.php) [function.require-once]: failed to open stream: No such file or directory in /home/gsalas/public_html/phpradio/html/admin/admusers.php on line 2

Fatal error: require_once() [function.require]: Failed opening required 'config.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/gsalas/public_html/phpradio/html/admin/admusers.php on line 2

_________________
Only The Good Die Young
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jcr
Modérateur français
Modérateur français


Joined: 14 Apr 2006
Posts: 544
Location: France, Auvergne

PostPosted: Fri Nov 03, 2006 7:42 am    Post subject: Re: Almost there!? Reply with quote

[quote="velk"]
i experienced the same error yesturday on debian , i try to change memory limit in the php.ini but still got the same error

so i manage to recompile php completelty but now i can't compile phpShout ;(

i get errors like

Code:

dir/php_shout.c:151: error: `shout_globals' undeclared (first use in this function)

Well, this means there is a discrepancy between libshout version and php-shout version. I experienced it once when trying builds on a development release for (now beta) opensuse 10.2, while it builds fine on Fedora 5 and 6 or opensuse 10.1.
Latest phpshout only compiles on svn libshout, not commonly included in standard distributions.
_________________
Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jcr
Modérateur français
Modérateur français


Joined: 14 Apr 2006
Posts: 544
Location: France, Auvergne

PostPosted: Fri Nov 03, 2006 7:49 am    Post subject: Re: Debian Reply with quote

razametal wrote:

Code:
Warning: Invalid argument supplied for foreach() in /home/gsalas/public_html/phpradio/lib/common.php on line 5

This has to do with the station list. As phpRadio comes without anything to initialize the database, you'll have to manually insert some data in tables before it can run smoothly.
Quote:

Code:
Warning: require_once(config.php) [function.require-once]: failed to open stream: No such file or directory in /home/gsalas/public_html/phpradio/html/admin/admusers.php on line 2

Fatal error: require_once() [function.require]: Failed opening required 'config.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/gsalas/public_html/phpradio/html/admin/admusers.php on line 2

This is another phpRadio bug. When you require( 'config.php', which sits in parent directory, you have not yet defined include path. So you have, in all admin scripts to replace
require_once( 'config.php' ) with require_once( '../config.php' )

This might solve parts of the problem.
_________________
Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
razametal



Joined: 03 Nov 2006
Posts: 24
Location: Manta - Ecuador

PostPosted: Fri Nov 03, 2006 3:50 pm    Post subject: Reply with quote

Thank you for your help.

I've another error at admin/admstation.php when trying to add a new station.

Code:
1064 : You have an error in your SQL syntax near '/ limit 1' at line 1


Thank you in advance Smile
_________________
Only The Good Die Young
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jcr
Modérateur français
Modérateur français


Joined: 14 Apr 2006
Posts: 544
Location: France, Auvergne

PostPosted: Fri Nov 03, 2006 5:53 pm    Post subject: Reply with quote

razametal wrote:
Thank you for your help.

I've another error at admin/admstation.php when trying to add a new station.

Code:
1064 : You have an error in your SQL syntax near '/ limit 1' at line 1


Thank you in advance Smile


Sounds you got another one Smile Congratulations.
If you print the query, you'll see that $id is not initialized and the query is invalid SQL. I'm writing a work-around for it.
_________________
Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Anonymous
Guest





PostPosted: Tue Dec 26, 2006 9:15 pm    Post subject: Reply with quote

i finally got the phpShout client to work

i ve done with own client that interface with a mysql database and a website were users can request tracks

all works fine excepts sometimes i get nothing as the song name

i use the shout_set_metadata function like this ( i call this function one time before sending a new track to icecast)


Quote:

// $r is an array built with mysql_fetch_array
$song_tag = sprintf('%s-%s [Requested by %s]',$r['artist'],$r['title'],$r['login']);

shout_set_metadata($id, 'song', $song_tag);



it works fine in most case but sometimes i get no data in the song tag after song change

so my client (winamp) just display "stream"

i opened the icecast error log file but i cant find any info about the error

i just see messages when the change went fine


do u experienced errors like this ?
Back to top
jcr
Modérateur français
Modérateur français


Joined: 14 Apr 2006
Posts: 544
Location: France, Auvergne

PostPosted: Wed Dec 27, 2006 10:58 am    Post subject: Reply with quote

I sometimes had the same error when IDs contain invalid UTF8 encoding characters. Simply retagging files correct the problem.
_________________
Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Anonymous
Guest





PostPosted: Wed Dec 27, 2006 3:02 pm    Post subject: Reply with quote

are u talking about the "song" tag or filenames , id3tag

I now try to send at the same times two files of the same tracks on two differents servers :



i have one file "track1.ogg" and "track1.mp3"

(same file but with one in ogg format and other in mp3)

on the ogg icecast i get "stream" and on the other mp3 icecast i get the correct song tag , so it dont seems to be related to filenames or song tag
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber