PicoStreamer: the real live HTTP free radio server

What is and how works

Main features
  • Works on classic, cheap, linux web hostings
  • Totally web managed
  • Can create clusters using relay
  • Works through bisiness firewalls
  • Use standars source enocders made for
  • It's under GPL license

What is NOT PicoStreamer

Will start saying that PS absolutely is not one of this:

  • one of many playlists script which sends files loaded on server
  • an mp3 encoder
  • an mp3 player
  • a script to manage Shoutcast/Icecast
  • a p2p streaming software

Why PS?

PS was born for a definite purpose: enable live transmission of adio/video data using as server a normal web hosting. All actual solutions needs a dedicaded machine, on which setup the server streaming software (Shoutcast, Windows Media Server, Icecast, etc..).

Instead, using a normal web server such as Apache, with Perl support as cgi, it's possible setup PS and get a real live streaming server.

This minimal requirement enable an huge number of people to radio streaming world: all entities such as students, private people and no-profit organizations or community, that often are without finacial founds, can now make their own personal radio.

In this way, consider PS as a cheap alternative to other big solutions, but not a substitue: a real commercial web radio, with thousand of listeners can't rely to PS, also beacuse the hosting service ISPs many times setup a limit to traffic used, which if overloaded can make account disabled or increase many times the hosting costs.

The advantages

Away from economic aspect, PS has also an huge advantage: you can transmit and/or listen in that network environment, business typical, in which there is a blocking firewall that disable all but web traffic, so no streaming is possible.

In few words: if you can browse internet than you can transmit and/or listen radios made using PicoStreamer.

Passing retrictive firewalls means mainly reach an huge number of potential listeners, beacuse the big part of internet users, durning entire morning, uses the connectivity of their office.

The trick

Apache is not born to streaming. It's job is to serve documents via network. These documents (html pages, immages, files) have of course a definite lenght. This is a problem for the streaming: a stream of live audio/video data is not a document or any file on disk.

The trick is in the way of Apache transmit network data to the cgi scripts. Normally a PHP application receive ready data in his variables only when transfer is complete. In cgi way instead, this not happens: Apache send in realtime the arriving network data to the script cgi, which can read them while they come.

In this way, PicoStreamer (using PicoIcy) sends data from dj to web server: tecnically it's as sending a classic html form, which have lenght... infinite.

The transmission from web server to listeners, instead, it's done using classic way: from apache point of view the user is downloading a file which has lenght... unknown.

Interprocess communication

A problem left unsolved: how pass data from the unique receiver script to many scripts that are sending data to listeners? The solution that i've used is to use UDP data, locally in the box

So, the source send packets of stream, using UDP, to the listeners scripts that forward data to listeners over the net. If a listeners will not have sufficient bandwidth, his script instance will lost UDP data but, in any case, never will block the source or other listeners: this is the huge advantage of using udp, differently, eg. using things such as pipes.


By now, 3 years has been spent and PicoStreamer showed stable and functional. I now laugh when think that, when the idea was born, some people called me "mad" in mailing lists and newsgroup of developer people.


99% imageless - ©Vinz486